From a1ac75022c01b104b1e8f86f1e8bac5e3f458221 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 15 Dec 2012 17:49:43 +0100 Subject: [PATCH 001/259] Initial changes required for Cubiquity. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 9 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 66 +-- .../include/PolyVoxCore/DefaultIsQuadNeeded.h | 98 ++-- .../DefaultMarchingCubesController.h | 282 ++++++------ .../include/PolyVoxCore/Interpolation.h | 164 +++---- .../MarchingCubesSurfaceExtractor.h | 430 +++++++++--------- .../MarchingCubesSurfaceExtractor.inl | 101 ++-- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 4 +- .../include/PolyVoxCore/SurfaceMesh.h | 4 +- .../include/PolyVoxCore/SurfaceMesh.inl | 6 +- .../include/PolyVoxCore/Vector.inl | 20 +- .../include/PolyVoxCore/VertexTypes.h | 92 +++- .../include/PolyVoxCore/VolumeResampler.inl | 2 +- library/PolyVoxCore/source/Impl/Utility.cpp | 130 +++--- library/PolyVoxCore/source/VertexTypes.cpp | 79 +--- 15 files changed, 734 insertions(+), 753 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 76f53f89..1c9f6cdd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -81,7 +81,7 @@ namespace PolyVox struct IndexAndMaterial { int32_t iIndex; - int32_t uMaterial; //Should actually use the material type here, but this is ok for now. + typename VolumeType::VoxelType uMaterial; }; enum FaceNames @@ -109,13 +109,12 @@ namespace PolyVox }; public: - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); - + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); void execute(); private: - int32_t addVertex(float fX, float fY, float fZ, uint32_t uMaterial, Array<3, IndexAndMaterial>& existingVertices); + int32_t addVertex(float fX, float fY, float fZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices); bool performQuadMerging(std::list& quads); bool mergeQuads(Quad& q1, Quad& q2); @@ -128,7 +127,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; + SurfaceMesh >* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 211498c9..8dbe3c4a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -35,7 +35,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 6; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -58,6 +58,10 @@ namespace PolyVox memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); + uint32_t uRegionWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; + uint32_t uRegionHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; + uint32_t uRegionDepth = m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ() + 1; + m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); @@ -83,7 +87,7 @@ namespace PolyVox volumeSampler.setPosition(x,y,z); - uint32_t material; //Filled in by callback + typename VolumeType::VoxelType material; //Filled in by callback typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); @@ -92,20 +96,20 @@ namespace PolyVox // X if(m_funcIsQuadNeededCallback(currentVoxel, negXVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v2 = addVertex(regX - 0.5f, regY + 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); m_vecQuads[NegativeX][regX].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negXVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v2 = addVertex(regX - 0.5f, regY + 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); m_vecQuads[PositiveX][regX].push_back(Quad(v0, v3, v2, v1)); } @@ -113,20 +117,20 @@ namespace PolyVox // Y if(m_funcIsQuadNeededCallback(currentVoxel, negYVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); m_vecQuads[NegativeY][regY].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negYVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); m_vecQuads[PositiveY][regY].push_back(Quad(v0, v3, v2, v1)); } @@ -134,20 +138,20 @@ namespace PolyVox // Z if(m_funcIsQuadNeededCallback(currentVoxel, negZVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v3 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); m_vecQuads[NegativeZ][regZ].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negZVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); - uint32_t v3 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v3 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); m_vecQuads[PositiveZ][regZ].push_back(Quad(v0, v3, v2, v1)); } @@ -184,7 +188,7 @@ namespace PolyVox } m_meshCurrent->m_Region = m_regSizeInVoxels; - m_meshCurrent->removeUnusedVertices(); + //m_meshCurrent->removeUnusedVertices(); m_meshCurrent->m_vecLodRecords.clear(); LodRecord lodRecord; @@ -194,7 +198,7 @@ namespace PolyVox } template - int32_t CubicSurfaceExtractor::addVertex(float fX, float fY, float fZ, uint32_t uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) + int32_t CubicSurfaceExtractor::addVertex(float fX, float fY, float fZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) { uint32_t uX = static_cast(fX + 0.75f); uint32_t uY = static_cast(fY + 0.75f); @@ -206,14 +210,14 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. - rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(fX, fY, fZ), uMaterialIn)); + rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial (Vector3DFloat(fX, fY, fZ), uMaterialIn)); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; } //If we have an existing vertex and the material matches then we can return it. - if(rEntry.uMaterial == static_cast(uMaterialIn)) + if(rEntry.uMaterial == uMaterialIn) { return rEntry.iIndex; } @@ -260,7 +264,7 @@ namespace PolyVox { //All four vertices of a given quad have the same material, //so just check that the first pair of vertices match. - if(std::abs(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() - m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) < 0.001) + if(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() == m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) { //Now check whether quad 2 is adjacent to quad one by comparing vertices. //Adjacent quads must share two vertices, and the second quad could be to the diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index 81ddb9e5..ea6cf673 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -1,50 +1,50 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_DefaultIsQuadNeeded_H__ -#define __PolyVox_DefaultIsQuadNeeded_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -namespace PolyVox -{ - template - class DefaultIsQuadNeeded - { - public: - bool operator()(VoxelType back, VoxelType front, uint32_t& materialToUse) - { - if((back > 0) && (front == 0)) - { - materialToUse = static_cast(back); - return true; - } - else - { - return false; - } - } - }; -} - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_DefaultIsQuadNeeded_H__ +#define __PolyVox_DefaultIsQuadNeeded_H__ + +#include "PolyVoxCore/Impl/TypeDef.h" + +namespace PolyVox +{ + template + class DefaultIsQuadNeeded + { + public: + bool operator()(VoxelType back, VoxelType front, float& materialToUse) + { + if((back > 0) && (front == 0)) + { + materialToUse = static_cast(back); + return true; + } + else + { + return false; + } + } + }; +} + #endif //__PolyVox_DefaultIsQuadNeeded_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 8d5359e9..43aa0956 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -1,148 +1,134 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_MarchingCubesController_H__ -#define __PolyVox_MarchingCubesController_H__ - -#include "PolyVoxCore/BaseVolume.h" - -#include - -namespace PolyVox -{ - /** - * This class provides a default implementation of a controller for the MarchingCubesSurfaceExtractor. It controls the behaviour of the - * MarchingCubesSurfaceExtractor and provides the required properties from the underlying voxel type. - * - * PolyVox does not enforce any requirements regarding what data must be present in a voxel, and instead allows any primitive or user-defined - * type to be used. However, the Marching Cubes algorithm does have some requirents about the underlying data in that conceptually it operates - * on a density field. In addition, the PolyVox implementation of the Marching Cubes algorithm also understands the idea of each voxel - * having a material which is copied into the vertex data. - * - * Because we want the MarchingCubesSurfaceExtractor to work on any voxel type, we use a Marching Cubes controller (passed as - * a parameter of the MarchingCubesSurfaceExtractor) to expose the required properties. This parameter defaults to the DefaultMarchingCubesController. - * The main implementation of this class is designed to work with primitives data types, and the class is also specialised for the Material, - * Density and MaterialdensityPair classes. - * - * If you create a custom class for your voxel data then you probably want to include a specialisation of DefaultMarchingCubesController, - * though you don't have to if you don't want to use the Marching Cubes algorithm or if you prefer to define a seperate Marching Cubes controller - * and pass it as an explicit parameter (rather than relying on the default). - * - * For primitive types, the DefaultMarchingCubesController considers the value of the voxel to represent it's density and just returns a constant - * for the material. So you can, for example, run the MarchingCubesSurfaceExtractor on a volume of floats or ints. - * - * It is possible to customise the behaviour of the controller by providing a threshold value through the constructor. The extracted surface - * will pass through the density value specified by the threshold, and so you should make sure that the threshold value you choose is between - * the minimum and maximum values found in your volume data. By default it is in the middle of the representable range of the underlying type. - * - * \sa MarchingCubesSurfaceExtractor - * - */ - template - class DefaultMarchingCubesController - { - public: - /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing densities. - typedef VoxelType DensityType; - /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing materials. We're using a float here - /// because this implementation always returns a constant value off 1.0f. PolyVox also uses floats to store the materials in the mesh vertices - /// but this is not really desirable on modern hardware. We'll probably come back to material representation in the future. - typedef float MaterialType; - - /** - * Constructor - * - * This version of the constructor takes no parameters and sets the threshold to the middle of the representable range of the underlying type. - * For example, if the voxel type is 'uint8_t' then the representable range is 0-255, and the threshold will be set to 127. On the other hand, - * if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. - */ - DefaultMarchingCubesController(void) - :m_tThreshold(((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2) - ,m_eWrapMode(WrapModes::Border) - ,m_tBorder(VoxelType(0)) - { - } - - /** - * Converts the underlying voxel type into a density value. - * - * The default implementation of this function just returns the voxel type directly and is suitable for primitives types. Specialisations of - * this class can modify this behaviour. - */ - DensityType convertToDensity(VoxelType voxel) - { - return voxel; - } - - /** - * Converts the underlying voxel type into a material value. - * - * The default implementation of this function just returns the constant '1'. There's not much else it can do, as it needs to work with primitive - * types and the actual value of the type is already being considered to be the density. Specialisations of this class can modify this behaviour. - */ - MaterialType convertToMaterial(VoxelType /*voxel*/) - { - return 1; - } - - VoxelType getBorderValue(void) - { - return m_tBorder; - } - - /** - * Returns the density value which was passed to the constructor. - * - * As mentioned in the class description, the extracted surface will pass through the density value specified by the threshold, and so you - * should make sure that the threshold value you choose is between the minimum and maximum values found in your volume data. By default it - * is in the middle of the representable range of the underlying type. - */ - DensityType getThreshold(void) - { - return m_tThreshold; - } - - WrapMode getWrapMode(void) - { - return m_eWrapMode; - } - - void setThreshold(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - void setWrapMode(WrapMode eWrapMode, VoxelType tBorder = VoxelType(0)) - { - m_eWrapMode = eWrapMode; - m_tBorder = tBorder; - } - - private: - DensityType m_tThreshold; - WrapMode m_eWrapMode; - VoxelType m_tBorder; - }; -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_MarchingCubesController_H__ +#define __PolyVox_MarchingCubesController_H__ + +#include "PolyVoxCore/BaseVolume.h" + +#include + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// This class provides a default implementation of a controller for the MarchingCubesSurfaceExtractor. It controls the behaviour of the + /// MarchingCubesSurfaceExtractor and provides the required properties from the underlying voxel type. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// PolyVox does not enforce any requirements regarding what data must be present in a voxel, and instead allows any primitive or user-defined + /// type to be used. However, the Marching Cubes algorithm does have some requirents about the underlying data in that conceptually it operates + /// on a density field. In addition, the PolyVox implementation of the Marching Cubes algorithm also understands the idea of each voxel + /// having a material which is copied into the vertex data. + /// + /// Because we want the MarchingCubesSurfaceExtractor to work on any voxel type, we use a Marching Cubes controller (passed as + /// a parameter of the MarchingCubesSurfaceExtractor) to expose the required properties. This parameter defaults to the DefaultMarchingCubesController. + /// The main implementation of this class is designed to work with primitives data types, and the class is also specialised for the Material, + /// Density and MaterialdensityPair classes. + /// + /// If you create a custom class for your voxel data then you probably want to include a specialisation of DefaultMarchingCubesController, + /// though you don't have to if you don't want to use the Marching Cubes algorithm or if you prefer to define a seperate Marching Cubes controller + /// and pass it as an explicit parameter (rather than relying on the default). + /// + /// For primitive types, the DefaultMarchingCubesController considers the value of the voxel to represent it's density and just returns a constant + /// for the material. So you can, for example, run the MarchingCubesSurfaceExtractor on a volume of floats or ints. + /// + /// It is possible to customise the behaviour of the controller by providing a threshold value through the constructor. The extracted surface + /// will pass through the density value specified by the threshold, and so you should make sure that the threshold value you choose is between + /// the minimum and maximum values found in your volume data. By default it is in the middle of the representable range of the underlying type. + /// + /// \sa MarchingCubesSurfaceExtractor + /// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template + class DefaultMarchingCubesController + { + public: + /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing densities. + typedef VoxelType DensityType; + /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing materials. We're using a float here + /// because this implementation always returns a constant value off 1.0f. PolyVox also uses floats to store the materials in the mesh vertices + /// but this is not really desirable on modern hardware. We'll probably come back to material representation in the future. + typedef float MaterialType; + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Constructor + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// This version of the constructor takes no parameters and sets the threshold to the middle of the representable range of the underlying type. + /// For example, if the voxel type is 'uint8_t' then the representable range is 0-255, and the threshold will be set to 127. On the other hand, + /// if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + DefaultMarchingCubesController(void) + { + m_tThreshold = ((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Constructor + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// This version of the constructor allows you to set a custom threshold. + /// \param tThreshold The threshold to use. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + DefaultMarchingCubesController(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Converts the underlying voxel type into a density value. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// The default implementation of this function just returns the voxel type directly and is suitable for primitives types. Specialisations of + /// this class can modify this behaviour. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + DensityType convertToDensity(VoxelType voxel) + { + return voxel; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Converts the underlying voxel type into a material value. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// The default implementation of this function just returns the constant '1'. There's not much else it can do, as it needs to work with primitive + /// types and the actual value of the type is already being considered to be the density. Specialisations of this class can modify this behaviour. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + MaterialType convertToMaterial(VoxelType voxel) + { + return 1; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Returns the density value which was passed to the constructor. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// As mentioned in the class description, the extracted surface will pass through the density value specified by the threshold, and so you + /// should make sure that the threshold value you choose is between the minimum and maximum values found in your volume data. By default it + ///is in the middle of the representable range of the underlying type. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + DensityType getThreshold(void) + { + return m_tThreshold; + } + + private: + DensityType m_tThreshold; + }; +} + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Interpolation.h b/library/PolyVoxCore/include/PolyVoxCore/Interpolation.h index 5c76fe47..e52b321f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Interpolation.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Interpolation.h @@ -1,82 +1,82 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Interpolation_H__ -#define __PolyVox_Interpolation_H__ - -#include - -namespace PolyVox -{ - template - Type lerp( - const Type& v0,const Type& v1, - const float x) - { - assert((x >= 0.0f) && (x <= 1.0f)); - - //Interpolate along X - Type v0_1 = v0 + x * (v1 - v0); - - return v0_1; - } - - template - Type bilerp( - const Type& v00,const Type& v10,const Type& v01,const Type& v11, - const float x, const float y) - { - assert((x >= 0.0f) && (y >= 0.0f) && - (x <= 1.0f) && (y <= 1.0f)); - - // Linearly interpolate along x - Type v00_10 = lerp(v00, v10, x); - Type v01_11 = lerp(v01, v11, x); - - // And linearly interpolate the results along y - Type v00_10__v01_11 = lerp(v00_10, v01_11, y); - - return v00_10__v01_11; - } - - template - Type trilerp( - const Type& v000,const Type& v100,const Type& v010,const Type& v110, - const Type& v001,const Type& v101,const Type& v011,const Type& v111, - const float x, const float y, const float z) - { - assert((x >= 0.0f) && (y >= 0.0f) && (z >= 0.0f) && - (x <= 1.0f) && (y <= 1.0f) && (z <= 1.0f)); - - // Bilinearly interpolate along Y - Type v000_v100__v010_v110 = bilerp(v000, v100, v010, v110, x, y); - Type v001_v101__v011_v111 = bilerp(v001, v101, v011, v111, x, y); - - // And linearly interpolate the results along z - Type v000_v100__v010_v110____v001_v101__v011_v111 = lerp(v000_v100__v010_v110, v001_v101__v011_v111, z); - - return v000_v100__v010_v110____v001_v101__v011_v111; - } -} - -#endif //__PolyVox_Interpolation_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Interpolation_H__ +#define __PolyVox_Interpolation_H__ + +#include + +namespace PolyVox +{ + template + Type lerp( + const Type& v0,const Type& v1, + const float x) + { + assert((x >= 0.0f) && (x <= 1.0f)); + + //Interpolate along X + Type v0_1 = (v1 - v0) * x + v0; + + return v0_1; + } + + template + Type bilerp( + const Type& v00,const Type& v10,const Type& v01,const Type& v11, + const float x, const float y) + { + assert((x >= 0.0f) && (y >= 0.0f) && + (x <= 1.0f) && (y <= 1.0f)); + + // Linearly interpolate along x + Type v00_10 = lerp(v00, v10, x); + Type v01_11 = lerp(v01, v11, x); + + // And linearly interpolate the results along y + Type v00_10__v01_11 = lerp(v00_10, v01_11, y); + + return v00_10__v01_11; + } + + template + Type trilerp( + const Type& v000,const Type& v100,const Type& v010,const Type& v110, + const Type& v001,const Type& v101,const Type& v011,const Type& v111, + const float x, const float y, const float z) + { + assert((x >= 0.0f) && (y >= 0.0f) && (z >= 0.0f) && + (x <= 1.0f) && (y <= 1.0f) && (z <= 1.0f)); + + // Bilinearly interpolate along Y + Type v000_v100__v010_v110 = bilerp(v000, v100, v010, v110, x, y); + Type v001_v101__v011_v111 = bilerp(v001, v101, v011, v111, x, y); + + // And linearly interpolate the results along z + Type v000_v100__v010_v110____v001_v101__v011_v111 = lerp(v000_v100__v010_v110, v001_v101__v011_v111, z); + + return v000_v100__v010_v110____v001_v101__v011_v111; + } +} + +#endif //__PolyVox_Interpolation_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index b0d7c694..6fa98986 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -1,210 +1,220 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_SurfaceExtractor_H__ -#define __PolyVox_SurfaceExtractor_H__ - -#include "Impl/MarchingCubesTables.h" -#include "Impl/TypeDef.h" - -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/SurfaceMesh.h" -#include "PolyVoxCore/DefaultMarchingCubesController.h" - -namespace PolyVox -{ - template< typename VolumeType, typename Controller = DefaultMarchingCubesController > - class MarchingCubesSurfaceExtractor - { - public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, Controller controller = Controller()); - - void execute(); - - private: - //Compute the cell bitmask for a particular slice in z. - template - uint32_t computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask); - - //Compute the cell bitmask for a given cell. - template - void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace); - - //Use the cell bitmasks to generate all the vertices needed for that slice - void generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, - Array2DInt32& m_pCurrentVertexIndicesX, - Array2DInt32& m_pCurrentVertexIndicesY, - Array2DInt32& m_pCurrentVertexIndicesZ); - - //////////////////////////////////////////////////////////////////////////////// - // NOTE: These two functions are in the .h file rather than the .inl due to an apparent bug in VC2010. - //See http://stackoverflow.com/questions/1484885/strange-vc-compile-error-c2244 for details. - //////////////////////////////////////////////////////////////////////////////// - Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) - { - //FIXME - Should actually use DensityType here, both in principle and because the maths may be - //faster (and to reduce casts). So it would be good to add a way to get DensityType from a voxel. - //But watch out for when the DensityType is unsigned and the difference could be negative. - float voxel1nx = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py0pz())); - float voxel1px = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py0pz())); - - float voxel1ny = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny0pz())); - float voxel1py = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py0pz())); - - float voxel1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1nz())); - float voxel1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1pz())); - - return Vector3DFloat - ( - voxel1nx - voxel1px, - voxel1ny - voxel1py, - voxel1nz - voxel1pz - ); - } - - Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter) - { - static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { - {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; - - //FIXME - Should actually use DensityType here, both in principle and because the maths may be - //faster (and to reduce casts). So it would be good to add a way to get DensityType from a voxel. - //But watch out for when the DensityType is unsigned and the difference could be negative. - const float pVoxel1nx1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny1nz())); - const float pVoxel1nx1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny0pz())); - const float pVoxel1nx1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny1pz())); - const float pVoxel1nx0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py1nz())); - const float pVoxel1nx0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py0pz())); - const float pVoxel1nx0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py1pz())); - const float pVoxel1nx1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py1nz())); - const float pVoxel1nx1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py0pz())); - const float pVoxel1nx1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py1pz())); - - const float pVoxel0px1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny1nz())); - const float pVoxel0px1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny0pz())); - const float pVoxel0px1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny1pz())); - const float pVoxel0px0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1nz())); - //const float pVoxel0px0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py0pz())); - const float pVoxel0px0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1pz())); - const float pVoxel0px1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py1nz())); - const float pVoxel0px1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py0pz())); - const float pVoxel0px1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py1pz())); - - const float pVoxel1px1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny1nz())); - const float pVoxel1px1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny0pz())); - const float pVoxel1px1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny1pz())); - const float pVoxel1px0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py1nz())); - const float pVoxel1px0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py0pz())); - const float pVoxel1px0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py1pz())); - const float pVoxel1px1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py1nz())); - const float pVoxel1px1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py0pz())); - const float pVoxel1px1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py1pz())); - - const float xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - - weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * - pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - - weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * - pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + - weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + - weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * - pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const float yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + - weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - - weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * - pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + - weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - - weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const float zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + - weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * - pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - - weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + - weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * - pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - - weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + - weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * - pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - - weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * - pVoxel1px1py1pz); - - //Note: The above actually give gradients going from low density to high density. - //For our normals we want the the other way around, so we switch the components as we return them. - return Vector3DFloat(-xGrad,-yGrad,-zGrad); - } - //////////////////////////////////////////////////////////////////////////////// - // End of compiler bug workaroumd. - //////////////////////////////////////////////////////////////////////////////// - - //Use the cell bitmasks to generate all the indices needed for that slice - void generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, - const Array2DInt32& m_pPreviousVertexIndicesX, - const Array2DInt32& m_pPreviousVertexIndicesY, - const Array2DInt32& m_pPreviousVertexIndicesZ, - const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY); - - //The volume data and a sampler to access it. - VolumeType* m_volData; - typename VolumeType::Sampler m_sampVolume; - - //Used to return the number of cells in a slice which contain triangles. - uint32_t m_uNoOfOccupiedCells; - - //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; - - //Information about the region we are currently processing - Region m_regSizeInVoxels; - Region m_regSizeInCells; - /*Region m_regSizeInVoxelsCropped; - Region m_regSizeInVoxelsUncropped; - Region m_regVolumeCropped;*/ - Region m_regSlicePrevious; - Region m_regSliceCurrent; - - //Used to convert arbitrary voxel types in densities and materials. - Controller m_controller; - - //Our threshold value - typename Controller::DensityType m_tThreshold; - }; -} - -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl" - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_SurfaceExtractor_H__ +#define __PolyVox_SurfaceExtractor_H__ + +#include "Impl/MarchingCubesTables.h" +#include "Impl/TypeDef.h" + +#include "PolyVoxCore/Array.h" +#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/DefaultMarchingCubesController.h" + +namespace PolyVox +{ + template< typename VolumeType, typename Controller = DefaultMarchingCubesController > + class MarchingCubesSurfaceExtractor + { + public: + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, Controller controller = Controller()); + + void execute(); + + private: + //Compute the cell bitmask for a particular slice in z. + template + uint32_t computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask); + + //Compute the cell bitmask for a given cell. + template + void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask); + + //Use the cell bitmasks to generate all the vertices needed for that slice + void generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + Array2DInt32& m_pCurrentVertexIndicesX, + Array2DInt32& m_pCurrentVertexIndicesY, + Array2DInt32& m_pCurrentVertexIndicesZ); + + //////////////////////////////////////////////////////////////////////////////// + // NOTE: These two functions are in the .h file rather than the .inl due to an apparent bug in VC2010. + //See http://stackoverflow.com/questions/1484885/strange-vc-compile-error-c2244 for details. + //////////////////////////////////////////////////////////////////////////////// + Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) + { + //FIXME - Should actually use DensityType here, both in principle and because the maths may be + //faster (and to reduce casts). So it would be good to add a way to get DensityType from a voxel. + //But watch out for when the DensityType is unsigned and the difference could be negative. + float voxel1nx = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py0pz())); + float voxel1px = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py0pz())); + + float voxel1ny = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny0pz())); + float voxel1py = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py0pz())); + + float voxel1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1nz())); + float voxel1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1pz())); + + return Vector3DFloat + ( + voxel1nx - voxel1px, + voxel1ny - voxel1py, + voxel1nz - voxel1pz + ); + } + + Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter) + { + static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { + {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; + + //FIXME - Should actually use DensityType here, both in principle and because the maths may be + //faster (and to reduce casts). So it would be good to add a way to get DensityType from a voxel. + //But watch out for when the DensityType is unsigned and the difference could be negative. + const float pVoxel1nx1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny1nz())); + const float pVoxel1nx1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny0pz())); + const float pVoxel1nx1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1ny1pz())); + const float pVoxel1nx0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py1nz())); + const float pVoxel1nx0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py0pz())); + const float pVoxel1nx0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx0py1pz())); + const float pVoxel1nx1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py1nz())); + const float pVoxel1nx1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py0pz())); + const float pVoxel1nx1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1nx1py1pz())); + + const float pVoxel0px1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny1nz())); + const float pVoxel0px1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny0pz())); + const float pVoxel0px1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1ny1pz())); + const float pVoxel0px0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1nz())); + //const float pVoxel0px0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py0pz())); + const float pVoxel0px0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px0py1pz())); + const float pVoxel0px1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py1nz())); + const float pVoxel0px1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py0pz())); + const float pVoxel0px1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel0px1py1pz())); + + const float pVoxel1px1ny1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny1nz())); + const float pVoxel1px1ny0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny0pz())); + const float pVoxel1px1ny1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1ny1pz())); + const float pVoxel1px0py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py1nz())); + const float pVoxel1px0py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py0pz())); + const float pVoxel1px0py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px0py1pz())); + const float pVoxel1px1py1nz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py1nz())); + const float pVoxel1px1py0pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py0pz())); + const float pVoxel1px1py1pz = static_cast(m_controller.convertToDensity(volIter.peekVoxel1px1py1pz())); + + const float xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - + weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * + pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - + weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * + pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + + weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + + weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * + pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const float yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + + weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - + weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * + pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + + weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - + weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const float zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + + weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * + pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - + weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + + weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * + pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - + weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + + weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * + pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - + weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * + pVoxel1px1py1pz); + + //Note: The above actually give gradients going from low density to high density. + //For our normals we want the the other way around, so we switch the components as we return them. + return Vector3DFloat(-xGrad,-yGrad,-zGrad); + } + //////////////////////////////////////////////////////////////////////////////// + // End of compiler bug workaroumd. + //////////////////////////////////////////////////////////////////////////////// + + //Use the cell bitmasks to generate all the indices needed for that slice + void generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + const Array2DInt32& m_pPreviousVertexIndicesX, + const Array2DInt32& m_pPreviousVertexIndicesY, + const Array2DInt32& m_pPreviousVertexIndicesZ, + const Array2DInt32& m_pCurrentVertexIndicesX, + const Array2DInt32& m_pCurrentVertexIndicesY); + + //The volume data and a sampler to access it. + VolumeType* m_volData; + typename VolumeType::Sampler m_sampVolume; + + //Holds a position in volume space. + int32_t iXVolSpace; + int32_t iYVolSpace; + int32_t iZVolSpace; + + //Holds a position in region space. + uint32_t uXRegSpace; + uint32_t uYRegSpace; + uint32_t uZRegSpace; + + //Used to return the number of cells in a slice which contain triangles. + uint32_t m_uNoOfOccupiedCells; + + //The surface patch we are currently filling. + SurfaceMesh >* m_meshCurrent; + + //Information about the region we are currently processing + Region m_regSizeInVoxels; + Region m_regSizeInCells; + /*Region m_regSizeInVoxelsCropped; + Region m_regSizeInVoxelsUncropped; + Region m_regVolumeCropped;*/ + Region m_regSlicePrevious; + Region m_regSliceCurrent; + + //Our threshold value + typename Controller::DensityType m_tThreshold; + + //Used to convert arbitrary voxel types in densities and materials. + Controller m_controller; + }; +} + +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl" + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 23617603..e9761d1e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -24,19 +24,18 @@ freely, subject to the following restrictions: namespace PolyVox { template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, Controller controller) + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) ,m_regSizeInVoxels(region) - ,m_controller(controller) - ,m_tThreshold(m_controller.getThreshold()) { //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); m_regSizeInCells = m_regSizeInVoxels; m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); - m_sampVolume.setWrapMode(m_controller.getWrapMode(), m_controller.getBorderValue()); + m_controller = controller; + m_tThreshold = m_controller.getThreshold(); } template @@ -44,9 +43,9 @@ namespace PolyVox { m_meshCurrent->clear(); - const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; - const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; - const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions + uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; + uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; + uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions //For edge indices Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); @@ -137,18 +136,18 @@ namespace PolyVox const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperCorner().getX(); const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperCorner().getY(); - const int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + uZRegSpace = iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ(); //Process the lower left corner - int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); - int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); + iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); + iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); - uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); //Process the edge where x is minimal. iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); @@ -160,7 +159,7 @@ namespace PolyVox m_sampVolume.movePositiveY(); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); } //Process the edge where y is minimal. @@ -173,7 +172,7 @@ namespace PolyVox m_sampVolume.movePositiveX(); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); } //Process all remaining elemnents of the slice. In this case, previous x and y values are always available @@ -187,7 +186,7 @@ namespace PolyVox m_sampVolume.movePositiveX(); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); } } @@ -196,7 +195,7 @@ namespace PolyVox template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) { uint8_t iCubeIndex = 0; @@ -386,7 +385,7 @@ namespace PolyVox } //Save the bitmask - pCurrentBitmask[uXRegSpace][uYRegSpace] = iCubeIndex; + pCurrentBitmask[uXRegSpace][iYVolSpace- m_regSizeInVoxels.getLowerCorner().getY()] = iCubeIndex; if(edgeTable[iCubeIndex] != 0) { @@ -400,7 +399,7 @@ namespace PolyVox Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) { - const int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); //Iterate over each cell in the region for(int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); iYVolSpace <= m_regSliceCurrent.getUpperCorner().getY(); iYVolSpace++) @@ -413,7 +412,7 @@ namespace PolyVox const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; + uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; /* Cube is entirely in/out of the surface */ if (edgeTable[iCubeIndex] == 0) @@ -426,16 +425,16 @@ namespace PolyVox m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); - const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); + const Vector3DFloat n000 = computeSobelGradient(m_sampVolume); /* Find the vertices where the surface intersects the cube */ if (edgeTable[iCubeIndex] & 1) { m_sampVolume.movePositiveX(); const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); - const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); + const Vector3DFloat n100 = computeSobelGradient(m_sampVolume); - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerCorner().getZ())); @@ -445,12 +444,13 @@ namespace PolyVox //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - const typename Controller::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); - const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial100, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; m_sampVolume.moveNegativeX(); @@ -459,9 +459,9 @@ namespace PolyVox { m_sampVolume.movePositiveY(); const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); - const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); + const Vector3DFloat n010 = computeSobelGradient(m_sampVolume); - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ())); @@ -471,12 +471,13 @@ namespace PolyVox //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - const typename Controller::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); - const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial010, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; m_sampVolume.moveNegativeY(); @@ -485,9 +486,9 @@ namespace PolyVox { m_sampVolume.movePositiveZ(); const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); - const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); + const Vector3DFloat n001 = computeSobelGradient(m_sampVolume); - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ()) + fInterp); @@ -497,12 +498,13 @@ namespace PolyVox //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - const typename Controller::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); - const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial001, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; m_sampVolume.moveNegativeZ(); @@ -525,12 +527,11 @@ namespace PolyVox indlist[i] = -1; } - const int32_t iZVolSpace = m_regSlicePrevious.getLowerCorner().getZ(); - for(int32_t iYVolSpace = m_regSlicePrevious.getLowerCorner().getY(); iYVolSpace <= m_regSizeInCells.getUpperCorner().getY(); iYVolSpace++) { for(int32_t iXVolSpace = m_regSlicePrevious.getLowerCorner().getX(); iXVolSpace <= m_regSizeInCells.getUpperCorner().getX(); iXVolSpace++) - { + { + int32_t iZVolSpace = m_regSlicePrevious.getLowerCorner().getZ(); m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); //Current position @@ -538,7 +539,7 @@ namespace PolyVox const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerCorner().getY(); //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; + uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; /* Cube is entirely in/out of the surface */ if (edgeTable[iCubeIndex] == 0) @@ -610,9 +611,9 @@ namespace PolyVox for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) { - const int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - const int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - const int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index addaa962..b8d6b995 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -110,12 +110,12 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // PositionMaterial //////////////////////////////////////////////////////////////////////////////// - class PositionMaterial; + template class PositionMaterial; //////////////////////////////////////////////////////////////////////////////// // PositionMaterialNormal //////////////////////////////////////////////////////////////////////////////// - class PositionMaterialNormal; + template class PositionMaterialNormal; //////////////////////////////////////////////////////////////////////////////// // RawVolume diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h index 9ccc58fb..ce96c227 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h @@ -95,8 +95,8 @@ namespace PolyVox std::vector m_vecLodRecords; }; - template - polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials); + /*template + polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials);*/ } #include "PolyVoxCore/SurfaceMesh.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl index 45d24ada..af9f852b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl @@ -365,7 +365,7 @@ namespace PolyVox void SurfaceMesh::removeUnusedVertices(void) { std::vector isVertexUsed(m_vecVertices.size()); - fill(isVertexUsed.begin(), isVertexUsed.end(), false); + std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) { @@ -394,7 +394,7 @@ namespace PolyVox } //Currently a free function - think where this needs to go. - template + /*template polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials) { polyvox_shared_ptr< SurfaceMesh > result(new SurfaceMesh); @@ -460,7 +460,7 @@ namespace PolyVox result->m_vecLodRecords.push_back(lodRecord); return result; - } + }*/ template void SurfaceMesh::scaleVertices(float amount) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index 09501f18..9e65543a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -54,7 +54,7 @@ namespace PolyVox Vector::Vector(StorageType x, StorageType y) { #ifndef SWIGPYTHON // SWIG instantiates all constructors, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size == 2, "This constructor should only be used for vectors with two elements."); + //static_assert(Size == 2, "This constructor should only be used for vectors with two elements."); #endif m_tElements[0] = x; @@ -71,7 +71,7 @@ namespace PolyVox Vector::Vector(StorageType x, StorageType y, StorageType z) { #ifndef SWIGPYTHON // SWIG instantiates all constructors, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size == 3, "This constructor should only be used for vectors with three elements."); + //static_assert(Size == 3, "This constructor should only be used for vectors with three elements."); #endif m_tElements[0] = x; @@ -91,7 +91,7 @@ namespace PolyVox Vector::Vector(StorageType x, StorageType y, StorageType z, StorageType w) { #ifndef SWIGPYTHON // SWIG instantiates all constructors, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size == 4, "This constructor should only be used for vectors with four elements."); + //static_assert(Size == 4, "This constructor should only be used for vectors with four elements."); #endif m_tElements[0] = x; @@ -142,7 +142,7 @@ namespace PolyVox // vector with one element, and supporting this would cause confusion over the // behaviour of the constructor taking a single value, as this fills all elements // to that value rather than just the first one. - static_assert(Size > 1, "Vector must have a length greater than one."); + //static_assert(Size > 1, "Vector must have a length greater than one."); } /** @@ -449,7 +449,7 @@ namespace PolyVox inline StorageType Vector::getZ(void) const { #ifndef SWIGPYTHON // SWIG instantiates all getters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); + //static_assert(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); #endif return m_tElements[2]; @@ -462,7 +462,7 @@ namespace PolyVox inline StorageType Vector::getW(void) const { #ifndef SWIGPYTHON // SWIG instantiates all getters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); + //static_assert(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); #endif return m_tElements[3]; @@ -502,7 +502,7 @@ namespace PolyVox inline void Vector::setElements(StorageType x, StorageType y, StorageType z) { #ifndef SWIGPYTHON // SWIG instantiates all setters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); + //static_assert(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); #endif m_tElements[0] = x; m_tElements[1] = y; @@ -520,7 +520,7 @@ namespace PolyVox inline void Vector::setElements(StorageType x, StorageType y, StorageType z, StorageType w) { #ifndef SWIGPYTHON // SWIG instantiates all setters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); + //static_assert(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); #endif m_tElements[0] = x; m_tElements[1] = y; @@ -553,7 +553,7 @@ namespace PolyVox inline void Vector::setZ(StorageType tZ) { #ifndef SWIGPYTHON // SWIG instantiates all setters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); + //static_assert(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); #endif m_tElements[2] = tZ; } @@ -565,7 +565,7 @@ namespace PolyVox inline void Vector::setW(StorageType tW) { #ifndef SWIGPYTHON // SWIG instantiates all setters, unless we can find a way around that. Should we use SWIGIMPORT here, and then %import this file rather then %include it? - static_assert(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); + //static_assert(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); #endif m_tElements[3] = tW; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 033fad6b..3eb18072 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -36,49 +36,107 @@ namespace PolyVox #ifdef SWIG class PositionMaterial #else + template class POLYVOX_API PositionMaterial #endif { public: - PositionMaterial(); - PositionMaterial(Vector3DFloat positionToSet, float materialToSet); + PositionMaterial() + { + } - float getMaterial(void) const; - const Vector3DFloat& getPosition(void) const; + PositionMaterial(Vector3DFloat positionToSet, MaterialType materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + } - void setMaterial(float materialToSet); - void setPosition(const Vector3DFloat& positionToSet); + MaterialType getMaterial(void) const + { + return material; + } + + const Vector3DFloat& getPosition(void) const + { + return position; + } + + void setMaterial(MaterialType materialToSet) + { + material = materialToSet; + } + + void setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } public: //Nicely fits into four floats. Vector3DFloat position; - float material; + MaterialType material; }; #ifdef SWIG class PositionMaterialNormal #else + template class POLYVOX_API PositionMaterialNormal #endif { public: - PositionMaterialNormal(); - PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet); - PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet); + PositionMaterialNormal() + { + } - float getMaterial(void) const; - const Vector3DFloat& getNormal(void) const; - const Vector3DFloat& getPosition(void) const; + PositionMaterialNormal(Vector3DFloat positionToSet, MaterialType materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + } - void setMaterial(float materialToSet); - void setNormal(const Vector3DFloat& normalToSet); - void setPosition(const Vector3DFloat& positionToSet); + PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, MaterialType materialToSet) + :position(positionToSet) + ,normal(normalToSet) + ,material(materialToSet) + { + } + + MaterialType getMaterial(void) const + { + return material; + } + + const Vector3DFloat& getNormal(void) const + { + return normal; + } + + const Vector3DFloat& getPosition(void) const + { + return position; + } + + void setMaterial(MaterialType materialToSet) + { + material = materialToSet; + } + + void setNormal(const Vector3DFloat& normalToSet) + { + normal = normalToSet; + } + + void setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } public: //Nicely fits into seven floats, meaning we //can squeeze in one more for material blending. Vector3DFloat position; Vector3DFloat normal; - float material; //FIXME: This shouldn't be float on CPU? + MaterialType material; //FIXME: This shouldn't be float on CPU? }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index b76281b9..72dcc573 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -127,7 +127,7 @@ namespace PolyVox sy = modf(sy, &dummy); sz = modf(sz, &dummy); - typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); + typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); typename DstVolumeType::VoxelType result = static_cast(tInterpolatedValue); m_pVolDst->setVoxelAt(dx,dy,dz,result); diff --git a/library/PolyVoxCore/source/Impl/Utility.cpp b/library/PolyVoxCore/source/Impl/Utility.cpp index 6e907ab9..a56d0210 100644 --- a/library/PolyVoxCore/source/Impl/Utility.cpp +++ b/library/PolyVoxCore/source/Impl/Utility.cpp @@ -1,65 +1,65 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Utility.h" - -#include -#include - -namespace PolyVox -{ - //Note: this function only works for inputs which are a power of two and not zero - //If this is not the case then the output is undefined. - uint8_t logBase2(uint32_t uInput) - { - //Debug mode validation - assert(uInput != 0); - assert(isPowerOf2(uInput)); - - //Release mode validation - if(uInput == 0) - { - throw std::invalid_argument("Cannot compute the log of zero."); - } - if(!isPowerOf2(uInput)) - { - throw std::invalid_argument("Input must be a power of two in order to compute the log."); - } - - uint32_t uResult = 0; - while( (uInput >> uResult) != 0) - { - ++uResult; - } - return static_cast(uResult-1); - } - - - bool isPowerOf2(uint32_t uInput) - { - if(uInput == 0) - return false; - else - return ((uInput & (uInput-1)) == 0); - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/Utility.h" + +#include +#include + +namespace PolyVox +{ + //Note: this function only works for inputs which are a power of two and not zero + //If this is not the case then the output is undefined. + uint8_t logBase2(uint32_t uInput) + { + //Debug mode validation + assert(uInput != 0); + assert(isPowerOf2(uInput)); + + //Release mode validation + if(uInput == 0) + { + //throw std::invalid_argument("Cannot compute the log of zero."); + } + if(!isPowerOf2(uInput)) + { + //throw std::invalid_argument("Input must be a power of two in order to compute the log."); + } + + uint32_t uResult = 0; + while( (uInput >> uResult) != 0) + { + ++uResult; + } + return static_cast(uResult-1); + } + + + bool isPowerOf2(uint32_t uInput) + { + if(uInput == 0) + return false; + else + return ((uInput & (uInput-1)) == 0); + } +} diff --git a/library/PolyVoxCore/source/VertexTypes.cpp b/library/PolyVoxCore/source/VertexTypes.cpp index db41759e..b4dca237 100644 --- a/library/PolyVoxCore/source/VertexTypes.cpp +++ b/library/PolyVoxCore/source/VertexTypes.cpp @@ -25,86 +25,9 @@ freely, subject to the following restrictions: namespace PolyVox { - PositionMaterialNormal::PositionMaterialNormal() - { - } - - PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - - } - - PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet) - :position(positionToSet) - ,normal(normalToSet) - ,material(materialToSet) - { - } - - float PositionMaterialNormal::getMaterial(void) const - { - return material; - } - - const Vector3DFloat& PositionMaterialNormal::getNormal(void) const - { - return normal; - } - - const Vector3DFloat& PositionMaterialNormal::getPosition(void) const - { - return position; - } - - void PositionMaterialNormal::setMaterial(float materialToSet) - { - material = materialToSet; - } - - void PositionMaterialNormal::setNormal(const Vector3DFloat& normalToSet) - { - normal = normalToSet; - } - - void PositionMaterialNormal::setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } - //////////////////////////////////////////////////////////////////////////////// // PositionMaterial //////////////////////////////////////////////////////////////////////////////// - PositionMaterial::PositionMaterial() - { - } - - PositionMaterial::PositionMaterial(Vector3DFloat positionToSet, float materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - - } - - float PositionMaterial::getMaterial(void) const - { - return material; - } - - const Vector3DFloat& PositionMaterial::getPosition(void) const - { - return position; - } - - void PositionMaterial::setMaterial(float materialToSet) - { - material = materialToSet; - } - - void PositionMaterial::setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } + } From 342efec3faa5ac13e20a8048519be5b046a0ba7b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 16 Dec 2012 14:43:18 +0100 Subject: [PATCH 002/259] More merging for Cubiquity version of PolyVox. --- .../DefaultMarchingCubesController.h | 150 +- .../MarchingCubesSurfaceExtractor.inl | 1254 +++++++++-------- 2 files changed, 710 insertions(+), 694 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 43aa0956..fd0d00ef 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -30,34 +30,34 @@ freely, subject to the following restrictions: namespace PolyVox { - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// This class provides a default implementation of a controller for the MarchingCubesSurfaceExtractor. It controls the behaviour of the - /// MarchingCubesSurfaceExtractor and provides the required properties from the underlying voxel type. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// PolyVox does not enforce any requirements regarding what data must be present in a voxel, and instead allows any primitive or user-defined - /// type to be used. However, the Marching Cubes algorithm does have some requirents about the underlying data in that conceptually it operates - /// on a density field. In addition, the PolyVox implementation of the Marching Cubes algorithm also understands the idea of each voxel - /// having a material which is copied into the vertex data. - /// - /// Because we want the MarchingCubesSurfaceExtractor to work on any voxel type, we use a Marching Cubes controller (passed as - /// a parameter of the MarchingCubesSurfaceExtractor) to expose the required properties. This parameter defaults to the DefaultMarchingCubesController. - /// The main implementation of this class is designed to work with primitives data types, and the class is also specialised for the Material, - /// Density and MaterialdensityPair classes. - /// - /// If you create a custom class for your voxel data then you probably want to include a specialisation of DefaultMarchingCubesController, - /// though you don't have to if you don't want to use the Marching Cubes algorithm or if you prefer to define a seperate Marching Cubes controller - /// and pass it as an explicit parameter (rather than relying on the default). - /// - /// For primitive types, the DefaultMarchingCubesController considers the value of the voxel to represent it's density and just returns a constant - /// for the material. So you can, for example, run the MarchingCubesSurfaceExtractor on a volume of floats or ints. - /// - /// It is possible to customise the behaviour of the controller by providing a threshold value through the constructor. The extracted surface - /// will pass through the density value specified by the threshold, and so you should make sure that the threshold value you choose is between - /// the minimum and maximum values found in your volume data. By default it is in the middle of the representable range of the underlying type. - /// - /// \sa MarchingCubesSurfaceExtractor - /// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * This class provides a default implementation of a controller for the MarchingCubesSurfaceExtractor. It controls the behaviour of the + * MarchingCubesSurfaceExtractor and provides the required properties from the underlying voxel type. + * + * PolyVox does not enforce any requirements regarding what data must be present in a voxel, and instead allows any primitive or user-defined + * type to be used. However, the Marching Cubes algorithm does have some requirents about the underlying data in that conceptually it operates + * on a density field. In addition, the PolyVox implementation of the Marching Cubes algorithm also understands the idea of each voxel + * having a material which is copied into the vertex data. + * + * Because we want the MarchingCubesSurfaceExtractor to work on any voxel type, we use a Marching Cubes controller (passed as + * a parameter of the MarchingCubesSurfaceExtractor) to expose the required properties. This parameter defaults to the DefaultMarchingCubesController. + * The main implementation of this class is designed to work with primitives data types, and the class is also specialised for the Material, + * Density and MaterialdensityPair classes. + * + * If you create a custom class for your voxel data then you probably want to include a specialisation of DefaultMarchingCubesController, + * though you don't have to if you don't want to use the Marching Cubes algorithm or if you prefer to define a seperate Marching Cubes controller + * and pass it as an explicit parameter (rather than relying on the default). + * + * For primitive types, the DefaultMarchingCubesController considers the value of the voxel to represent it's density and just returns a constant + * for the material. So you can, for example, run the MarchingCubesSurfaceExtractor on a volume of floats or ints. + * + * It is possible to customise the behaviour of the controller by providing a threshold value through the constructor. The extracted surface + * will pass through the density value specified by the threshold, and so you should make sure that the threshold value you choose is between + * the minimum and maximum values found in your volume data. By default it is in the middle of the representable range of the underlying type. + * + * \sa MarchingCubesSurfaceExtractor + * + */ template class DefaultMarchingCubesController { @@ -69,65 +69,79 @@ namespace PolyVox /// but this is not really desirable on modern hardware. We'll probably come back to material representation in the future. typedef float MaterialType; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Constructor - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// This version of the constructor takes no parameters and sets the threshold to the middle of the representable range of the underlying type. - /// For example, if the voxel type is 'uint8_t' then the representable range is 0-255, and the threshold will be set to 127. On the other hand, - /// if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Constructor + * + * This version of the constructor takes no parameters and sets the threshold to the middle of the representable range of the underlying type. + * For example, if the voxel type is 'uint8_t' then the representable range is 0-255, and the threshold will be set to 127. On the other hand, + * if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. + */ DefaultMarchingCubesController(void) - { - m_tThreshold = ((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2; + :m_tThreshold(((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2) + ,m_eWrapMode(WrapModes::Border) + ,m_tBorder(VoxelType(0)) + { } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Constructor - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// This version of the constructor allows you to set a custom threshold. - /// \param tThreshold The threshold to use. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - DefaultMarchingCubesController(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Converts the underlying voxel type into a density value. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// The default implementation of this function just returns the voxel type directly and is suitable for primitives types. Specialisations of - /// this class can modify this behaviour. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Converts the underlying voxel type into a density value. + * + * The default implementation of this function just returns the voxel type directly and is suitable for primitives types. Specialisations of + * this class can modify this behaviour. + */ DensityType convertToDensity(VoxelType voxel) { return voxel; } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Converts the underlying voxel type into a material value. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// The default implementation of this function just returns the constant '1'. There's not much else it can do, as it needs to work with primitive - /// types and the actual value of the type is already being considered to be the density. Specialisations of this class can modify this behaviour. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - MaterialType convertToMaterial(VoxelType voxel) + /** + * Converts the underlying voxel type into a material value. + * + * The default implementation of this function just returns the constant '1'. There's not much else it can do, as it needs to work with primitive + * types and the actual value of the type is already being considered to be the density. Specialisations of this class can modify this behaviour. + */ + MaterialType convertToMaterial(VoxelType /*voxel*/) { return 1; } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Returns the density value which was passed to the constructor. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// As mentioned in the class description, the extracted surface will pass through the density value specified by the threshold, and so you - /// should make sure that the threshold value you choose is between the minimum and maximum values found in your volume data. By default it - ///is in the middle of the representable range of the underlying type. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + VoxelType getBorderValue(void) + { + return m_tBorder; + } + + /** + * Returns the density value which was passed to the constructor. + * + * As mentioned in the class description, the extracted surface will pass through the density value specified by the threshold, and so you + * should make sure that the threshold value you choose is between the minimum and maximum values found in your volume data. By default it + * is in the middle of the representable range of the underlying type. + */ DensityType getThreshold(void) { return m_tThreshold; } + WrapMode getWrapMode(void) + { + return m_eWrapMode; + } + + void setThreshold(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + void setWrapMode(WrapMode eWrapMode, VoxelType tBorder = VoxelType(0)) + { + m_eWrapMode = eWrapMode; + m_tBorder = tBorder; + } + private: DensityType m_tThreshold; + WrapMode m_eWrapMode; + VoxelType m_tBorder; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index e9761d1e..be2a6674 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -1,626 +1,628 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, Controller controller) - :m_volData(volData) - ,m_sampVolume(volData) - ,m_meshCurrent(result) - ,m_regSizeInVoxels(region) - { - //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); - m_regSizeInCells = m_regSizeInVoxels; - m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); - - m_controller = controller; - m_tThreshold = m_controller.getThreshold(); - } - - template - void MarchingCubesSurfaceExtractor::execute() - { - m_meshCurrent->clear(); - - uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; - uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; - uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions - - //For edge indices - Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesZ(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesX(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); - - Array2DUint8 pPreviousBitmask(arraySizes); - Array2DUint8 pCurrentBitmask(arraySizes); - - //Create a region corresponding to the first slice - m_regSlicePrevious = m_regSizeInVoxels; - Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); - v3dUpperCorner.setZ(m_regSlicePrevious.getLowerCorner().getZ()); //Set the upper z to the lower z to make it one slice thick. - m_regSlicePrevious.setUpperCorner(v3dUpperCorner); - m_regSliceCurrent = m_regSlicePrevious; - - uint32_t uNoOfNonEmptyCellsForSlice0 = 0; - uint32_t uNoOfNonEmptyCellsForSlice1 = 0; - - //Process the first slice (previous slice not available) - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - - //Process the other slices (previous slice is available) - for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ(); uSlice++) - { - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) - { - generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - } - - m_meshCurrent->m_Region = m_regSizeInVoxels; - - m_meshCurrent->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); - m_meshCurrent->m_vecLodRecords.push_back(lodRecord); - } - - template - template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) - { - m_uNoOfOccupiedCells = 0; - - const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperCorner().getX(); - const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperCorner().getY(); - - iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); - uZRegSpace = iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ(); - - //Process the lower left corner - iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); - iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); - - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); - - //Process the edge where x is minimal. - iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); - m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerCorner().getY(), iZVolSpace); - for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - - m_sampVolume.movePositiveY(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); - } - - //Process the edge where y is minimal. - iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); - m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); - } - - //Process all remaining elemnents of the slice. In this case, previous x and y values are always available - for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); - } - } - - return m_uNoOfOccupiedCells; - } - - template - template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) - { - uint8_t iCubeIndex = 0; - - typename VolumeType::VoxelType v000; - typename VolumeType::VoxelType v100; - typename VolumeType::VoxelType v010; - typename VolumeType::VoxelType v110; - typename VolumeType::VoxelType v001; - typename VolumeType::VoxelType v101; - typename VolumeType::VoxelType v011; - typename VolumeType::VoxelType v111; - - if(isPrevZAvail) - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 128; - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 160; //160 = 128+32 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iCubeIndex = iPreviousCubeIndexZ >> 4; - - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - else //previous Z not available - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v110 = m_sampVolume.peekVoxel1px1py0pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX; - - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v000 = m_sampVolume.getVoxel(); - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - - //Save the bitmask - pCurrentBitmask[uXRegSpace][iYVolSpace- m_regSizeInVoxels.getLowerCorner().getY()] = iCubeIndex; - - if(edgeTable[iCubeIndex] != 0) - { - ++m_uNoOfOccupiedCells; - } - } - - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, - Array2DInt32& m_pCurrentVertexIndicesX, - Array2DInt32& m_pCurrentVertexIndicesY, - Array2DInt32& m_pCurrentVertexIndicesZ) - { - int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); - - //Iterate over each cell in the region - for(int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); iYVolSpace <= m_regSliceCurrent.getUpperCorner().getY(); iYVolSpace++) - { - const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); - - for(int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); iXVolSpace <= m_regSliceCurrent.getUpperCorner().getX(); iXVolSpace++) - { - //Current position - const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - //Check whether the generated vertex will lie on the edge of the region - - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); - const Vector3DFloat n000 = computeSobelGradient(m_sampVolume); - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - m_sampVolume.movePositiveX(); - const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); - const Vector3DFloat n100 = computeSobelGradient(m_sampVolume); - - float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerCorner().getZ())); - - Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); - - //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of - //material IDs does not make sense). We take the largest, so that if we are working on a material-only - //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - typename Controller::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); - //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); - typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial100, fInterp); - - PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeX(); - } - if (edgeTable[iCubeIndex] & 8) - { - m_sampVolume.movePositiveY(); - const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); - const Vector3DFloat n010 = computeSobelGradient(m_sampVolume); - - float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ())); - - Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); - - //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of - //material IDs does not make sense). We take the largest, so that if we are working on a material-only - //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - typename Controller::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); - //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); - typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial010, fInterp); - - PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeY(); - } - if (edgeTable[iCubeIndex] & 256) - { - m_sampVolume.movePositiveZ(); - const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); - const Vector3DFloat n001 = computeSobelGradient(m_sampVolume); - - float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ()) + fInterp); - - Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); - - //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of - //material IDs does not make sense). We take the largest, so that if we are working on a material-only - //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. - typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); - typename Controller::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); - //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); - typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial001, fInterp); - - PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeZ(); - } - }//For each cell - } - } - - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, - const Array2DInt32& m_pPreviousVertexIndicesX, - const Array2DInt32& m_pPreviousVertexIndicesY, - const Array2DInt32& m_pPreviousVertexIndicesZ, - const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY) - { - int32_t indlist[12]; - for(int i = 0; i < 12; i++) - { - indlist[i] = -1; - } - - for(int32_t iYVolSpace = m_regSlicePrevious.getLowerCorner().getY(); iYVolSpace <= m_regSizeInCells.getUpperCorner().getY(); iYVolSpace++) - { - for(int32_t iXVolSpace = m_regSlicePrevious.getLowerCorner().getX(); iXVolSpace <= m_regSizeInCells.getUpperCorner().getX(); iXVolSpace++) - { - int32_t iZVolSpace = m_regSlicePrevious.getLowerCorner().getZ(); - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - - //Current position - const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerCorner().getX(); - const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerCorner().getY(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - indlist[0] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace]; - //assert(indlist[0] != -1); - } - if (edgeTable[iCubeIndex] & 2) - { - indlist[1] = m_pPreviousVertexIndicesY[uXRegSpace+1][uYRegSpace]; - //assert(indlist[1] != -1); - } - if (edgeTable[iCubeIndex] & 4) - { - indlist[2] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace+1]; - //assert(indlist[2] != -1); - } - if (edgeTable[iCubeIndex] & 8) - { - indlist[3] = m_pPreviousVertexIndicesY[uXRegSpace][uYRegSpace]; - //assert(indlist[3] != -1); - } - if (edgeTable[iCubeIndex] & 16) - { - indlist[4] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace]; - //assert(indlist[4] != -1); - } - if (edgeTable[iCubeIndex] & 32) - { - indlist[5] = m_pCurrentVertexIndicesY[uXRegSpace+1][uYRegSpace]; - //assert(indlist[5] != -1); - } - if (edgeTable[iCubeIndex] & 64) - { - indlist[6] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace+1]; - //assert(indlist[6] != -1); - } - if (edgeTable[iCubeIndex] & 128) - { - indlist[7] = m_pCurrentVertexIndicesY[uXRegSpace][uYRegSpace]; - //assert(indlist[7] != -1); - } - if (edgeTable[iCubeIndex] & 256) - { - indlist[8] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace]; - //assert(indlist[8] != -1); - } - if (edgeTable[iCubeIndex] & 512) - { - indlist[9] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace]; - //assert(indlist[9] != -1); - } - if (edgeTable[iCubeIndex] & 1024) - { - indlist[10] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace+1]; - //assert(indlist[10] != -1); - } - if (edgeTable[iCubeIndex] & 2048) - { - indlist[11] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace+1]; - //assert(indlist[11] != -1); - } - - for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) - { - int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; - - if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) - { - m_meshCurrent->addTriangle(ind0, ind1, ind2); - } - }//For each triangle - }//For each cell - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, Controller controller) + :m_volData(volData) + ,m_sampVolume(volData) + ,m_meshCurrent(result) + ,m_regSizeInVoxels(region) + { + //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); + m_regSizeInCells = m_regSizeInVoxels; + m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); + + m_controller = controller; + m_tThreshold = m_controller.getThreshold(); + + m_sampVolume.setWrapMode(m_controller.getWrapMode(), m_controller.getBorderValue()); + } + + template + void MarchingCubesSurfaceExtractor::execute() + { + m_meshCurrent->clear(); + + uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; + uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; + uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions + + //For edge indices + Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); + Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); + Array2DInt32 m_pPreviousVertexIndicesZ(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesX(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); + + Array2DUint8 pPreviousBitmask(arraySizes); + Array2DUint8 pCurrentBitmask(arraySizes); + + //Create a region corresponding to the first slice + m_regSlicePrevious = m_regSizeInVoxels; + Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); + v3dUpperCorner.setZ(m_regSlicePrevious.getLowerCorner().getZ()); //Set the upper z to the lower z to make it one slice thick. + m_regSlicePrevious.setUpperCorner(v3dUpperCorner); + m_regSliceCurrent = m_regSlicePrevious; + + uint32_t uNoOfNonEmptyCellsForSlice0 = 0; + uint32_t uNoOfNonEmptyCellsForSlice1 = 0; + + //Process the first slice (previous slice not available) + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + + //Process the other slices (previous slice is available) + for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ(); uSlice++) + { + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) + { + generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + } + + m_meshCurrent->m_Region = m_regSizeInVoxels; + + m_meshCurrent->m_vecLodRecords.clear(); + LodRecord lodRecord; + lodRecord.beginIndex = 0; + lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); + m_meshCurrent->m_vecLodRecords.push_back(lodRecord); + } + + template + template + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + { + m_uNoOfOccupiedCells = 0; + + const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperCorner().getX(); + const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperCorner().getY(); + + iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + uZRegSpace = iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ(); + + //Process the lower left corner + iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); + iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); + + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); + + //Process the edge where x is minimal. + iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); + m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerCorner().getY(), iZVolSpace); + for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + + m_sampVolume.movePositiveY(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); + } + + //Process the edge where y is minimal. + iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); + m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); + } + + //Process all remaining elemnents of the slice. In this case, previous x and y values are always available + for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask); + } + } + + return m_uNoOfOccupiedCells; + } + + template + template + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + { + uint8_t iCubeIndex = 0; + + typename VolumeType::VoxelType v000; + typename VolumeType::VoxelType v100; + typename VolumeType::VoxelType v010; + typename VolumeType::VoxelType v110; + typename VolumeType::VoxelType v001; + typename VolumeType::VoxelType v101; + typename VolumeType::VoxelType v011; + typename VolumeType::VoxelType v111; + + if(isPrevZAvail) + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 128; + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 160; //160 = 128+32 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iCubeIndex = iPreviousCubeIndexZ >> 4; + + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + else //previous Z not available + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v110 = m_sampVolume.peekVoxel1px1py0pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX; + + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v000 = m_sampVolume.getVoxel(); + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + + //Save the bitmask + pCurrentBitmask[uXRegSpace][iYVolSpace- m_regSizeInVoxels.getLowerCorner().getY()] = iCubeIndex; + + if(edgeTable[iCubeIndex] != 0) + { + ++m_uNoOfOccupiedCells; + } + } + + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + Array2DInt32& m_pCurrentVertexIndicesX, + Array2DInt32& m_pCurrentVertexIndicesY, + Array2DInt32& m_pCurrentVertexIndicesZ) + { + int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + + //Iterate over each cell in the region + for(int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); iYVolSpace <= m_regSliceCurrent.getUpperCorner().getY(); iYVolSpace++) + { + const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + + for(int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); iXVolSpace <= m_regSliceCurrent.getUpperCorner().getX(); iXVolSpace++) + { + //Current position + const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + //Check whether the generated vertex will lie on the edge of the region + + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); + const Vector3DFloat n000 = computeSobelGradient(m_sampVolume); + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + m_sampVolume.movePositiveX(); + const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); + const Vector3DFloat n100 = computeSobelGradient(m_sampVolume); + + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerCorner().getZ())); + + Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); + v3dNormal.normalise(); + + //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of + //material IDs does not make sense). We take the largest, so that if we are working on a material-only + //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial100, fInterp); + + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeX(); + } + if (edgeTable[iCubeIndex] & 8) + { + m_sampVolume.movePositiveY(); + const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); + const Vector3DFloat n010 = computeSobelGradient(m_sampVolume); + + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ())); + + Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); + v3dNormal.normalise(); + + //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of + //material IDs does not make sense). We take the largest, so that if we are working on a material-only + //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial010, fInterp); + + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeY(); + } + if (edgeTable[iCubeIndex] & 256) + { + m_sampVolume.movePositiveZ(); + const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); + const Vector3DFloat n001 = computeSobelGradient(m_sampVolume); + + float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ()) + fInterp); + + Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); + v3dNormal.normalise(); + + //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of + //material IDs does not make sense). We take the largest, so that if we are working on a material-only + //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. + typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); + typename Controller::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); + //typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); + typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial001, fInterp); + + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeZ(); + } + }//For each cell + } + } + + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + const Array2DInt32& m_pPreviousVertexIndicesX, + const Array2DInt32& m_pPreviousVertexIndicesY, + const Array2DInt32& m_pPreviousVertexIndicesZ, + const Array2DInt32& m_pCurrentVertexIndicesX, + const Array2DInt32& m_pCurrentVertexIndicesY) + { + int32_t indlist[12]; + for(int i = 0; i < 12; i++) + { + indlist[i] = -1; + } + + for(int32_t iYVolSpace = m_regSlicePrevious.getLowerCorner().getY(); iYVolSpace <= m_regSizeInCells.getUpperCorner().getY(); iYVolSpace++) + { + for(int32_t iXVolSpace = m_regSlicePrevious.getLowerCorner().getX(); iXVolSpace <= m_regSizeInCells.getUpperCorner().getX(); iXVolSpace++) + { + int32_t iZVolSpace = m_regSlicePrevious.getLowerCorner().getZ(); + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + + //Current position + const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerCorner().getX(); + const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerCorner().getY(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + indlist[0] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace]; + //assert(indlist[0] != -1); + } + if (edgeTable[iCubeIndex] & 2) + { + indlist[1] = m_pPreviousVertexIndicesY[uXRegSpace+1][uYRegSpace]; + //assert(indlist[1] != -1); + } + if (edgeTable[iCubeIndex] & 4) + { + indlist[2] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace+1]; + //assert(indlist[2] != -1); + } + if (edgeTable[iCubeIndex] & 8) + { + indlist[3] = m_pPreviousVertexIndicesY[uXRegSpace][uYRegSpace]; + //assert(indlist[3] != -1); + } + if (edgeTable[iCubeIndex] & 16) + { + indlist[4] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace]; + //assert(indlist[4] != -1); + } + if (edgeTable[iCubeIndex] & 32) + { + indlist[5] = m_pCurrentVertexIndicesY[uXRegSpace+1][uYRegSpace]; + //assert(indlist[5] != -1); + } + if (edgeTable[iCubeIndex] & 64) + { + indlist[6] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace+1]; + //assert(indlist[6] != -1); + } + if (edgeTable[iCubeIndex] & 128) + { + indlist[7] = m_pCurrentVertexIndicesY[uXRegSpace][uYRegSpace]; + //assert(indlist[7] != -1); + } + if (edgeTable[iCubeIndex] & 256) + { + indlist[8] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace]; + //assert(indlist[8] != -1); + } + if (edgeTable[iCubeIndex] & 512) + { + indlist[9] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace]; + //assert(indlist[9] != -1); + } + if (edgeTable[iCubeIndex] & 1024) + { + indlist[10] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace+1]; + //assert(indlist[10] != -1); + } + if (edgeTable[iCubeIndex] & 2048) + { + indlist[11] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace+1]; + //assert(indlist[11] != -1); + } + + for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) + { + int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + + if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) + { + m_meshCurrent->addTriangle(ind0, ind1, ind2); + } + }//For each triangle + }//For each cell + } + } +} From 8473b1e3e6138ec8b2e265b77097ad326eef5a48 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 16 Dec 2012 18:04:33 +0100 Subject: [PATCH 003/259] Added support for getting interpolated voxel value. --- .../include/PolyVoxCore/Impl/Utility.h | 4 +- .../include/PolyVoxCore/RawVolume.h | 2 + .../include/PolyVoxCore/RawVolume.inl | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index 2053c351..77dac7a4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -40,12 +40,12 @@ namespace PolyVox inline int32_t roundTowardsNegInf(float r) { - return (r > 0.0) ? static_cast(r) : static_cast(r - 1.0f); + return (r >= 0.0) ? static_cast(r) : static_cast(r - 1.0f); } inline int32_t roundToNearestInteger(float r) { - return (r > 0.0) ? static_cast(r + 0.5f) : static_cast(r - 0.5f); + return (r >= 0.0) ? static_cast(r + 0.5f) : static_cast(r - 0.5f); } template diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index f0ef1c6e..cae21b67 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -117,6 +117,8 @@ namespace PolyVox /// Destructor ~RawVolume(); + VoxelType getInterpolatedValue(float fXPos, float fYPos, float fZPos); //Should be const + VoxelType getInterpolatedValue(const Vector3DFloat& v3dPos); //Should be const /// Gets a voxel at the position given by x,y,z coordinates VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; /// Gets a voxel at the position given by a 3D vector diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index 1fafad5a..ae91695c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -73,6 +73,45 @@ namespace PolyVox assert(false); // See function comment above. } + template + VoxelType RawVolume::getInterpolatedValue(float fXPos, float fYPos, float fZPos) //Should be const + { + Sampler sampler(this); + + int32_t iLowerX = roundTowardsNegInf(fXPos); + int32_t iLowerY = roundTowardsNegInf(fYPos); + int32_t iLowerZ = roundTowardsNegInf(fZPos); + + float fOffsetX = fXPos - iLowerX; + float fOffsetY = fYPos - iLowerY; + float fOffsetZ = fZPos - iLowerZ; + + /*int32_t iCeilX = iFloorX + 1; + int32_t iCeilY = iFloorY + 1; + int32_t iCeilZ = iFloorZ + 1;*/ + + sampler.setPosition(iLowerX, iLowerY, iLowerZ); + + VoxelType v000 = sampler.peekVoxel0px0py0pz(); + VoxelType v100 = sampler.peekVoxel1px0py0pz(); + VoxelType v010 = sampler.peekVoxel0px1py0pz(); + VoxelType v110 = sampler.peekVoxel1px1py0pz(); + VoxelType v001 = sampler.peekVoxel0px0py1pz(); + VoxelType v101 = sampler.peekVoxel1px0py1pz(); + VoxelType v011 = sampler.peekVoxel0px1py1pz(); + VoxelType v111 = sampler.peekVoxel1px1py1pz(); + + VoxelType result = trilerp(v000, v100, v010, v110, v001, v101, v011, v111, fOffsetX, fOffsetY, fOffsetZ); + + return result; + } + + template + VoxelType RawVolume::getInterpolatedValue(const Vector3DFloat& v3dPos) //Should be const + { + return getInterpolatedValue(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); + } + //////////////////////////////////////////////////////////////////////////////// /// \param uXPos The \c x position of the voxel /// \param uYPos The \c y position of the voxel From db16a3d602c885f2f44de6ea55f1347a5291d3e9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 17 Dec 2012 23:42:03 +0100 Subject: [PATCH 004/259] Started implementing a more mathematically correct volume resampler. --- .../include/PolyVoxCore/VolumeResampler.h | 1 + .../include/PolyVoxCore/VolumeResampler.inl | 86 ++++++++++++++++++- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h index 5074a92c..06b1f3d7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h @@ -39,6 +39,7 @@ namespace PolyVox private: void resampleSameSize(); void resampleArbitrary(); + void resampleBetter(); //Source data SrcVolumeType* m_pVolSrc; diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index 72dcc573..61b8f218 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -53,14 +53,16 @@ namespace PolyVox int32_t uDstHeight = m_regDst.getUpperCorner().getY() - m_regDst.getLowerCorner().getY() + 1; int32_t uDstDepth = m_regDst.getUpperCorner().getZ() - m_regDst.getLowerCorner().getZ() + 1; - if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) + /*if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) { resampleSameSize(); } else { resampleArbitrary(); - } + }*/ + + resampleBetter(); } template< typename SrcVolumeType, typename DstVolumeType> @@ -135,4 +137,84 @@ namespace PolyVox } } } + + template< typename SrcVolumeType, typename DstVolumeType> + void VolumeResampler::resampleBetter() + { + float srcWidth = m_regSrc.getWidthInCells(); + float srcHeight = m_regSrc.getHeightInCells(); + float srcDepth = m_regSrc.getDepthInCells(); + + float dstWidth = m_regDst.getWidthInCells(); + float dstHeight = m_regDst.getHeightInCells(); + float dstDepth = m_regDst.getDepthInCells(); + + float fScaleX = srcWidth / dstWidth; + float fScaleY = srcHeight / dstHeight; + float fScaleZ = srcDepth / dstDepth; + + typename SrcVolumeType::Sampler sampler(m_pVolSrc); + + // Should use SrcVolumeType? Or new template parameter? + Region regDownscaledX(0, 0, 0, m_regDst.getWidthInVoxels()-1, m_regSrc.getHeightInVoxels()-1, m_regSrc.getDepthInVoxels()-1); + SrcVolumeType volDownscaledX(regDownscaledX); + + for(int32_t tz = regDownscaledX.getLowerZ(); tz <= regDownscaledX.getUpperZ(); tz++) + { + for(int32_t ty = regDownscaledX.getLowerY(); ty <= regDownscaledX.getUpperY(); ty++) + { + for(int32_t tx = regDownscaledX.getLowerX(); tx <= regDownscaledX.getUpperX(); tx++) + { + float sx = (tx * fScaleX) + m_regSrc.getLowerCorner().getX(); + float sy = (ty ) + m_regSrc.getLowerCorner().getY(); + float sz = (tz ) + m_regSrc.getLowerCorner().getZ(); + + typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + + volDownscaledX.setVoxelAt(tx, ty, tz, result); + } + } + } + + //Now downscale in y + Region regDownscaledXAndY(0, 0, 0, m_regDst.getWidthInVoxels()-1, m_regDst.getHeightInVoxels()-1, m_regSrc.getDepthInVoxels()-1); + SrcVolumeType volDownscaledXAndY(regDownscaledXAndY); + + for(int32_t tz = regDownscaledXAndY.getLowerZ(); tz <= regDownscaledXAndY.getUpperZ(); tz++) + { + for(int32_t ty = regDownscaledXAndY.getLowerY(); ty <= regDownscaledXAndY.getUpperY(); ty++) + { + for(int32_t tx = regDownscaledXAndY.getLowerX(); tx <= regDownscaledXAndY.getUpperX(); tx++) + { + float sx = (tx ); + float sy = (ty * fScaleY); + float sz = (tz ); + + typename SrcVolumeType::VoxelType result = volDownscaledX.getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + + volDownscaledXAndY.setVoxelAt(tx, ty, tz, result); + } + } + } + + //Now copy and downscale to dst. + //Region regDst = m_pVolDst->getEnclosingRegion(); + + for(int32_t tz = m_regDst.getLowerZ(); tz <= m_regDst.getUpperZ(); tz++) + { + for(int32_t ty = m_regDst.getLowerY(); ty <= m_regDst.getUpperY(); ty++) + { + for(int32_t tx = m_regDst.getLowerX(); tx <= m_regDst.getUpperX(); tx++) + { + float sx = (tx - m_regDst.getLowerX()); + float sy = (ty - m_regDst.getLowerY()); + float sz = (tz - m_regDst.getLowerZ()) * fScaleZ; + + typename SrcVolumeType::VoxelType result = volDownscaledXAndY.getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + + m_pVolDst->setVoxelAt(tx, ty, tz, result); + } + } + } + } } From 9c970bd11a3e55ee1df0db531dfb84f00dceb646 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 21:16:36 +0100 Subject: [PATCH 005/259] Added missing .cpp file to cubiquity version of PolyVox. --- .../PolyVoxCore/source/Impl/ErrorHandling.cpp | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 library/PolyVoxCore/source/Impl/ErrorHandling.cpp diff --git a/library/PolyVoxCore/source/Impl/ErrorHandling.cpp b/library/PolyVoxCore/source/Impl/ErrorHandling.cpp new file mode 100644 index 00000000..bc7dc2c5 --- /dev/null +++ b/library/PolyVoxCore/source/Impl/ErrorHandling.cpp @@ -0,0 +1,71 @@ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/ErrorHandling.h" + +#ifndef POLYVOX_THROW_ENABLED + namespace PolyVox + { + void defaultThrowHandler(std::exception& e, const char* file, int line) + { + std::cerr << std::endl << std::endl; \ + std::cerr << " PolyVox exception thrown!" << std::endl; \ + std::cerr << " =========================" << std::endl; \ + std::cerr << " PolyVox has tried to throw an exception but it was built without support" << std::endl; \ + std::cerr << " for exceptions. In this scenario PolyVox will call a 'throw handler'" << std::endl; \ + std::cerr << " and this message is being printed by the default throw handler." << std::endl << std::endl; \ + + std::cerr << " If you don't want to enable exceptions then you should try to determine why" << std::endl; \ + std::cerr << " this exception was thrown and make sure it doesn't happen again. If it was" << std::endl; \ + std::cerr << " due to something like an invalid argument to a function then you should be" << std::endl; \ + std::cerr << " able to fix it quite easily by validating parameters as appropriate. More" << std::endl; \ + std::cerr << " complex exception scenarios (out of memory, etc) might be harder to fix and" << std::endl; \ + std::cerr << " you should replace this default handler with something which is more" << std::endl; \ + std::cerr << " meaningful to your users." << std::endl << std::endl; \ + + std::cerr << " Exception details" << std::endl; \ + std::cerr << " -----------------" << std::endl; \ + std::cerr << " Line: " << line << std::endl; \ + std::cerr << " File: " << file << std::endl; \ + std::cerr << " Message: " << e.what() << std::endl << std::endl; \ + + POLYVOX_HALT(); \ + } + + ThrowHandler& getThrowHandlerInstance() + { + static ThrowHandler s_fThrowHandler = &defaultThrowHandler; + return s_fThrowHandler; + } + + ThrowHandler getThrowHandler() + { + return getThrowHandlerInstance(); + } + + void setThrowHandler(ThrowHandler fNewHandler) + { + getThrowHandlerInstance() = fNewHandler; + } + } +#endif From 9051e7558ee5339dde8a2aaea78d534b32fffd07 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 21:32:07 +0100 Subject: [PATCH 006/259] Setting appropriate build variables for Android version. --- .../PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h | 2 +- library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h index 9afbf506..0c52ac7e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h @@ -11,7 +11,7 @@ //#undef HAS_CXX11_CONSTEXPR -#define HAS_CXX11_STATIC_ASSERT +//#define HAS_CXX11_STATIC_ASSERT #define HAS_CXX11_CSTDINT_H diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index 65c2789d..d3ef8b49 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -29,7 +29,7 @@ freely, subject to the following restrictions: #include #define POLYVOX_ASSERTS_ENABLED -#define POLYVOX_THROW_ENABLED +//#define POLYVOX_THROW_ENABLED #if defined(_MSC_VER) #define POLYVOX_HALT() __debugbreak() From d6c4cfb9f3ff86fbf67d8cd3a8e3fae5e7e8af31 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 21:48:55 +0100 Subject: [PATCH 007/259] Eliminating some of the differences between this branch and 'develop'. --- .../include/PolyVoxCore/RawVolume.h | 2 - .../include/PolyVoxCore/RawVolume.inl | 39 ------------------- 2 files changed, 41 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index cae21b67..f0ef1c6e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -117,8 +117,6 @@ namespace PolyVox /// Destructor ~RawVolume(); - VoxelType getInterpolatedValue(float fXPos, float fYPos, float fZPos); //Should be const - VoxelType getInterpolatedValue(const Vector3DFloat& v3dPos); //Should be const /// Gets a voxel at the position given by x,y,z coordinates VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; /// Gets a voxel at the position given by a 3D vector diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index a1ca12ea..8a0a2e34 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -73,45 +73,6 @@ namespace PolyVox assert(false); // See function comment above. } - template - VoxelType RawVolume::getInterpolatedValue(float fXPos, float fYPos, float fZPos) //Should be const - { - Sampler sampler(this); - - int32_t iLowerX = roundTowardsNegInf(fXPos); - int32_t iLowerY = roundTowardsNegInf(fYPos); - int32_t iLowerZ = roundTowardsNegInf(fZPos); - - float fOffsetX = fXPos - iLowerX; - float fOffsetY = fYPos - iLowerY; - float fOffsetZ = fZPos - iLowerZ; - - /*int32_t iCeilX = iFloorX + 1; - int32_t iCeilY = iFloorY + 1; - int32_t iCeilZ = iFloorZ + 1;*/ - - sampler.setPosition(iLowerX, iLowerY, iLowerZ); - - VoxelType v000 = sampler.peekVoxel0px0py0pz(); - VoxelType v100 = sampler.peekVoxel1px0py0pz(); - VoxelType v010 = sampler.peekVoxel0px1py0pz(); - VoxelType v110 = sampler.peekVoxel1px1py0pz(); - VoxelType v001 = sampler.peekVoxel0px0py1pz(); - VoxelType v101 = sampler.peekVoxel1px0py1pz(); - VoxelType v011 = sampler.peekVoxel0px1py1pz(); - VoxelType v111 = sampler.peekVoxel1px1py1pz(); - - VoxelType result = trilerp(v000, v100, v010, v110, v001, v101, v011, v111, fOffsetX, fOffsetY, fOffsetZ); - - return result; - } - - template - VoxelType RawVolume::getInterpolatedValue(const Vector3DFloat& v3dPos) //Should be const - { - return getInterpolatedValue(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - //////////////////////////////////////////////////////////////////////////////// /// \param uXPos The \c x position of the voxel /// \param uYPos The \c y position of the voxel From 7e8af71e521c30740b4ec0e93ca6e377564ecaea Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 23:39:13 +0100 Subject: [PATCH 008/259] Not quite sure what the difference is here... --- .../include/PolyVoxCore/Vector.inl | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index 8aea0d6d..57b3e2f0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -52,8 +52,8 @@ namespace PolyVox */ template Vector::Vector(StorageType x, StorageType y) - { - POLYVOX_STATIC_ASSERT(Size == 2, "This constructor should only be used for vectors with two elements."); + { + POLYVOX_STATIC_ASSERT(Size == 2, "This constructor should only be used for vectors with two elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -67,8 +67,8 @@ namespace PolyVox */ template Vector::Vector(StorageType x, StorageType y, StorageType z) - { - POLYVOX_STATIC_ASSERT(Size == 3, "This constructor should only be used for vectors with three elements."); + { + POLYVOX_STATIC_ASSERT(Size == 3, "This constructor should only be used for vectors with three elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -85,8 +85,8 @@ namespace PolyVox */ template Vector::Vector(StorageType x, StorageType y, StorageType z, StorageType w) - { - POLYVOX_STATIC_ASSERT(Size == 4, "This constructor should only be used for vectors with four elements."); + { + POLYVOX_STATIC_ASSERT(Size == 4, "This constructor should only be used for vectors with four elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -135,8 +135,8 @@ namespace PolyVox // Force a vector to have a length greater than one. There is no need for a // vector with one element, and supporting this would cause confusion over the // behaviour of the constructor taking a single value, as this fills all elements - // to that value rather than just the first one. - POLYVOX_STATIC_ASSERT(Size > 1, "Vector must have a length greater than one."); + // to that value rather than just the first one. + POLYVOX_STATIC_ASSERT(Size > 1, "Vector must have a length greater than one."); } /** @@ -441,8 +441,8 @@ namespace PolyVox */ template inline StorageType Vector::getZ(void) const - { - POLYVOX_STATIC_ASSERT(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); + { + POLYVOX_STATIC_ASSERT(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); return m_tElements[2]; } @@ -452,8 +452,8 @@ namespace PolyVox */ template inline StorageType Vector::getW(void) const - { - POLYVOX_STATIC_ASSERT(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); + { + POLYVOX_STATIC_ASSERT(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); return m_tElements[3]; } @@ -490,9 +490,9 @@ namespace PolyVox */ template inline void Vector::setElements(StorageType x, StorageType y, StorageType z) - { + { POLYVOX_STATIC_ASSERT(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); - + m_tElements[0] = x; m_tElements[1] = y; m_tElements[2] = z; @@ -507,9 +507,9 @@ namespace PolyVox */ template inline void Vector::setElements(StorageType x, StorageType y, StorageType z, StorageType w) - { + { POLYVOX_STATIC_ASSERT(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); - + m_tElements[0] = x; m_tElements[1] = y; m_tElements[2] = z; @@ -539,10 +539,10 @@ namespace PolyVox */ template inline void Vector::setZ(StorageType tZ) - { + { POLYVOX_STATIC_ASSERT(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); - m_tElements[2] = tZ; + m_tElements[2] = tZ; } /** @@ -550,10 +550,10 @@ namespace PolyVox */ template inline void Vector::setW(StorageType tW) - { + { POLYVOX_STATIC_ASSERT(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); - m_tElements[3] = tW; + m_tElements[3] = tW; } /** From 8e5a09d0fce3b629596405d57da9abe6b304cdeb Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 23:47:32 +0100 Subject: [PATCH 009/259] Android compile fixes. --- .../PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h | 2 +- library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h index 074c3555..1884e19e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h @@ -15,7 +15,7 @@ // is a recent version) then assume support for these. #if !defined(_MSC_VER) || (_MSC_VER >= 1600) #define HAS_CXX11_CONSTEXPR - #define HAS_CXX11_STATIC_ASSERT + //#define HAS_CXX11_STATIC_ASSERT //This seems to cause issues on Android. #define HAS_CXX11_CSTDINT_H #define HAS_CXX11_SHARED_PTR #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h index e97e27af..919950f2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h @@ -25,6 +25,6 @@ freely, subject to the following restrictions: #define __PolyVox_Config_H__ #define POLYVOX_ASSERTS_ENABLED -#define POLYVOX_THROW_ENABLED +//#define POLYVOX_THROW_ENABLED //Not allowed on Android. #endif From 8fe824eb58ab7b58ecffcf0c8f4c01dd8a053724 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 2 Jan 2013 21:52:44 +0100 Subject: [PATCH 010/259] Allowing boundary values to be negative. --- library/PolyVoxCore/include/PolyVoxCore/Region.h | 10 +++++----- library/PolyVoxCore/source/Region.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 55c51ee4..aa7681fa 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -133,21 +133,21 @@ namespace PolyVox /// Tests whether the given point is contained in this Region. bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const; /// Tests whether the given point is contained in this Region. - bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const; + bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary = 0) const; /// Tests whether the given point is contained in this Region. - bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const; + bool containsPoint(const Vector3DInt32& pos, int8_t boundary = 0) const; /// Tests whether the given position is contained in the 'x' range of this Region. bool containsPointInX(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'x' range of this Region. - bool containsPointInX(int32_t pos, uint8_t boundary = 0) const; + bool containsPointInX(int32_t pos, int8_t boundary = 0) const; /// Tests whether the given position is contained in the 'y' range of this Region. bool containsPointInY(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'y' range of this Region. - bool containsPointInY(int32_t pos, uint8_t boundary = 0) const; + bool containsPointInY(int32_t pos, int8_t boundary = 0) const; /// Tests whether the given position is contained in the 'z' range of this Region. bool containsPointInZ(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'z' range of this Region. - bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const; + bool containsPointInZ(int32_t pos, int8_t boundary = 0) const; /// Enlarges the Region so that it contains the specified position. void accumulate(int32_t iX, int32_t iY, int32_t iZ); diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index 143a537a..dee56bb3 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -199,7 +199,7 @@ namespace PolyVox * \param iZ The 'z' position of the point to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const + bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary) const { return (iX <= m_iUpperX - boundary) && (iY <= m_iUpperY - boundary) @@ -216,7 +216,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const + bool Region::containsPoint(const Vector3DInt32& pos, int8_t boundary) const { return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); } @@ -241,7 +241,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInX(int32_t pos, uint8_t boundary) const + bool Region::containsPointInX(int32_t pos, int8_t boundary) const { return (pos <= m_iUpperX - boundary) && (pos >= m_iLowerX + boundary); @@ -267,7 +267,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInY(int32_t pos, uint8_t boundary) const + bool Region::containsPointInY(int32_t pos, int8_t boundary) const { return (pos <= m_iUpperY - boundary) && (pos >= m_iLowerY + boundary); @@ -293,7 +293,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const + bool Region::containsPointInZ(int32_t pos, int8_t boundary) const { return (pos <= m_iUpperZ - boundary) && (pos >= m_iLowerZ + boundary); From bf5a9f7ab8c068461f491b384214036b892e4caf Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 2 Jan 2013 23:03:07 +0100 Subject: [PATCH 011/259] Added getCentre() to Region class. --- .../PolyVoxCore/include/PolyVoxCore/Region.h | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index aa7681fa..d65fb022 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -74,6 +74,12 @@ namespace PolyVox /// Inequality Operator. bool operator!=(const Region& rhs) const; + /// Gets the 'x' position of the centre. + int32_t getCentreX(void) const; + /// Gets the 'y' position of the centre. + int32_t getCentreY(void) const; + /// Gets the 'z' position of the centrer. + int32_t getCentreZ(void) const; /// Gets the 'x' position of the lower corner. int32_t getLowerX(void) const; /// Gets the 'y' position of the lower corner. @@ -87,6 +93,8 @@ namespace PolyVox /// Gets the 'z' position of the upper corner. int32_t getUpperZ(void) const; + /// Gets the centre of the region + Vector3DInt32 getCentre(void) const; /// Gets the position of the lower corner. Vector3DInt32 getLowerCorner(void) const; /// Gets the position of the upper corner. @@ -203,6 +211,30 @@ namespace PolyVox // 'inline' keyword is used for the definition rather than the declaration. // See also http://www.parashift.com/c++-faq-lite/inline-functions.html + /** + * \return The 'x' position of the centre. + */ + inline int32_t Region::getCentreX(void) const + { + return (m_iLowerX + m_iUpperX) / 2; + } + + /** + * \return The 'y' position of the centre. + */ + inline int32_t Region::getCentreY(void) const + { + return (m_iLowerY + m_iUpperY) / 2; + } + + /** + * \return The 'z' position of the centre. + */ + inline int32_t Region::getCentreZ(void) const + { + return (m_iLowerZ + m_iUpperZ) / 2; + } + /** * \return The 'x' position of the lower corner. */ @@ -251,6 +283,14 @@ namespace PolyVox return m_iUpperZ; } + /** + * \return The position of the lower corner. + */ + inline Vector3DInt32 Region::getCentre(void) const + { + return Vector3DInt32(getCentreX(), getCentreY(), getCentreZ()); + } + /** * \return The position of the lower corner. */ From 575f4824cce8fc121f15107d3d90a1413b6e2dfb Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 3 Jan 2013 00:05:28 +0100 Subject: [PATCH 012/259] Added 'upperPowerOfTwo' function. --- .../PolyVoxCore/include/PolyVoxCore/Impl/Utility.h | 1 + library/PolyVoxCore/source/Impl/Utility.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index 77dac7a4..5b2e327c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -37,6 +37,7 @@ namespace PolyVox int32_t roundToInteger(float r); template Type clamp(const Type& value, const Type& low, const Type& high); + uint32_t upperPowerOfTwo(uint32_t v); inline int32_t roundTowardsNegInf(float r) { diff --git a/library/PolyVoxCore/source/Impl/Utility.cpp b/library/PolyVoxCore/source/Impl/Utility.cpp index c82c9630..bce4cd98 100644 --- a/library/PolyVoxCore/source/Impl/Utility.cpp +++ b/library/PolyVoxCore/source/Impl/Utility.cpp @@ -60,4 +60,17 @@ namespace PolyVox else return ((uInput & (uInput-1)) == 0); } + + // http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 + uint32_t upperPowerOfTwo(uint32_t v) + { + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; + } } From e05cb1fefc0072ccfc45c63b4d81f4e2bca74cc0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 14 Jan 2013 23:12:48 +0100 Subject: [PATCH 013/259] Fix for zero length normals causing a crash. --- .../MarchingCubesSurfaceExtractor.inl | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 1f251862..33330741 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -440,7 +440,13 @@ namespace PolyVox const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerCorner().getZ())); Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only @@ -467,7 +473,13 @@ namespace PolyVox const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ())); Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only @@ -494,7 +506,12 @@ namespace PolyVox const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ()) + fInterp); Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); - v3dNormal.normalise(); + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } //Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of //material IDs does not make sense). We take the largest, so that if we are working on a material-only From 1d1dcc875a8dcf55cb550f06f611f610710fd354 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 14 Jan 2013 23:13:17 +0100 Subject: [PATCH 014/259] Added 'intersects' function to Region. --- .../PolyVoxCore/include/PolyVoxCore/Region.h | 2 ++ library/PolyVoxCore/source/Region.cpp | 25 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index d65fb022..32aa7715 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -207,6 +207,8 @@ namespace PolyVox int32_t m_iUpperZ; }; + bool intersects(const Region& a, const Region& b); + // Functions to be inlined to to be in the header rather than the .cpp. // 'inline' keyword is used for the definition rather than the declaration. // See also http://www.parashift.com/c++-faq-lite/inline-functions.html diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index dee56bb3..b3512b6f 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -148,12 +148,12 @@ namespace PolyVox && (m_iUpperX == rhs.m_iUpperX) && (m_iUpperY == rhs.m_iUpperY) && (m_iUpperZ == rhs.m_iUpperZ)); } - //////////////////////////////////////////////////////////////////////////////// - /// Two regions are considered different if any of their extents differ. - /// \param rhs The Region to compare to. - /// \return true if the Regions are different. - /// \sa operator== - //////////////////////////////////////////////////////////////////////////////// + /** + * Two regions are considered different if any of their extents differ. + * \param rhs The Region to compare to. + * \return true if the Regions are different. + * \sa operator== + */ bool Region::operator!=(const Region& rhs) const { return !(*this == rhs); @@ -468,4 +468,17 @@ namespace PolyVox { shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } + /** + * This function only returns true if the regions are really intersecting and not simply touching. + */ + bool intersects(const Region& a, const Region& b) + { + // No intersection if seperated along an axis. + if(a.getUpperX() < b.getLowerX() || a.getLowerX() > b.getUpperX()) return false; + if(a.getUpperY() < b.getLowerY() || a.getLowerY() > b.getUpperY()) return false; + if(a.getUpperZ() < b.getLowerZ() || a.getLowerZ() > b.getUpperZ()) return false; + + // Overlapping on all axes means Regions are intersecting. + return true; + } } From 4df159dfd740f8f7d52e1b8ce7ce6f4f054745e3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 17 Jan 2013 23:51:52 +0100 Subject: [PATCH 015/259] Changed volume sampler wrap mode. --- library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index 61b8f218..8a530c51 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -169,7 +169,7 @@ namespace PolyVox float sy = (ty ) + m_regSrc.getLowerCorner().getY(); float sz = (tz ) + m_regSrc.getLowerCorner().getZ(); - typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); volDownscaledX.setVoxelAt(tx, ty, tz, result); } @@ -190,7 +190,7 @@ namespace PolyVox float sy = (ty * fScaleY); float sz = (tz ); - typename SrcVolumeType::VoxelType result = volDownscaledX.getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + typename SrcVolumeType::VoxelType result = volDownscaledX.getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); volDownscaledXAndY.setVoxelAt(tx, ty, tz, result); } @@ -210,7 +210,7 @@ namespace PolyVox float sy = (ty - m_regDst.getLowerY()); float sz = (tz - m_regDst.getLowerZ()) * fScaleZ; - typename SrcVolumeType::VoxelType result = volDownscaledXAndY.getVoxelWithWrapping(sx, sy, sz, WrapModes::Clamp); + typename SrcVolumeType::VoxelType result = volDownscaledXAndY.getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); m_pVolDst->setVoxelAt(tx, ty, tz, result); } From d3aed35d81396be515779bfa56460080ee9d9713 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 27 Jan 2013 13:03:30 +0100 Subject: [PATCH 016/259] Added some (temporary) interpolation code. --- .../include/PolyVoxCore/VolumeResampler.h | 3 ++ .../include/PolyVoxCore/VolumeResampler.inl | 35 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h index 06b1f3d7..271f9d4d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h @@ -28,6 +28,9 @@ freely, subject to the following restrictions: namespace PolyVox { + template + typename VolumeType::VoxelType interpolatedSample(VolumeType* pVolume, float fPosX, float fPosY, float fPosZ, WrapMode eWrapMode, typename VolumeType::VoxelType tBorder); + template< typename SrcVolumeType, typename DstVolumeType> class VolumeResampler { diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index 8a530c51..f4abc452 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -27,6 +27,37 @@ freely, subject to the following restrictions: namespace PolyVox { + // Takes an interpolated sample of the volume data. + template + typename VolumeType::VoxelType interpolatedSample(VolumeType* pVolume, float fPosX, float fPosY, float fPosZ, WrapMode eWrapMode, typename VolumeType::VoxelType tBorder) + { + float fFloorX = floor(fPosX); + float fFloorY = floor(fPosY); + float fFloorZ = floor(fPosZ); + + float fInterpX = fPosX - fFloorX; + float fInterpY = fPosY - fFloorY; + float fInterpZ = fPosZ - fFloorZ; + + // Conditional logic required to round negative floats correctly + int32_t iX = static_cast(fFloorX > 0.0f ? fFloorX + 0.5f : fFloorX - 0.5f); + int32_t iY = static_cast(fFloorY > 0.0f ? fFloorY + 0.5f : fFloorY - 0.5f); + int32_t iZ = static_cast(fFloorZ > 0.0f ? fFloorZ + 0.5f : fFloorZ - 0.5f); + + const typename VolumeType::VoxelType& voxel000 = pVolume->getVoxelWithWrapping(iX, iY, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel001 = pVolume->getVoxelWithWrapping(iX, iY, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel010 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel011 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel100 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel101 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel110 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel111 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ + 1, eWrapMode, tBorder); + + typename VolumeType::VoxelType tInterpolatedValue = PolyVox::trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,fInterpX,fInterpY,fInterpZ); + + return tInterpolatedValue; + } + /** * \param pVolSrc * \param regSrc @@ -169,7 +200,9 @@ namespace PolyVox float sy = (ty ) + m_regSrc.getLowerCorner().getY(); float sz = (tz ) + m_regSrc.getLowerCorner().getZ(); - typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); + //typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); + + typename SrcVolumeType::VoxelType result = interpolatedSample(m_pVolSrc, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); volDownscaledX.setVoxelAt(tx, ty, tz, result); } From f76be64d6bed96207c68136c501d8739bae73940 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 27 Jan 2013 22:02:13 +0100 Subject: [PATCH 017/259] Work on VolumeResampler (using real convolution). --- .../include/PolyVoxCore/Impl/Utility.h | 2 ++ .../include/PolyVoxCore/VolumeResampler.inl | 33 ++++++++++++++++--- library/PolyVoxCore/source/Impl/Utility.cpp | 5 +++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index 5b2e327c..1b635841 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -54,6 +54,8 @@ namespace PolyVox { return (std::min)(high, (std::max)(low, value)); } + + float triangleFilter(float fInput); } #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index f4abc452..eb9198b3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -23,6 +23,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Interpolation.h" +#include "PolyVoxCore/Impl/Utility.h" + #include namespace PolyVox @@ -200,9 +202,9 @@ namespace PolyVox float sy = (ty ) + m_regSrc.getLowerCorner().getY(); float sz = (tz ) + m_regSrc.getLowerCorner().getZ(); - //typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); + typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); - typename SrcVolumeType::VoxelType result = interpolatedSample(m_pVolSrc, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); + //typename SrcVolumeType::VoxelType result = interpolatedSample(m_pVolSrc, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); volDownscaledX.setVoxelAt(tx, ty, tz, result); } @@ -241,11 +243,32 @@ namespace PolyVox { float sx = (tx - m_regDst.getLowerX()); float sy = (ty - m_regDst.getLowerY()); - float sz = (tz - m_regDst.getLowerZ()) * fScaleZ; + float sLowerZ = ((tz - 1) - m_regDst.getLowerZ()) * fScaleZ; + float sCentreZ = ((tz ) - m_regDst.getLowerZ()) * fScaleZ; + float sUpperZ = ((tz + 1) - m_regDst.getLowerZ()) * fScaleZ; - typename SrcVolumeType::VoxelType result = volDownscaledXAndY.getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); + float sumOfWeights = 0.0f; + //typename SrcVolumeType::VoxelType tSum = SrcVolumeType::VoxelType(0); - m_pVolDst->setVoxelAt(tx, ty, tz, result); + //We should be able to use a higher range MultiMaterial rather than needing to use a Vector of floats. + //We shouold also probably support an Accumulation type rather than hard coding. + Vector<4, float> vecSum(0.0, 0.0, 0.0, 0.0); + + for(float sz = sLowerZ; sz <= sUpperZ; sz += 1.0) + { + float weight = triangleFilter(sz - sCentreZ); + sumOfWeights += weight; + + Vector<4, float> sample = interpolatedSample(&volDownscaledXAndY, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); + + vecSum += (sample * weight); + } + + vecSum /= sumOfWeights; //Should divide by 'norm' + + typename SrcVolumeType::VoxelType tResult = vecSum; //Should divide by 'norm' + + m_pVolDst->setVoxelAt(tx, ty, tz, tResult); } } } diff --git a/library/PolyVoxCore/source/Impl/Utility.cpp b/library/PolyVoxCore/source/Impl/Utility.cpp index bce4cd98..4733f57f 100644 --- a/library/PolyVoxCore/source/Impl/Utility.cpp +++ b/library/PolyVoxCore/source/Impl/Utility.cpp @@ -73,4 +73,9 @@ namespace PolyVox v++; return v; } + + float triangleFilter(float fInput) + { + return (std::max)(1.0f - (std::abs)(fInput), 0.0f); + } } From dadcf03d8d0fae6f0356d19e7de5e557b414bd48 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 31 Jan 2013 21:04:01 +0100 Subject: [PATCH 018/259] Added note. --- .../include/PolyVoxCore/VolumeResampler.inl | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index eb9198b3..d5444ff8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -33,28 +33,28 @@ namespace PolyVox template typename VolumeType::VoxelType interpolatedSample(VolumeType* pVolume, float fPosX, float fPosY, float fPosZ, WrapMode eWrapMode, typename VolumeType::VoxelType tBorder) { - float fFloorX = floor(fPosX); - float fFloorY = floor(fPosY); - float fFloorZ = floor(fPosZ); - - float fInterpX = fPosX - fFloorX; - float fInterpY = fPosY - fFloorY; - float fInterpZ = fPosZ - fFloorZ; - - // Conditional logic required to round negative floats correctly - int32_t iX = static_cast(fFloorX > 0.0f ? fFloorX + 0.5f : fFloorX - 0.5f); - int32_t iY = static_cast(fFloorY > 0.0f ? fFloorY + 0.5f : fFloorY - 0.5f); - int32_t iZ = static_cast(fFloorZ > 0.0f ? fFloorZ + 0.5f : fFloorZ - 0.5f); - - const typename VolumeType::VoxelType& voxel000 = pVolume->getVoxelWithWrapping(iX, iY, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel001 = pVolume->getVoxelWithWrapping(iX, iY, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel010 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel011 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel100 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel101 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel110 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel111 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ + 1, eWrapMode, tBorder); - + float fFloorX = floor(fPosX); + float fFloorY = floor(fPosY); + float fFloorZ = floor(fPosZ); + + float fInterpX = fPosX - fFloorX; + float fInterpY = fPosY - fFloorY; + float fInterpZ = fPosZ - fFloorZ; + + // Conditional logic required to round negative floats correctly + int32_t iX = static_cast(fFloorX > 0.0f ? fFloorX + 0.5f : fFloorX - 0.5f); + int32_t iY = static_cast(fFloorY > 0.0f ? fFloorY + 0.5f : fFloorY - 0.5f); + int32_t iZ = static_cast(fFloorZ > 0.0f ? fFloorZ + 0.5f : fFloorZ - 0.5f); + + const typename VolumeType::VoxelType& voxel000 = pVolume->getVoxelWithWrapping(iX, iY, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel001 = pVolume->getVoxelWithWrapping(iX, iY, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel010 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel011 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel100 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel101 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ + 1, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel110 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ, eWrapMode, tBorder); + const typename VolumeType::VoxelType& voxel111 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ + 1, eWrapMode, tBorder); + typename VolumeType::VoxelType tInterpolatedValue = PolyVox::trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,fInterpX,fInterpY,fInterpZ); return tInterpolatedValue; @@ -259,6 +259,7 @@ namespace PolyVox float weight = triangleFilter(sz - sCentreZ); sumOfWeights += weight; + //This is wrong! There's no need to do interpolation. Just multiply the sameple by the correct kernel value. Vector<4, float> sample = interpolatedSample(&volDownscaledXAndY, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); vecSum += (sample * weight); From f517137991bde40436d5c92580887f638b5362ef Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 8 Feb 2013 22:19:02 +0100 Subject: [PATCH 019/259] Performance improvements brought across from develop. --- .../PolyVoxCore/CubicSurfaceExtractor.inl | 86 +++++++++---------- .../MarchingCubesSurfaceExtractor.inl | 84 +++++++++--------- 2 files changed, 84 insertions(+), 86 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 694aea52..8e7c6751 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -50,8 +50,8 @@ namespace PolyVox { m_meshCurrent->clear(); - uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2; - uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 2; + uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2; + uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2; uint32_t arraySize[3]= {uArrayWidth, uArrayHeight, MaxVerticesPerPosition}; m_previousSliceVertices.resize(arraySize); @@ -59,35 +59,31 @@ namespace PolyVox memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); - uint32_t uRegionWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; - uint32_t uRegionHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; - uint32_t uRegionDepth = m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ() + 1; + m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); + m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); - m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); - m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); + m_vecQuads[NegativeY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); + m_vecQuads[PositiveY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); - m_vecQuads[NegativeY].resize(m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 2); - m_vecQuads[PositiveY].resize(m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 2); - - m_vecQuads[NegativeZ].resize(m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ() + 2); - m_vecQuads[PositiveZ].resize(m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ() + 2); + m_vecQuads[NegativeZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); + m_vecQuads[PositiveZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); typename VolumeType::Sampler volumeSampler(m_volData); volumeSampler.setWrapMode(m_eWrapMode, m_tBorderValue); - for(int32_t z = m_regSizeInVoxels.getLowerCorner().getZ(); z <= m_regSizeInVoxels.getUpperCorner().getZ(); z++) + for(int32_t z = m_regSizeInVoxels.getLowerZ(); z <= m_regSizeInVoxels.getUpperZ(); z++) { - uint32_t regZ = z - m_regSizeInVoxels.getLowerCorner().getZ(); + uint32_t regZ = z - m_regSizeInVoxels.getLowerZ(); - for(int32_t y = m_regSizeInVoxels.getLowerCorner().getY(); y <= m_regSizeInVoxels.getUpperCorner().getY(); y++) + for(int32_t y = m_regSizeInVoxels.getLowerY(); y <= m_regSizeInVoxels.getUpperY(); y++) { - uint32_t regY = y - m_regSizeInVoxels.getLowerCorner().getY(); + uint32_t regY = y - m_regSizeInVoxels.getLowerY(); - for(int32_t x = m_regSizeInVoxels.getLowerCorner().getX(); x <= m_regSizeInVoxels.getUpperCorner().getX(); x++) + volumeSampler.setPosition(m_regSizeInVoxels.getLowerX(),y,z); + + for(int32_t x = m_regSizeInVoxels.getLowerX(); x <= m_regSizeInVoxels.getUpperX(); x++) { - uint32_t regX = x - m_regSizeInVoxels.getLowerCorner().getX(); - - volumeSampler.setPosition(x,y,z); + uint32_t regX = x - m_regSizeInVoxels.getLowerX(); typename VolumeType::VoxelType material; //Filled in by callback typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); @@ -98,20 +94,20 @@ namespace PolyVox // X if(m_funcIsQuadNeededCallback(currentVoxel, negXVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v2 = addVertex(regX - 0.5f, regY + 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); m_vecQuads[NegativeX][regX].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negXVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v2 = addVertex(regX - 0.5f, regY + 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); m_vecQuads[PositiveX][regX].push_back(Quad(v0, v3, v2, v1)); } @@ -119,20 +115,20 @@ namespace PolyVox // Y if(m_funcIsQuadNeededCallback(currentVoxel, negYVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); m_vecQuads[NegativeY][regY].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negYVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX - 0.5f, regY - 0.5f, regZ + 0.5f, material, m_currentSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) + 0.5f, material, m_currentSliceVertices); m_vecQuads[PositiveY][regY].push_back(Quad(v0, v3, v2, v1)); } @@ -140,23 +136,25 @@ namespace PolyVox // Z if(m_funcIsQuadNeededCallback(currentVoxel, negZVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v3 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); m_vecQuads[NegativeZ][regZ].push_back(Quad(v0, v1, v2, v3)); } if(m_funcIsQuadNeededCallback(negZVoxel, currentVoxel, material)) { - uint32_t v0 = addVertex(regX - 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX - 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 0.5f, regY + 0.5f, regZ - 0.5f, material, m_previousSliceVertices); - uint32_t v3 = addVertex(regX + 0.5f, regY - 0.5f, regZ - 0.5f, material, m_previousSliceVertices); + uint32_t v0 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v1 = addVertex(static_cast(regX) - 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v2 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) + 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); + uint32_t v3 = addVertex(static_cast(regX) + 0.5f, static_cast(regY) - 0.5f, static_cast(regZ) - 0.5f, material, m_previousSliceVertices); m_vecQuads[PositiveZ][regZ].push_back(Quad(v0, v3, v2, v1)); } + + volumeSampler.movePositiveX(); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 8e9b8b44..44ad5cbe 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -44,8 +44,8 @@ namespace PolyVox { m_meshCurrent->clear(); - const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; - const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; + const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; + const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions //For edge indices @@ -62,7 +62,7 @@ namespace PolyVox //Create a region corresponding to the first slice m_regSlicePrevious = m_regSizeInVoxels; Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); - v3dUpperCorner.setZ(m_regSlicePrevious.getLowerCorner().getZ()); //Set the upper z to the lower z to make it one slice thick. + v3dUpperCorner.setZ(m_regSlicePrevious.getLowerZ()); //Set the upper z to the lower z to make it one slice thick. m_regSlicePrevious.setUpperCorner(v3dUpperCorner); m_regSliceCurrent = m_regSlicePrevious; @@ -91,7 +91,7 @@ namespace PolyVox m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); //Process the other slices (previous slice is available) - for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ(); uSlice++) + for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ(); uSlice++) { computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; @@ -134,29 +134,29 @@ namespace PolyVox { m_uNoOfOccupiedCells = 0; - const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperCorner().getX(); - const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperCorner().getY(); + const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperX(); + const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperY(); - const int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); //Process the lower left corner - int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); - int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); + int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); + int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); - uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); //Process the edge where x is minimal. - iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); - m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerCorner().getY(), iZVolSpace); - for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + iXVolSpace = m_regSliceCurrent.getLowerX(); + m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerY(), iZVolSpace); + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); m_sampVolume.movePositiveY(); @@ -164,12 +164,12 @@ namespace PolyVox } //Process the edge where y is minimal. - iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); - m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + iYVolSpace = m_regSliceCurrent.getLowerY(); + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); m_sampVolume.movePositiveX(); @@ -177,13 +177,13 @@ namespace PolyVox } //Process all remaining elemnents of the slice. In this case, previous x and y values are always available - for(iYVolSpace = m_regSliceCurrent.getLowerCorner().getY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) { - m_sampVolume.setPosition(m_regSliceCurrent.getLowerCorner().getX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerCorner().getX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); m_sampVolume.movePositiveX(); @@ -400,17 +400,17 @@ namespace PolyVox Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) { - const int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ(); + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); //Iterate over each cell in the region - for(int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY(); iYVolSpace <= m_regSliceCurrent.getUpperCorner().getY(); iYVolSpace++) + for(int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); iYVolSpace <= m_regSliceCurrent.getUpperY(); iYVolSpace++) { - const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY(); + const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - for(int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX(); iXVolSpace <= m_regSliceCurrent.getUpperCorner().getX(); iXVolSpace++) + for(int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); iXVolSpace <= m_regSliceCurrent.getUpperX(); iXVolSpace++) { //Current position - const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX(); + const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); //Determine the index into the edge table which tells us which vertices are inside of the surface const uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; @@ -437,7 +437,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerCorner().getZ())); + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); @@ -458,7 +458,7 @@ namespace PolyVox const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; m_sampVolume.moveNegativeX(); } @@ -470,7 +470,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ())); + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); @@ -491,7 +491,7 @@ namespace PolyVox PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; m_sampVolume.moveNegativeY(); } @@ -503,7 +503,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ()) + fInterp); + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so @@ -523,7 +523,7 @@ namespace PolyVox const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX()][iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY()] = uLastVertexIndex; + m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; m_sampVolume.moveNegativeZ(); } @@ -545,17 +545,17 @@ namespace PolyVox indlist[i] = -1; } - const int32_t iZVolSpace = m_regSlicePrevious.getLowerCorner().getZ(); + const int32_t iZVolSpace = m_regSlicePrevious.getLowerZ(); - for(int32_t iYVolSpace = m_regSlicePrevious.getLowerCorner().getY(); iYVolSpace <= m_regSizeInCells.getUpperCorner().getY(); iYVolSpace++) + for(int32_t iYVolSpace = m_regSlicePrevious.getLowerY(); iYVolSpace <= m_regSizeInCells.getUpperY(); iYVolSpace++) { - for(int32_t iXVolSpace = m_regSlicePrevious.getLowerCorner().getX(); iXVolSpace <= m_regSizeInCells.getUpperCorner().getX(); iXVolSpace++) + for(int32_t iXVolSpace = m_regSlicePrevious.getLowerX(); iXVolSpace <= m_regSizeInCells.getUpperX(); iXVolSpace++) { m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); //Current position - const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerCorner().getX(); - const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerCorner().getY(); + const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerX(); + const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); //Determine the index into the edge table which tells us which vertices are inside of the surface const uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; From 055539ef7595f51ee7e38f2b9517c2c385d6887a Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Tue, 26 Mar 2013 11:45:53 +0100 Subject: [PATCH 020/259] Reenabled exceptions as we're not using Cubiquity on mobile at the moment. --- library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h index 919950f2..e97e27af 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h @@ -25,6 +25,6 @@ freely, subject to the following restrictions: #define __PolyVox_Config_H__ #define POLYVOX_ASSERTS_ENABLED -//#define POLYVOX_THROW_ENABLED //Not allowed on Android. +#define POLYVOX_THROW_ENABLED #endif From 2a839e583d5e115c090248bdb14918201541cafb Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Tue, 7 May 2013 15:41:26 +0200 Subject: [PATCH 021/259] Added stream serialisation to Region. --- library/PolyVoxCore/include/PolyVoxCore/Region.h | 5 +++++ library/PolyVoxCore/source/Region.cpp | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 32aa7715..a0b276cd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -207,8 +207,13 @@ namespace PolyVox int32_t m_iUpperZ; }; + // Non-member functions bool intersects(const Region& a, const Region& b); + // Non-member overloaded operators. + /// Stream insertion operator. + std::ostream& operator<<(std::ostream& os, const Region& region); + // Functions to be inlined to to be in the header rather than the .cpp. // 'inline' keyword is used for the definition rather than the declaration. // See also http://www.parashift.com/c++-faq-lite/inline-functions.html diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index 32d8454d..bf60ceb2 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -470,6 +470,7 @@ namespace PolyVox /** * This function only returns true if the regions are really intersecting and not simply touching. */ + bool intersects(const Region& a, const Region& b) { // No intersection if seperated along an axis. @@ -480,4 +481,17 @@ namespace PolyVox // Overlapping on all axes means Regions are intersecting. return true; } + + /** + * Enables the Region to be used intuitively with output streams such as cout. + * \param os The output stream to write to. + * \param region The Region to write to the stream. + * \return A reference to the output stream to allow chaining. + */ + std::ostream& operator<<(std::ostream& os, const Region& region) + { + os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() << + ") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")"; + return os; + } } From 618b09df464b742de1905b291f2195f28a26556c Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Thu, 16 May 2013 16:14:05 +0200 Subject: [PATCH 022/259] Fixed compile errors. --- .../PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h | 6 +++--- library/PolyVoxCore/source/Impl/ErrorHandling.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index 8df554a3..c81c8221 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -121,7 +121,7 @@ namespace PolyVox ss << " Condition: " << #condition << std::endl; \ ss << " Message: " << (message) << std::endl; \ ss << " Location: " << "Line " << __LINE__ << " of " << __FILE__ << std::endl << std::endl; \ - logFatal(ss.str()); \ + PolyVox::logFatal(ss.str()); \ POLYVOX_HALT(); \ } \ } while(0) \ @@ -176,7 +176,7 @@ namespace PolyVox */ #ifdef POLYVOX_THROW_ENABLED #define POLYVOX_THROW(type, message) \ - log(message, LogLevels::Error); \ + PolyVox::logError(message); \ throw type((message)) #else namespace PolyVox @@ -188,7 +188,7 @@ namespace PolyVox } #define POLYVOX_THROW(type, message) \ - log(message, LogLevels::Error); \ + PolyVox::logError(message); \ type except = (type)((message)); \ getThrowHandler()((except), __FILE__, __LINE__) #endif diff --git a/library/PolyVoxCore/source/Impl/ErrorHandling.cpp b/library/PolyVoxCore/source/Impl/ErrorHandling.cpp index c07429df..8e90bb3e 100644 --- a/library/PolyVoxCore/source/Impl/ErrorHandling.cpp +++ b/library/PolyVoxCore/source/Impl/ErrorHandling.cpp @@ -133,7 +133,7 @@ namespace PolyVox ss << " Line: " << line << std::endl; \ ss << " File: " << file << std::endl; \ ss << " Message: " << e.what() << std::endl << std::endl; \ - logFatal(ss.str()); \ + PolyVox::logFatal(ss.str()); \ POLYVOX_HALT(); \ } From 51f9898467abd672fbf207a67074008ee15502d5 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 22 Jun 2013 06:32:26 +0200 Subject: [PATCH 023/259] Reenabled unused vertex removal. --- .../PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 331cc99c..79b0b196 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -188,7 +188,7 @@ namespace PolyVox } m_meshCurrent->m_Region = m_regSizeInVoxels; - //m_meshCurrent->removeUnusedVertices(); + m_meshCurrent->removeUnusedVertices(); m_meshCurrent->m_vecLodRecords.clear(); LodRecord lodRecord; From a10fcf8eccd15bb4695aa557fd27ee40ed48b980 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 27 Jul 2013 15:02:16 +0200 Subject: [PATCH 024/259] Small changes for debugging Cubiquity. --- library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 7 +++++++ library/PolyVoxCore/include/PolyVoxCore/Vector.inl | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 4500207e..191e34f4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -117,4 +117,11 @@ freely, subject to the following restrictions: #define polyvox_shared_ptr boost::shared_ptr #endif +//#define USE_LARGE_VOLUME +#ifdef USE_LARGE_VOLUME + #define POLYVOX_VOLUME LargeVolume +#else + #define POLYVOX_VOLUME SimpleVolume +#endif + #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index a877fea0..7d7cd207 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -653,7 +653,10 @@ namespace PolyVox inline void Vector::normalise(void) { float fLength = this->length(); - if(fLength <= 0.0) + + // We could wait until the NAN occurs before throwing, but then we'd have to add some roll-back code. + // This seems like a lot of overhead for a common operation which should rarely go wrong. + if(fLength <= 0.0001) { POLYVOX_THROW(invalid_operation, "Cannot normalise a vector with a length of zero"); } From 0c8013317e070bc7e134dd50d6e0984d7ef4b616 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 28 Jul 2013 16:43:43 +0200 Subject: [PATCH 025/259] Added asserts to catch corrupt data probably resulting from multithreading. --- .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 44ad5cbe..1702049f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -433,6 +433,7 @@ namespace PolyVox { m_sampVolume.movePositiveX(); const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v100, "Attempting to insert vertex between two voxels with the same value"); const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); @@ -466,6 +467,7 @@ namespace PolyVox { m_sampVolume.movePositiveY(); const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v010, "Attempting to insert vertex between two voxels with the same value"); const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); @@ -499,6 +501,7 @@ namespace PolyVox { m_sampVolume.movePositiveZ(); const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v001, "Attempting to insert vertex between two voxels with the same value"); const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); From 00fab818cccce28d683565c239ea0684e78d8b3d Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 28 Jul 2013 16:45:08 +0200 Subject: [PATCH 026/259] Added define to switch between SimpleVolume and LargeVolume in Cubiquity. This is an abuse of Typedef.h but it's a convenient location and just for temporary testing purposes. It won't get merged back into PolyVox. --- library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 191e34f4..24cb8217 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -117,7 +117,7 @@ freely, subject to the following restrictions: #define polyvox_shared_ptr boost::shared_ptr #endif -//#define USE_LARGE_VOLUME +#define USE_LARGE_VOLUME #ifdef USE_LARGE_VOLUME #define POLYVOX_VOLUME LargeVolume #else From fcf5b2b055472488a67ce355b8a0c018d1c28626 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 9 Aug 2013 20:32:20 +0200 Subject: [PATCH 027/259] Making Cubiquity version of PolyVox more closely match develop version. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 1 + .../CubicSurfaceExtractorWithNormals.inl | 12 +- .../include/PolyVoxCore/DefaultIsQuadNeeded.h | 4 +- .../PolyVoxCore/Impl/CompilerCapabilities.h | 2 +- .../include/PolyVoxCore/Impl/Utility.h | 2 - .../MarchingCubesSurfaceExtractor.inl | 5 +- .../PolyVoxCore/include/PolyVoxCore/Region.h | 10 +- .../include/PolyVoxCore/SurfaceMesh.h | 4 +- .../include/PolyVoxCore/SurfaceMesh.inl | 4 +- .../include/PolyVoxCore/VolumeResampler.h | 4 - .../include/PolyVoxCore/VolumeResampler.inl | 145 +----------------- library/PolyVoxCore/source/Impl/Utility.cpp | 5 - library/PolyVoxCore/source/Region.cpp | 10 +- 13 files changed, 28 insertions(+), 180 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 73477153..86e04020 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -118,6 +118,7 @@ namespace PolyVox CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif + void execute(); private: diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl index 11b2ca9b..df347b32 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl @@ -43,16 +43,16 @@ namespace PolyVox Timer timer; m_meshCurrent->clear(); - for(int32_t z = m_regSizeInVoxels.getLowerCorner().getZ(); z < m_regSizeInVoxels.getUpperCorner().getZ(); z++) + for(int32_t z = m_regSizeInVoxels.getLowerZ(); z < m_regSizeInVoxels.getUpperZ(); z++) { - for(int32_t y = m_regSizeInVoxels.getLowerCorner().getY(); y < m_regSizeInVoxels.getUpperCorner().getY(); y++) + for(int32_t y = m_regSizeInVoxels.getLowerY(); y < m_regSizeInVoxels.getUpperY(); y++) { - for(int32_t x = m_regSizeInVoxels.getLowerCorner().getX(); x < m_regSizeInVoxels.getUpperCorner().getX(); x++) + for(int32_t x = m_regSizeInVoxels.getLowerX(); x < m_regSizeInVoxels.getUpperX(); x++) { // these are always positive anyway - float regX = static_cast(x - m_regSizeInVoxels.getLowerCorner().getX()); - float regY = static_cast(y - m_regSizeInVoxels.getLowerCorner().getY()); - float regZ = static_cast(z - m_regSizeInVoxels.getLowerCorner().getZ()); + float regX = static_cast(x - m_regSizeInVoxels.getLowerX()); + float regY = static_cast(y - m_regSizeInVoxels.getLowerY()); + float regZ = static_cast(z - m_regSizeInVoxels.getLowerZ()); uint32_t material = 0; diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index ea6cf673..ce011036 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -32,11 +32,11 @@ namespace PolyVox class DefaultIsQuadNeeded { public: - bool operator()(VoxelType back, VoxelType front, float& materialToUse) + bool operator()(VoxelType back, VoxelType front, uint32_t& materialToUse) { if((back > 0) && (front == 0)) { - materialToUse = static_cast(back); + materialToUse = static_cast(back); return true; } else diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h index 1884e19e..074c3555 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h @@ -15,7 +15,7 @@ // is a recent version) then assume support for these. #if !defined(_MSC_VER) || (_MSC_VER >= 1600) #define HAS_CXX11_CONSTEXPR - //#define HAS_CXX11_STATIC_ASSERT //This seems to cause issues on Android. + #define HAS_CXX11_STATIC_ASSERT #define HAS_CXX11_CSTDINT_H #define HAS_CXX11_SHARED_PTR #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index ccd35ff1..6fa4795e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -52,8 +52,6 @@ namespace PolyVox { return (std::min)(high, (std::max)(low, value)); } - - float triangleFilter(float fInput); } #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 00c4bfac..5ef22675 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -461,7 +461,6 @@ namespace PolyVox //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); const typename Controller::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); - //const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial100, fInterp); const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); @@ -495,7 +494,6 @@ namespace PolyVox //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); const typename Controller::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); - //const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial010, fInterp); PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); @@ -528,7 +526,6 @@ namespace PolyVox //volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. const typename Controller::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); const typename Controller::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); - //const typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(uMaterial000, uMaterial001, fInterp); const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); @@ -640,4 +637,4 @@ namespace PolyVox }//For each cell } } -} \ No newline at end of file +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 3a3383f0..8d654cd0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -141,21 +141,21 @@ namespace PolyVox /// Tests whether the given point is contained in this Region. bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const; /// Tests whether the given point is contained in this Region. - bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary = 0) const; + bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const; /// Tests whether the given point is contained in this Region. - bool containsPoint(const Vector3DInt32& pos, int8_t boundary = 0) const; + bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const; /// Tests whether the given position is contained in the 'x' range of this Region. bool containsPointInX(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'x' range of this Region. - bool containsPointInX(int32_t pos, int8_t boundary = 0) const; + bool containsPointInX(int32_t pos, uint8_t boundary = 0) const; /// Tests whether the given position is contained in the 'y' range of this Region. bool containsPointInY(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'y' range of this Region. - bool containsPointInY(int32_t pos, int8_t boundary = 0) const; + bool containsPointInY(int32_t pos, uint8_t boundary = 0) const; /// Tests whether the given position is contained in the 'z' range of this Region. bool containsPointInZ(float pos, float boundary = 0.0f) const; /// Tests whether the given position is contained in the 'z' range of this Region. - bool containsPointInZ(int32_t pos, int8_t boundary = 0) const; + bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const; /// Tests whether the given Region is contained in this Region. bool containsRegion(const Region& reg, uint8_t boundary = 0) const; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h index ce96c227..9ccc58fb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h @@ -95,8 +95,8 @@ namespace PolyVox std::vector m_vecLodRecords; }; - /*template - polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials);*/ + template + polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials); } #include "PolyVoxCore/SurfaceMesh.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl index e2dcf694..ae2b5b95 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl @@ -394,7 +394,7 @@ namespace PolyVox } //Currently a free function - think where this needs to go. - /*template + template polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials) { polyvox_shared_ptr< SurfaceMesh > result(new SurfaceMesh); @@ -460,7 +460,7 @@ namespace PolyVox result->m_vecLodRecords.push_back(lodRecord); return result; - }*/ + } template void SurfaceMesh::scaleVertices(float amount) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h index 271f9d4d..5074a92c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h @@ -28,9 +28,6 @@ freely, subject to the following restrictions: namespace PolyVox { - template - typename VolumeType::VoxelType interpolatedSample(VolumeType* pVolume, float fPosX, float fPosY, float fPosZ, WrapMode eWrapMode, typename VolumeType::VoxelType tBorder); - template< typename SrcVolumeType, typename DstVolumeType> class VolumeResampler { @@ -42,7 +39,6 @@ namespace PolyVox private: void resampleSameSize(); void resampleArbitrary(); - void resampleBetter(); //Source data SrcVolumeType* m_pVolSrc; diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index aa241548..2c6c129d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -23,43 +23,10 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Interpolation.h" -#include "PolyVoxCore/Impl/Utility.h" - #include namespace PolyVox { - // Takes an interpolated sample of the volume data. - template - typename VolumeType::VoxelType interpolatedSample(VolumeType* pVolume, float fPosX, float fPosY, float fPosZ, WrapMode eWrapMode, typename VolumeType::VoxelType tBorder) - { - float fFloorX = floor(fPosX); - float fFloorY = floor(fPosY); - float fFloorZ = floor(fPosZ); - - float fInterpX = fPosX - fFloorX; - float fInterpY = fPosY - fFloorY; - float fInterpZ = fPosZ - fFloorZ; - - // Conditional logic required to round negative floats correctly - int32_t iX = static_cast(fFloorX > 0.0f ? fFloorX + 0.5f : fFloorX - 0.5f); - int32_t iY = static_cast(fFloorY > 0.0f ? fFloorY + 0.5f : fFloorY - 0.5f); - int32_t iZ = static_cast(fFloorZ > 0.0f ? fFloorZ + 0.5f : fFloorZ - 0.5f); - - const typename VolumeType::VoxelType& voxel000 = pVolume->getVoxelWithWrapping(iX, iY, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel001 = pVolume->getVoxelWithWrapping(iX, iY, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel010 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel011 = pVolume->getVoxelWithWrapping(iX, iY + 1, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel100 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel101 = pVolume->getVoxelWithWrapping(iX + 1, iY, iZ + 1, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel110 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ, eWrapMode, tBorder); - const typename VolumeType::VoxelType& voxel111 = pVolume->getVoxelWithWrapping(iX + 1, iY + 1, iZ + 1, eWrapMode, tBorder); - - typename VolumeType::VoxelType tInterpolatedValue = PolyVox::trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,fInterpX,fInterpY,fInterpZ); - - return tInterpolatedValue; - } - /** * \param pVolSrc * \param regSrc @@ -86,16 +53,14 @@ namespace PolyVox int32_t uDstHeight = m_regDst.getUpperY() - m_regDst.getLowerY() + 1; int32_t uDstDepth = m_regDst.getUpperZ() - m_regDst.getLowerZ() + 1; - /*if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) + if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) { resampleSameSize(); } else { resampleArbitrary(); - }*/ - - resampleBetter(); + } } template< typename SrcVolumeType, typename DstVolumeType> @@ -162,7 +127,7 @@ namespace PolyVox sy = modf(sy, &dummy); sz = modf(sz, &dummy); - typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); + typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); typename DstVolumeType::VoxelType result = static_cast(tInterpolatedValue); m_pVolDst->setVoxelAt(dx,dy,dz,result); @@ -170,108 +135,4 @@ namespace PolyVox } } } - - template< typename SrcVolumeType, typename DstVolumeType> - void VolumeResampler::resampleBetter() - { - float srcWidth = m_regSrc.getWidthInCells(); - float srcHeight = m_regSrc.getHeightInCells(); - float srcDepth = m_regSrc.getDepthInCells(); - - float dstWidth = m_regDst.getWidthInCells(); - float dstHeight = m_regDst.getHeightInCells(); - float dstDepth = m_regDst.getDepthInCells(); - - float fScaleX = srcWidth / dstWidth; - float fScaleY = srcHeight / dstHeight; - float fScaleZ = srcDepth / dstDepth; - - typename SrcVolumeType::Sampler sampler(m_pVolSrc); - - // Should use SrcVolumeType? Or new template parameter? - Region regDownscaledX(0, 0, 0, m_regDst.getWidthInVoxels()-1, m_regSrc.getHeightInVoxels()-1, m_regSrc.getDepthInVoxels()-1); - SrcVolumeType volDownscaledX(regDownscaledX); - - for(int32_t tz = regDownscaledX.getLowerZ(); tz <= regDownscaledX.getUpperZ(); tz++) - { - for(int32_t ty = regDownscaledX.getLowerY(); ty <= regDownscaledX.getUpperY(); ty++) - { - for(int32_t tx = regDownscaledX.getLowerX(); tx <= regDownscaledX.getUpperX(); tx++) - { - float sx = (tx * fScaleX) + m_regSrc.getLowerCorner().getX(); - float sy = (ty ) + m_regSrc.getLowerCorner().getY(); - float sz = (tz ) + m_regSrc.getLowerCorner().getZ(); - - typename SrcVolumeType::VoxelType result = m_pVolSrc->getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); - - //typename SrcVolumeType::VoxelType result = interpolatedSample(m_pVolSrc, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType(0)); - - volDownscaledX.setVoxelAt(tx, ty, tz, result); - } - } - } - - //Now downscale in y - Region regDownscaledXAndY(0, 0, 0, m_regDst.getWidthInVoxels()-1, m_regDst.getHeightInVoxels()-1, m_regSrc.getDepthInVoxels()-1); - SrcVolumeType volDownscaledXAndY(regDownscaledXAndY); - - for(int32_t tz = regDownscaledXAndY.getLowerZ(); tz <= regDownscaledXAndY.getUpperZ(); tz++) - { - for(int32_t ty = regDownscaledXAndY.getLowerY(); ty <= regDownscaledXAndY.getUpperY(); ty++) - { - for(int32_t tx = regDownscaledXAndY.getLowerX(); tx <= regDownscaledXAndY.getUpperX(); tx++) - { - float sx = (tx ); - float sy = (ty * fScaleY); - float sz = (tz ); - - typename SrcVolumeType::VoxelType result = volDownscaledX.getVoxelWithWrapping(sx, sy, sz, WrapModes::Border); - - volDownscaledXAndY.setVoxelAt(tx, ty, tz, result); - } - } - } - - //Now copy and downscale to dst. - //Region regDst = m_pVolDst->getEnclosingRegion(); - - for(int32_t tz = m_regDst.getLowerZ(); tz <= m_regDst.getUpperZ(); tz++) - { - for(int32_t ty = m_regDst.getLowerY(); ty <= m_regDst.getUpperY(); ty++) - { - for(int32_t tx = m_regDst.getLowerX(); tx <= m_regDst.getUpperX(); tx++) - { - float sx = (tx - m_regDst.getLowerX()); - float sy = (ty - m_regDst.getLowerY()); - float sLowerZ = ((tz - 1) - m_regDst.getLowerZ()) * fScaleZ; - float sCentreZ = ((tz ) - m_regDst.getLowerZ()) * fScaleZ; - float sUpperZ = ((tz + 1) - m_regDst.getLowerZ()) * fScaleZ; - - float sumOfWeights = 0.0f; - //typename SrcVolumeType::VoxelType tSum = SrcVolumeType::VoxelType(0); - - //We should be able to use a higher range MultiMaterial rather than needing to use a Vector of floats. - //We shouold also probably support an Accumulation type rather than hard coding. - Vector<4, float> vecSum(0.0, 0.0, 0.0, 0.0); - - for(float sz = sLowerZ; sz <= sUpperZ; sz += 1.0) - { - float weight = triangleFilter(sz - sCentreZ); - sumOfWeights += weight; - - //This is wrong! There's no need to do interpolation. Just multiply the sameple by the correct kernel value. - Vector<4, float> sample = interpolatedSample(&volDownscaledXAndY, sx, sy, sz, WrapModes::Border, SrcVolumeType::VoxelType()); - - vecSum += (sample * weight); - } - - vecSum /= sumOfWeights; //Should divide by 'norm' - - typename SrcVolumeType::VoxelType tResult = vecSum; //Should divide by 'norm' - - m_pVolDst->setVoxelAt(tx, ty, tz, tResult); - } - } - } - } } diff --git a/library/PolyVoxCore/source/Impl/Utility.cpp b/library/PolyVoxCore/source/Impl/Utility.cpp index 555e947c..1c9c152f 100644 --- a/library/PolyVoxCore/source/Impl/Utility.cpp +++ b/library/PolyVoxCore/source/Impl/Utility.cpp @@ -69,9 +69,4 @@ namespace PolyVox v++; return v; } - - float triangleFilter(float fInput) - { - return (std::max)(1.0f - (std::abs)(fInput), 0.0f); - } } diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index 5e248dc5..50e837af 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -201,7 +201,7 @@ namespace PolyVox * \param iZ The 'z' position of the point to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary) const + bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const { return (iX <= m_iUpperX - boundary) && (iY <= m_iUpperY - boundary) @@ -218,7 +218,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(const Vector3DInt32& pos, int8_t boundary) const + bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const { return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); } @@ -243,7 +243,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInX(int32_t pos, int8_t boundary) const + bool Region::containsPointInX(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperX - boundary) && (pos >= m_iLowerX + boundary); @@ -269,7 +269,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInY(int32_t pos, int8_t boundary) const + bool Region::containsPointInY(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperY - boundary) && (pos >= m_iLowerY + boundary); @@ -295,7 +295,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInZ(int32_t pos, int8_t boundary) const + bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperZ - boundary) && (pos >= m_iLowerZ + boundary); From 31b59702bea85d11ca554ddd28c244a60c898ef2 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Mon, 18 Nov 2013 16:57:37 +0100 Subject: [PATCH 028/259] We're committed to LargeVolume now, so we don't need the define to switch volume types. --- library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 24cb8217..4500207e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -117,11 +117,4 @@ freely, subject to the following restrictions: #define polyvox_shared_ptr boost::shared_ptr #endif -#define USE_LARGE_VOLUME -#ifdef USE_LARGE_VOLUME - #define POLYVOX_VOLUME LargeVolume -#else - #define POLYVOX_VOLUME SimpleVolume -#endif - #endif From 67ec0d2db81b426e3511242fbe62041d34aed3af Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 15:41:16 +0100 Subject: [PATCH 029/259] Initial function wrapper around CubicSurfaceExtractorWithNormals. --- examples/Basic/main.cpp | 7 +++++-- .../PolyVoxCore/CubicSurfaceExtractorWithNormals.h | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 64097731..65814645 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -81,11 +81,14 @@ int main(int argc, char *argv[]) SurfaceMesh mesh; //Create a surface extractor. Comment out one of the following two lines to decide which type gets created. - CubicSurfaceExtractorWithNormals< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); + //CubicSurfaceExtractorWithNormals< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); //MarchingCubesSurfaceExtractor< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); //Execute the surface extractor. - surfaceExtractor.execute(); + //surfaceExtractor.execute(); + + DefaultIsQuadNeeded< uint8_t > isQuadNeeded; + mesh = extractCubicSurfaceWithNormals< SimpleVolume, DefaultIsQuadNeeded< uint8_t > >(&volData, volData.getEnclosingRegion(), WrapModes::Border, 0, isQuadNeeded); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h index 211734f0..9fc44d7c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h @@ -63,6 +63,15 @@ namespace PolyVox WrapMode m_eWrapMode; typename VolumeType::VoxelType m_tBorderValue; }; + + template + SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, IsQuadNeeded isQuadNeeded) + { + SurfaceMesh result; + CubicSurfaceExtractorWithNormals extractor(volData, region, &result, eWrapMode, tBorderValue, isQuadNeeded); + extractor.execute(); + return result; + } } #include "PolyVoxCore/CubicSurfaceExtractorWithNormals.inl" From 0755961750fdf01d306a1382d76053fad768b88c Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 15:50:17 +0100 Subject: [PATCH 030/259] Added support for default parameters. --- examples/Basic/main.cpp | 4 ++-- .../include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 65814645..a7460ce1 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -87,8 +87,8 @@ int main(int argc, char *argv[]) //Execute the surface extractor. //surfaceExtractor.execute(); - DefaultIsQuadNeeded< uint8_t > isQuadNeeded; - mesh = extractCubicSurfaceWithNormals< SimpleVolume, DefaultIsQuadNeeded< uint8_t > >(&volData, volData.getEnclosingRegion(), WrapModes::Border, 0, isQuadNeeded); + //DefaultIsQuadNeeded< uint8_t > isQuadNeeded; + mesh = extractCubicSurfaceWithNormals< SimpleVolume >(&volData, volData.getEnclosingRegion()); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h index 9fc44d7c..ae605cd2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h @@ -72,6 +72,13 @@ namespace PolyVox extractor.execute(); return result; } + + template + SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) + { + DefaultIsQuadNeeded isQuadNeeded; + return extractCubicSurfaceWithNormals >(volData, region, eWrapMode, tBorderValue, isQuadNeeded); + } } #include "PolyVoxCore/CubicSurfaceExtractorWithNormals.inl" From 529e97f71edf21ecd90abb6445b4734de62be034 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 15:58:33 +0100 Subject: [PATCH 031/259] Added use of auto for determining mesh type. --- examples/Basic/main.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index a7460ce1..2e17d32a 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -77,18 +77,8 @@ int main(int argc, char *argv[]) SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); - //A mesh object to hold the result of surface extraction - SurfaceMesh mesh; - - //Create a surface extractor. Comment out one of the following two lines to decide which type gets created. - //CubicSurfaceExtractorWithNormals< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); - //MarchingCubesSurfaceExtractor< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); - - //Execute the surface extractor. - //surfaceExtractor.execute(); - - //DefaultIsQuadNeeded< uint8_t > isQuadNeeded; - mesh = extractCubicSurfaceWithNormals< SimpleVolume >(&volData, volData.getEnclosingRegion()); + // Extract the surface for the specified region of the volume. + auto mesh = extractCubicSurfaceWithNormals(&volData, volData.getEnclosingRegion()); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); From acbfb184b878aac4c4419064783909e1f6be6fbf Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 16:30:54 +0100 Subject: [PATCH 032/259] Wrapped MarchingCubesSurfaceExtractor with functions (part of unclassing). --- examples/Basic/main.cpp | 5 +++-- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 2e17d32a..4cd45bab 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -77,8 +77,9 @@ int main(int argc, char *argv[]) SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); - // Extract the surface for the specified region of the volume. - auto mesh = extractCubicSurfaceWithNormals(&volData, volData.getEnclosingRegion()); + // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. + //auto mesh = extractCubicSurfaceWithNormals(&volData, volData.getEnclosingRegion()); + auto mesh = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion()); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 31803437..2603641a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -210,6 +210,22 @@ namespace PolyVox //Our threshold value typename Controller::DensityType m_tThreshold; }; + + template< typename VolumeType, typename Controller> + SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + { + SurfaceMesh result; + MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); + extractor.execute(); + return result; + } + + template< typename VolumeType> + SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) + { + DefaultMarchingCubesController controller; + return extractMarchingCubesSurface(volData, region, eWrapMode, tBorderValue, controller); + } } #include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl" From d8bcd09d9b0a875a0f26eaee56fa25c5c8951e0a Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 16:47:51 +0100 Subject: [PATCH 033/259] Compile fixes for GCC. --- .../include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h | 6 ++++++ .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h index ae605cd2..2162b450 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h @@ -74,7 +74,13 @@ namespace PolyVox } template + // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template + // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? +#if defined(_MSC_VER) SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) +#else + SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) +#endif { DefaultIsQuadNeeded isQuadNeeded; return extractCubicSurfaceWithNormals >(volData, region, eWrapMode, tBorderValue, isQuadNeeded); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 2603641a..513b02e0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -221,7 +221,13 @@ namespace PolyVox } template< typename VolumeType> + // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template + // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? +#if defined(_MSC_VER) SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) +#else + SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) +#endif { DefaultMarchingCubesController controller; return extractMarchingCubesSurface(volData, region, eWrapMode, tBorderValue, controller); From 0bbb6489253f51dc7fa4a00b5836460e4b201750 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 7 Mar 2014 16:08:20 +0100 Subject: [PATCH 034/259] Added functions around CubicSurfaceExtractor. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 22 +++++++++++++++++++ tests/TestCubicSurfaceExtractor.cpp | 5 ++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index a225a3b5..443a2984 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -157,6 +157,28 @@ namespace PolyVox WrapMode m_eWrapMode; typename VolumeType::VoxelType m_tBorderValue; }; + + template + SurfaceMesh extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + { + SurfaceMesh result; + CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + extractor.execute(); + return result; + } + + template + // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template + // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? +#if defined(_MSC_VER) + SurfaceMesh extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) +#else + SurfaceMesh extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) +#endif + { + DefaultIsQuadNeeded isQuadNeeded; + return extractCubicSurface >(volData, region, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + } } #include "PolyVoxCore/CubicSurfaceExtractor.inl" diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 45919e85..319816d9 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -106,10 +106,9 @@ uint32_t testForType(void) { for (int32_t x = 0; x < uVolumeSideLength; x += uRegionSideLength) { - SurfaceMesh result; Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); - CubicSurfaceExtractor< SimpleVolume > extractor(&volData, regionToExtract, &result); - extractor.execute(); + + auto result = extractCubicSurface(&volData, regionToExtract); uTotalVertices += result.getNoOfVertices(); uTotalIndices += result.getNoOfIndices(); From e52e9e373e1a2c62158df3bd610ab9142b4bcb4e Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 7 Mar 2014 16:25:24 +0100 Subject: [PATCH 035/259] Switched test to use unclassed function. --- tests/TestVolumeSubclass.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 91a619b4..d4f20825 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -184,9 +184,7 @@ void TestVolumeSubclass::testExtractSurface() } } - SurfaceMesh result; - CubicSurfaceExtractor< VolumeSubclass > cubicSurfaceExtractor(&volumeSubclass, volumeSubclass.getEnclosingRegion(), &result); - cubicSurfaceExtractor.execute(); + auto result = extractCubicSurface(&volumeSubclass, volumeSubclass.getEnclosingRegion()); QCOMPARE(result.getNoOfVertices(), static_cast(8)); } From d06650172afa2e3a660046bea77a8fdd79fbff42 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 16 Mar 2014 21:13:15 +0100 Subject: [PATCH 036/259] Added missing header which was causing problems when compiling Cubiquity on Linux. --- library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 4d506d74..2239b267 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -21,6 +21,8 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ +#include "PolyVoxCore/Impl/Utility.h" + namespace PolyVox { template From 45302fde0260d1169a9fa827e050d2cb94fbf811 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Thu, 27 Mar 2014 10:24:29 +0000 Subject: [PATCH 037/259] Qt is not REQUIERD. This was causing errors. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef7af1f9..0a994624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,8 @@ IF(WIN32) ENDIF() # Qt is required for building the tests, the example and optionally for bundling the documentation -find_package(Qt5Test 5.2 REQUIRED) -find_package(Qt5OpenGL 5.2 REQUIRED) +find_package(Qt5Test 5.2) +find_package(Qt5OpenGL 5.2) set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") set_package_properties(Qt5Test PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) From fe3f2d589ed71fb26a4cfd19777d39cf7ae369cf Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 14 Apr 2014 21:08:05 +0200 Subject: [PATCH 038/259] Fixed uninitialized variables (was causing crash on OS X). --- examples/SmoothLOD/OpenGLWidget.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/SmoothLOD/OpenGLWidget.cpp b/examples/SmoothLOD/OpenGLWidget.cpp index 7c706648..9b016303 100644 --- a/examples/SmoothLOD/OpenGLWidget.cpp +++ b/examples/SmoothLOD/OpenGLWidget.cpp @@ -7,6 +7,15 @@ using namespace std; OpenGLWidget::OpenGLWidget(QWidget *parent) :QGLWidget(parent) + ,m_uBeginIndex(0) + ,m_uEndIndex(0) + ,indexBuffer(0) + ,vertexBuffer(0) + + ,m_uBeginIndexLow(0) + ,m_uEndIndexLow(0) + ,indexBufferLow(0) + ,vertexBufferLow(0) ,m_xRotation(0) ,m_yRotation(0) { From 2da902d5f95f959cfe9aa863040d3fa26d0aafa8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 5 May 2014 20:29:52 +0200 Subject: [PATCH 039/259] This change reverts PolyVox back to using Qt 4.8. This is expected to be a temporary change, required because moving to Qt 5 caused various complications on Windows which we are not yet ready to address. For more details see here: https://bitbucket.org/volumesoffun/polyvox/issue/41/upgrade-to-qt-5 --- CMakeLists.txt | 22 +++++++++------- examples/Basic/CMakeLists.txt | 6 +++-- examples/Basic/OpenGLWidget.cpp | 6 ++--- examples/Basic/OpenGLWidget.h | 4 +-- examples/OpenGL/CMakeLists.txt | 2 +- examples/Paging/CMakeLists.txt | 4 ++- examples/SmoothLOD/CMakeLists.txt | 4 ++- tests/CMakeLists.txt | 43 +++++++++++++++++-------------- 8 files changed, 52 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a994624..6691be4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,14 +43,18 @@ IF(WIN32) ENDIF() # Qt is required for building the tests, the example and optionally for bundling the documentation -find_package(Qt5Test 5.2) -find_package(Qt5OpenGL 5.2) +FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) +INCLUDE(${QT_USE_FILE}) +if(CMAKE_VERSION VERSION_LESS "2.8.6") + set_package_info(Doxygen "API documentation generator" http://www.doxygen.org "Building the API documentation") + set_package_info(Qt4 "C++ framework" http://qt-project.org "Building the examples and tests") +else() + set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") + set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) + set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") + set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") +endif() -set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") -set_package_properties(Qt5Test PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) -set_package_properties(Qt5Test PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") -set_package_properties(Qt5OpenGL PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) -set_package_properties(Qt5OpenGL PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW" ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode @@ -62,7 +66,7 @@ endif() ADD_SUBDIRECTORY(library) OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) -IF(ENABLE_EXAMPLES AND Qt5OpenGL_FOUND) +IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) ADD_SUBDIRECTORY(examples/common) ADD_SUBDIRECTORY(examples/Basic) ADD_SUBDIRECTORY(examples/Paging) @@ -77,7 +81,7 @@ ENDIF() INCLUDE(Packaging.cmake) OPTION(ENABLE_TESTS "Should the tests be built" ON) -IF(ENABLE_TESTS AND Qt5Test_FOUND) +IF(ENABLE_TESTS AND QT_QTTEST_FOUND) INCLUDE(CTest) MARK_AS_ADVANCED(FORCE BUILD_TESTING) ADD_SUBDIRECTORY(tests) diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index a7b81ff5..02e203d2 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -19,6 +19,8 @@ # 3. This notice may not be removed or altered from any source # distribution. +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + PROJECT(BasicExample) #Projects source files @@ -42,7 +44,7 @@ SOURCE_GROUP("Headers" FILES ${INC_FILES}) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) #Build @@ -50,7 +52,7 @@ ADD_EXECUTABLE(BasicExample ${SRC_FILES}) IF(MSVC) SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(BasicExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 5b93b08e..9b662fb2 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -2,7 +2,7 @@ #include #include -#include +//#include using namespace PolyVox; using namespace std; @@ -73,7 +73,7 @@ void OpenGLWidget::initializeGL() glDepthFunc(GL_LEQUAL); glDepthRange(0.0, 1.0); - if(!shader.addShaderFromSourceCode(QOpenGLShader::Vertex, R"( + if (!shader.addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 in vec4 position; //This will be the position of the vertex in model-space @@ -96,7 +96,7 @@ void OpenGLWidget::initializeGL() exit(EXIT_FAILURE); } - if(!shader.addShaderFromSourceCode(QOpenGLShader::Fragment, R"( + if (!shader.addShaderFromSourceCode(QGLShader::Fragment, R"( #version 130 in vec4 worldPosition; //Passed in from the vertex shader diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 1b201803..1126aba3 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -29,7 +29,7 @@ distribution. #include "glew/glew.h" #include -#include +#include class OpenGLWidget : public QGLWidget { @@ -57,7 +57,7 @@ private: GLuint vertexBuffer; GLuint vertexArrayObject; - QOpenGLShaderProgram shader; + QGLShaderProgram shader; //Mouse data QPoint m_LastFrameMousePos; diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 32709e81..5cd1ed55 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -60,7 +60,7 @@ ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) IF(MSVC) SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(OpenGLExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index 97cec53a..e8020b2d 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -19,6 +19,8 @@ # 3. This notice may not be removed or altered from any source # distribution. +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + PROJECT(PagingExample) #Projects source files @@ -52,7 +54,7 @@ ADD_EXECUTABLE(PagingExample ${SRC_FILES}) IF(MSVC) SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(PagingExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 9c5649fc..570cda55 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -19,6 +19,8 @@ # 3. This notice may not be removed or altered from any source # distribution. +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + PROJECT(SmoothLODExample) #Projects source files @@ -50,7 +52,7 @@ ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES}) IF(MSVC) SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings ENDIF(MSVC) -TARGET_LINK_LIBRARIES(SmoothLODExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6b06437b..fbffe9d9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,14 +24,12 @@ # # Also sets LATEST_TEST to point to the output executable of the test for easy # ADD_TEST()ing - -set(CMAKE_AUTOMOC TRUE) - -MACRO(CREATE_TEST sourcefile executablename) +MACRO(CREATE_TEST headerfile sourcefile executablename) UNSET(test_moc_SRCS) #clear out the MOCs from previous tests + QT4_WRAP_CPP(test_moc_SRCS ${headerfile}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR} ${PolyVoxUtil_BINARY_DIR}) ADD_EXECUTABLE(${executablename} ${sourcefile} ${test_moc_SRCS}) - TARGET_LINK_LIBRARIES(${executablename} PolyVoxCore PolyVoxUtil Qt5::Test) + TARGET_LINK_LIBRARIES(${executablename} PolyVoxCore PolyVoxUtil ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY}) #HACK. This is needed since everything is built in the base dir in Windows. As of 2.8 we should change this. IF(WIN32) SET(LATEST_TEST ${EXECUTABLE_OUTPUT_PATH}/${executablename}) @@ -48,17 +46,22 @@ MACRO(CREATE_TEST sourcefile executablename) ENDMACRO(CREATE_TEST) INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR}) +REMOVE_DEFINITIONS(-DQT_GUI_LIB) #Make sure the tests don't link to the QtGui # Test Template. Copy and paste this template for consistant naming. # # ClassName tests -# CREATE_TEST(TestClassName.cpp TestClassName) +# CREATE_TEST(TestClassName.h TestClassName.cpp TestClassName) # ADD_TEST(ClassNameFeature1Test ${LATEST_TEST} testFeature1) # ADD_TEST(ClassNameFeature2Test ${LATEST_TEST} testFeature2) # Python tests IF(BUILD_BINDINGS) FIND_PACKAGE(PythonInterp 3) - set_package_properties(PythonInterp PROPERTIES URL http://www.python.org DESCRIPTION "Python Interpereter" TYPE OPTIONAL PURPOSE "Running the Python tests") + IF(CMAKE_VERSION VERSION_LESS "2.8.6") + set_package_info(PythonInterp "Python Interpereter" http://www.python.org "Running the Python tests") + ELSE() + set_package_properties(PythonInterp PROPERTIES URL http://www.python.org DESCRIPTION "Python Interpereter" TYPE OPTIONAL PURPOSE "Running the Python tests") + ENDIF() IF(PYTHONINTERP_FOUND) ADD_TEST(PythonSurfaceExtractorTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/TestSurfaceExtractor.py) ADD_TEST(PythonRaycastTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/TestRaycast.py) @@ -66,38 +69,38 @@ IF(BUILD_BINDINGS) ENDIF() # AmbientOcclusionGenerator tests -CREATE_TEST(TestAmbientOcclusionGenerator.cpp TestAmbientOcclusionGenerator) +CREATE_TEST(TestAmbientOcclusionGenerator.h TestAmbientOcclusionGenerator.cpp TestAmbientOcclusionGenerator) # Array tests -CREATE_TEST(TestArray.cpp TestArray) +CREATE_TEST(TestArray.h TestArray.cpp TestArray) # AStarPathfinder tests -CREATE_TEST(TestAStarPathfinder.cpp TestAStarPathfinder) +CREATE_TEST(TestAStarPathfinder.h TestAStarPathfinder.cpp TestAStarPathfinder) -CREATE_TEST(TestCubicSurfaceExtractor.cpp TestCubicSurfaceExtractor) +CREATE_TEST(TestCubicSurfaceExtractor.h TestCubicSurfaceExtractor.cpp TestCubicSurfaceExtractor) # Low pass filter tests -CREATE_TEST(TestLowPassFilter.cpp TestLowPassFilter) +CREATE_TEST(TestLowPassFilter.h TestLowPassFilter.cpp TestLowPassFilter) # Material tests -CREATE_TEST(testmaterial.cpp testmaterial) +CREATE_TEST(testmaterial.h testmaterial.cpp testmaterial) # Raycast tests -CREATE_TEST(TestRaycast.cpp TestRaycast) +CREATE_TEST(TestRaycast.h TestRaycast.cpp TestRaycast) # Picking tests -CREATE_TEST(TestPicking.cpp TestPicking) +CREATE_TEST(TestPicking.h TestPicking.cpp TestPicking) # Region tests -CREATE_TEST(TestRegion.cpp TestRegion) +CREATE_TEST(TestRegion.h TestRegion.cpp TestRegion) -CREATE_TEST(TestSurfaceExtractor.cpp TestSurfaceExtractor) +CREATE_TEST(TestSurfaceExtractor.h TestSurfaceExtractor.cpp TestSurfaceExtractor) #Vector tests -CREATE_TEST(testvector.cpp testvector) +CREATE_TEST(testvector.h testvector.cpp testvector) # Volume tests -CREATE_TEST(testvolume.cpp testvolume) +CREATE_TEST(testvolume.h testvolume.cpp testvolume) # Volume subclass tests -CREATE_TEST(TestVolumeSubclass.cpp TestVolumeSubclass) +CREATE_TEST(TestVolumeSubclass.h TestVolumeSubclass.cpp TestVolumeSubclass) From 5dfa7e2562da59c3139d31f0450dd0013063f1a8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 5 May 2014 20:53:47 +0200 Subject: [PATCH 040/259] The CubicSurfaceExtractor now generates vertices of type PositionMaterialNormal rather than PositionMaterial. The normal property is just a dummy and is not filled in, though conceptually we could put something in there in the future (average normal of surrounding faces?) The point of this change is to move towards having a single vertex class with known properties (including normal). This makes it simpler to write code which uses the vertices because we always know which properties are present. This will probably be useful when working with vertex buffer objects. --- examples/Basic/OpenGLWidget.cpp | 6 +++--- examples/Basic/OpenGLWidget.h | 2 +- examples/Basic/main.cpp | 2 +- .../PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h | 6 +++--- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 4 ++-- tests/TestCubicSurfaceExtractor.cpp | 2 +- tests/TestVolumeSubclass.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 9b662fb2..d3bc72c0 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -14,7 +14,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -27,7 +27,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 9a3dac94..516fb9d4 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); //A mesh object to hold the result of surface extraction - SurfaceMesh mesh; + SurfaceMesh mesh; //Create a surface extractor. Comment out one of the following two lines to decide which type gets created. CubicSurfaceExtractor< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index a225a3b5..c3149de2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -113,9 +113,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif @@ -135,7 +135,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; + SurfaceMesh* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 3174c63f..e069cfbe 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -214,7 +214,7 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(static_cast(uX) - 0.5f, static_cast(uY) - 0.5f, static_cast(uZ) - 0.5f), uMaterialIn)); + rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 45919e85..8e184162 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -106,7 +106,7 @@ uint32_t testForType(void) { for (int32_t x = 0; x < uVolumeSideLength; x += uRegionSideLength) { - SurfaceMesh result; + SurfaceMesh result; Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); CubicSurfaceExtractor< SimpleVolume > extractor(&volData, regionToExtract, &result); extractor.execute(); diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 91a619b4..b9a71b6b 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -184,7 +184,7 @@ void TestVolumeSubclass::testExtractSurface() } } - SurfaceMesh result; + SurfaceMesh result; CubicSurfaceExtractor< VolumeSubclass > cubicSurfaceExtractor(&volumeSubclass, volumeSubclass.getEnclosingRegion(), &result); cubicSurfaceExtractor.execute(); From 12246d163312264988278fa08326ccd16d76ada3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 5 May 2014 20:58:35 +0200 Subject: [PATCH 041/259] The PositionMaterial class can now be removed as we're not using it. --- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 5 --- .../include/PolyVoxCore/VertexTypes.h | 21 ----------- library/PolyVoxCore/source/VertexTypes.cpp | 35 ------------------- 3 files changed, 61 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 702e786a..75df4b80 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -129,11 +129,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class Pager; - //////////////////////////////////////////////////////////////////////////////// - // PositionMaterial - //////////////////////////////////////////////////////////////////////////////// - class PositionMaterial; - //////////////////////////////////////////////////////////////////////////////// // PositionMaterialNormal //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 033fad6b..e743ed32 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -33,27 +33,6 @@ freely, subject to the following restrictions: namespace PolyVox { -#ifdef SWIG - class PositionMaterial -#else - class POLYVOX_API PositionMaterial -#endif - { - public: - PositionMaterial(); - PositionMaterial(Vector3DFloat positionToSet, float materialToSet); - - float getMaterial(void) const; - const Vector3DFloat& getPosition(void) const; - - void setMaterial(float materialToSet); - void setPosition(const Vector3DFloat& positionToSet); - public: - //Nicely fits into four floats. - Vector3DFloat position; - float material; - }; - #ifdef SWIG class PositionMaterialNormal #else diff --git a/library/PolyVoxCore/source/VertexTypes.cpp b/library/PolyVoxCore/source/VertexTypes.cpp index db41759e..dd043554 100644 --- a/library/PolyVoxCore/source/VertexTypes.cpp +++ b/library/PolyVoxCore/source/VertexTypes.cpp @@ -72,39 +72,4 @@ namespace PolyVox { position = positionToSet; } - - //////////////////////////////////////////////////////////////////////////////// - // PositionMaterial - //////////////////////////////////////////////////////////////////////////////// - - PositionMaterial::PositionMaterial() - { - } - - PositionMaterial::PositionMaterial(Vector3DFloat positionToSet, float materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - - } - - float PositionMaterial::getMaterial(void) const - { - return material; - } - - const Vector3DFloat& PositionMaterial::getPosition(void) const - { - return position; - } - - void PositionMaterial::setMaterial(float materialToSet) - { - material = materialToSet; - } - - void PositionMaterial::setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } } From 4c2aea3db10b278f17a66f1ee92d3117af6d8945 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 6 May 2014 22:00:24 +0200 Subject: [PATCH 042/259] Removed CubicSurfaceExtractorWithNornals. Going forward users will be expected to compute flat normals in the fragment shader. --- examples/Paging/OpenGLWidget.cpp | 8 +- examples/Paging/main.cpp | 4 +- library/PolyVoxCore/CMakeLists.txt | 2 - .../CubicSurfaceExtractorWithNormals.h | 70 --------- .../CubicSurfaceExtractorWithNormals.inl | 137 ------------------ 5 files changed, 6 insertions(+), 215 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl diff --git a/examples/Paging/OpenGLWidget.cpp b/examples/Paging/OpenGLWidget.cpp index 4347be2f..758bf56e 100644 --- a/examples/Paging/OpenGLWidget.cpp +++ b/examples/Paging/OpenGLWidget.cpp @@ -62,10 +62,10 @@ void OpenGLWidget::initializeGL() glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); - //Anable smooth lighting - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glShadeModel(GL_SMOOTH); + //Enable smooth lighting + //glEnable(GL_LIGHTING); + //glEnable(GL_LIGHT0); + //glShadeModel(GL_SMOOTH); //We'll be rendering with index/vertex arrays glEnableClientState(GL_VERTEX_ARRAY); diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 27236afd..b5df0e20 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -25,7 +25,7 @@ freely, subject to the following restrictions: #include "Perlin.h" #include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/CubicSurfaceExtractorWithNormals.h" +#include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/RLEBlockCompressor.h" @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) //Extract the surface SurfaceMesh mesh; - CubicSurfaceExtractorWithNormals< LargeVolume > surfaceExtractor(&volData, reg, &mesh); + CubicSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //CubicSurfaceExtractorWithNormals surfaceExtractor(&volData, reg, &mesh); surfaceExtractor.execute(); diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 0d07f2b8..e4289feb 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -48,8 +48,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/CompressedBlock.inl include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl - include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h - include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl include/PolyVoxCore/DefaultIsQuadNeeded.h include/PolyVoxCore/DefaultMarchingCubesController.h include/PolyVoxCore/Density.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h deleted file mode 100644 index 211734f0..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_CubicSurfaceExtractorWithNormals_H__ -#define __PolyVox_CubicSurfaceExtractorWithNormals_H__ - -#include "PolyVoxCore/DefaultIsQuadNeeded.h" - -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? -#include "PolyVoxCore/SurfaceMesh.h" - -namespace PolyVox -{ - template > - class CubicSurfaceExtractorWithNormals - { - public: - // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template - // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? -#if defined(_MSC_VER) - CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), IsQuadNeeded isQuadNeeded = IsQuadNeeded()); -#else - CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), IsQuadNeeded isQuadNeeded = IsQuadNeeded()); -#endif - - void execute(); - - private: - IsQuadNeeded m_funcIsQuadNeededCallback; - - //The volume data and a sampler to access it. - VolumeType* m_volData; - typename VolumeType::Sampler m_sampVolume; - - //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; - - //Information about the region we are currently processing - Region m_regSizeInVoxels; - - //The wrap mode - WrapMode m_eWrapMode; - typename VolumeType::VoxelType m_tBorderValue; - }; -} - -#include "PolyVoxCore/CubicSurfaceExtractorWithNormals.inl" - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl deleted file mode 100644 index bd8259c5..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Timer.h" - -namespace PolyVox -{ - template - CubicSurfaceExtractorWithNormals::CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, IsQuadNeeded isQuadNeeded) - :m_volData(volData) - ,m_sampVolume(volData) - ,m_meshCurrent(result) - ,m_regSizeInVoxels(region) - ,m_eWrapMode(eWrapMode) - ,m_tBorderValue(tBorderValue) - { - m_funcIsQuadNeededCallback = isQuadNeeded; - } - - template - void CubicSurfaceExtractorWithNormals::execute() - { - Timer timer; - m_meshCurrent->clear(); - - for(int32_t z = m_regSizeInVoxels.getLowerZ(); z < m_regSizeInVoxels.getUpperZ(); z++) - { - for(int32_t y = m_regSizeInVoxels.getLowerY(); y < m_regSizeInVoxels.getUpperY(); y++) - { - for(int32_t x = m_regSizeInVoxels.getLowerX(); x < m_regSizeInVoxels.getUpperX(); x++) - { - // these are always positive anyway - float regX = static_cast(x - m_regSizeInVoxels.getLowerX()); - float regY = static_cast(y - m_regSizeInVoxels.getLowerY()); - float regZ = static_cast(z - m_regSizeInVoxels.getLowerZ()); - - uint32_t material = 0; - - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x+1,y,z,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ - 0.5f), Vector3DFloat(1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(1.0f, 0.0f, 0.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v2,v1); - m_meshCurrent->addTriangleCubic(v1,v2,v3); - } - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x+1,y,z,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ - 0.5f), Vector3DFloat(-1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(-1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(-1.0f, 0.0f, 0.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(-1.0f, 0.0f, 0.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v1,v2); - m_meshCurrent->addTriangleCubic(v1,v3,v2); - } - - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x,y+1,z,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(0.0f, 1.0f, 0.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 1.0f, 0.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(0.0f, 1.0f, 0.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 1.0f, 0.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v1,v2); - m_meshCurrent->addTriangleCubic(v1,v3,v2); - } - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x,y+1,z,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(0.0f, -1.0f, 0.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, -1.0f, 0.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ - 0.5f), Vector3DFloat(0.0f, -1.0f, 0.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, -1.0f, 0.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v2,v1); - m_meshCurrent->addTriangleCubic(v1,v2,v3); - } - - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x,y,z+1,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, 1.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, 1.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, 1.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, 1.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v2,v1); - m_meshCurrent->addTriangleCubic(v1,v2,v3); - } - if(m_funcIsQuadNeededCallback(m_volData->getVoxel(x,y,z+1,m_eWrapMode,m_tBorderValue), m_volData->getVoxel(x,y,z,m_eWrapMode,m_tBorderValue), material)) - { - uint32_t v0 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, -1.0f), static_cast(material))); - uint32_t v1 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX - 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, -1.0f), static_cast(material))); - uint32_t v2 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY - 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, -1.0f), static_cast(material))); - uint32_t v3 = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(regX + 0.5f, regY + 0.5f, regZ + 0.5f), Vector3DFloat(0.0f, 0.0f, -1.0f), static_cast(material))); - - m_meshCurrent->addTriangleCubic(v0,v1,v2); - m_meshCurrent->addTriangleCubic(v1,v3,v2); - } - } - } - } - - m_meshCurrent->m_Region = m_regSizeInVoxels; - - m_meshCurrent->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); - m_meshCurrent->m_vecLodRecords.push_back(lodRecord); - - POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds() - << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() - << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); - } -} From b0a8ca8a640ef9491e121be53df71209b3302308 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 7 May 2014 23:47:18 +0200 Subject: [PATCH 043/259] This commit templatizes the vertex classes on voxel types. This was the main change which was made for Cubiquity and it's very messy at the moment. However, this will improve when we make more use of 'auto' to hide the template madness. --- examples/Basic/OpenGLWidget.cpp | 6 +- examples/Basic/OpenGLWidget.h | 2 +- examples/Basic/main.cpp | 2 +- .../OpenGL/OpenGLImmediateModeSupport.cpp | 10 +- examples/OpenGL/OpenGLImmediateModeSupport.h | 3 +- .../OpenGLVertexBufferObjectSupport.cpp | 12 +- .../OpenGL/OpenGLVertexBufferObjectSupport.h | 4 +- examples/OpenGL/OpenGLWidget.cpp | 4 +- examples/OpenGL/OpenGLWidget.h | 2 +- examples/Paging/OpenGLWidget.cpp | 12 +- examples/Paging/OpenGLWidget.h | 3 +- examples/Paging/main.cpp | 2 +- examples/SmoothLOD/OpenGLWidget.cpp | 20 +- examples/SmoothLOD/OpenGLWidget.h | 4 +- examples/SmoothLOD/main.cpp | 4 +- .../PolyVoxCore/CubicSurfaceExtractor.h | 10 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 12 +- .../include/PolyVoxCore/DefaultIsQuadNeeded.h | 102 +- .../DefaultMarchingCubesController.h | 6 +- .../MarchingCubesSurfaceExtractor.h | 6 +- .../MarchingCubesSurfaceExtractor.inl | 1256 ++++++++--------- .../include/PolyVoxCore/Material.h | 4 +- .../include/PolyVoxCore/MaterialDensityPair.h | 10 +- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- .../include/PolyVoxCore/VertexTypes.h | 99 +- library/PolyVoxCore/source/VertexTypes.cpp | 75 - tests/TestCubicSurfaceExtractor.cpp | 2 +- tests/TestSurfaceExtractor.cpp | 104 +- tests/TestVolumeSubclass.cpp | 2 +- 29 files changed, 898 insertions(+), 882 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index d3bc72c0..49c0f5c0 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -14,7 +14,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -27,7 +27,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &indexBuffer); @@ -36,7 +36,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) glBindVertexArray(0); diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index fab416e4..133c21eb 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -42,7 +42,7 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SurfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 516fb9d4..9ec7e3a1 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); //A mesh object to hold the result of surface extraction - SurfaceMesh mesh; + SurfaceMesh > mesh; //Create a surface extractor. Comment out one of the following two lines to decide which type gets created. CubicSurfaceExtractor< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp index c891008d..553203f4 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ b/examples/OpenGL/OpenGLImmediateModeSupport.cpp @@ -29,9 +29,9 @@ freely, subject to the following restrictions: using namespace PolyVox; using namespace std; -void renderRegionImmediateMode(PolyVox::SurfaceMesh& mesh, unsigned int uLodLevel) +void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel) { - const vector& vecVertices = mesh.getVertices(); + const vector >& vecVertices = mesh.getVertices(); const vector& vecIndices = mesh.getIndices(); int beginIndex = mesh.m_vecLodRecords[uLodLevel].beginIndex; @@ -41,7 +41,7 @@ void renderRegionImmediateMode(PolyVox::SurfaceMesh& mes //for(vector::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex) for(int index = beginIndex; index < endIndex; ++index) { - const PositionMaterialNormal& vertex = vecVertices[vecIndices[index]]; + const PositionMaterialNormal & vertex = vecVertices[vecIndices[index]]; const Vector3DFloat& v3dVertexPos = vertex.getPosition(); //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); @@ -49,7 +49,9 @@ void renderRegionImmediateMode(PolyVox::SurfaceMesh& mes - uint8_t material = static_cast(vertex.getMaterial() + 0.5); + //uint8_t material = static_cast(static_cast(vertex.getMaterial()) + 0.5); + uint8_t material = 1; + OpenGLColour colour = convertMaterialIDToColour(material); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.h b/examples/OpenGL/OpenGLImmediateModeSupport.h index f28baca0..671d53a5 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.h +++ b/examples/OpenGL/OpenGLImmediateModeSupport.h @@ -24,10 +24,11 @@ freely, subject to the following restrictions: #ifndef __OpenGLExample_OpenGLImmediateModeSupport_H__ #define __OpenGLExample_OpenGLImmediateModeSupport_H__ +#include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "glew/glew.h" -void renderRegionImmediateMode(PolyVox::SurfaceMesh& mesh, unsigned int uLodLevel); +void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLImmediateModeSupport_H__ diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp index 8dfb3351..066525a7 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp @@ -24,12 +24,13 @@ freely, subject to the following restrictions: #include "OpenGLSupport.h" #include "OpenGLVertexBufferObjectSupport.h" +#include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/SurfaceMesh.h" using namespace PolyVox; using namespace std; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh& mesh) +OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >& mesh) { //Represents our filled in OpenGL vertex and index buffer objects. OpenGLSurfaceMesh result; @@ -38,7 +39,7 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh& vecVertices = mesh.getVertices(); + const vector >& vecVertices = mesh.getVertices(); const vector& vecIndices = mesh.getIndices(); //If we have any indices... @@ -62,9 +63,9 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh::const_iterator iterVertex = vecVertices.begin(); iterVertex != vecVertices.end(); ++iterVertex) + for (vector >::const_iterator iterVertex = vecVertices.begin(); iterVertex != vecVertices.end(); ++iterVertex) { - const PositionMaterialNormal& vertex = *iterVertex; + const PositionMaterialNormal & vertex = *iterVertex; const Vector3DFloat& v3dVertexPos = vertex.getPosition(); //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); @@ -83,7 +84,8 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh(vertex.getMaterial() + 0.5); + //uint8_t material = static_cast(vertex.getMaterial() + 0.5); + uint8_t material = 1; OpenGLColour colour = convertMaterialIDToColour(material); diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h index 0bb91f72..73a361f5 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h @@ -33,10 +33,10 @@ struct OpenGLSurfaceMesh GLulong noOfIndices; GLuint indexBuffer; GLuint vertexBuffer; - const PolyVox::SurfaceMesh* sourceMesh; + const PolyVox::SurfaceMesh >* sourceMesh; }; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const PolyVox::SurfaceMesh& mesh); +OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const PolyVox::SurfaceMesh >& mesh); void renderRegionVertexBufferObject(const OpenGLSurfaceMesh& openGLSurfaceMesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLVertexBufferObjectSupport_H__ diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index beebc2eb..c761488b 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -87,7 +87,7 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume* volDat //Extract the surface for this region //extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent); - std::shared_ptr< SurfaceMesh > mesh(new SurfaceMesh); + std::shared_ptr< SurfaceMesh > > mesh(new SurfaceMesh >); MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get()); surfaceExtractor.execute(); @@ -193,7 +193,7 @@ void OpenGLWidget::paintGL() Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); if(m_mapSurfaceMeshes.find(v3dRegPos) != m_mapSurfaceMeshes.end()) { - std::shared_ptr< SurfaceMesh > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; + std::shared_ptr< SurfaceMesh > > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; unsigned int uLodLevel = 0; //meshCurrent->m_vecLodRecords.size() - 1; if(m_bUseOpenGLVertexBufferObjects) { diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h index ca475b3a..873a5605 100644 --- a/examples/OpenGL/OpenGLWidget.h +++ b/examples/OpenGL/OpenGLWidget.h @@ -88,7 +88,7 @@ class OpenGLWidget : public QGLWidget //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region std::map m_mapOpenGLSurfaceMeshes; - std::map >, Vector3DUint8Compare> m_mapSurfaceMeshes; + std::map > >, Vector3DUint8Compare> m_mapSurfaceMeshes; unsigned int m_uRegionSideLength; unsigned int m_uVolumeWidthInRegions; diff --git a/examples/Paging/OpenGLWidget.cpp b/examples/Paging/OpenGLWidget.cpp index 758bf56e..734ac02b 100644 --- a/examples/Paging/OpenGLWidget.cpp +++ b/examples/Paging/OpenGLWidget.cpp @@ -15,7 +15,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { if((surfaceMesh.getNoOfIndices() == 0) || (surfaceMesh.getNoOfVertices() == 0)) { @@ -25,7 +25,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& vecIndices = surfaceMesh.getIndices(); - const vector& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBuffer); @@ -37,7 +37,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); m_uBeginIndex = 0; m_uEndIndex = vecIndices.size(); @@ -69,7 +69,7 @@ void OpenGLWidget::initializeGL() //We'll be rendering with index/vertex arrays glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); + //glEnableClientState(GL_NORMAL_ARRAY); } void OpenGLWidget::resizeGL(int w, int h) @@ -109,8 +109,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); + //glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); } diff --git a/examples/Paging/OpenGLWidget.h b/examples/Paging/OpenGLWidget.h index 011b9734..1dcddd21 100644 --- a/examples/Paging/OpenGLWidget.h +++ b/examples/Paging/OpenGLWidget.h @@ -24,6 +24,7 @@ distribution. #ifndef __BasicExample_OpenGLWidget_H__ #define __BasicExample_OpenGLWidget_H__ +#include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/SurfaceMesh.h" #include "glew/glew.h" @@ -41,7 +42,7 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index b5df0e20..9a625a6e 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface - SurfaceMesh mesh; + SurfaceMesh > mesh; CubicSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //CubicSurfaceExtractorWithNormals surfaceExtractor(&volData, reg, &mesh); diff --git a/examples/SmoothLOD/OpenGLWidget.cpp b/examples/SmoothLOD/OpenGLWidget.cpp index 9b016303..812a287d 100644 --- a/examples/SmoothLOD/OpenGLWidget.cpp +++ b/examples/SmoothLOD/OpenGLWidget.cpp @@ -21,11 +21,11 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); - const vector& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBuffer); @@ -37,17 +37,17 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); m_uBeginIndex = 0; m_uEndIndex = vecIndices.size(); } -void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); - const vector& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBufferLow); @@ -59,7 +59,7 @@ void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); m_uBeginIndexLow = 0; m_uEndIndexLow = vecIndices.size(); @@ -152,8 +152,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); + glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); @@ -162,8 +162,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBufferLow); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); + glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndexLow, m_uEndIndexLow-1, m_uEndIndexLow - m_uBeginIndexLow, GL_UNSIGNED_INT, 0); diff --git a/examples/SmoothLOD/OpenGLWidget.h b/examples/SmoothLOD/OpenGLWidget.h index 059c369e..e92a812a 100644 --- a/examples/SmoothLOD/OpenGLWidget.h +++ b/examples/SmoothLOD/OpenGLWidget.h @@ -41,8 +41,8 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh); - void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 9b8f6f78..d42dd4a8 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -90,13 +90,13 @@ int main(int argc, char *argv[]) volumeResampler.execute(); //Extract the surface - SurfaceMesh meshLowLOD; + SurfaceMesh > meshLowLOD; MarchingCubesSurfaceExtractor< RawVolume > surfaceExtractor(&volDataLowLOD, volDataLowLOD.getEnclosingRegion(), &meshLowLOD); surfaceExtractor.execute(); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface - SurfaceMesh meshHighLOD; + SurfaceMesh > meshHighLOD; MarchingCubesSurfaceExtractor< SimpleVolume > surfaceExtractorHigh(&volData, PolyVox::Region(Vector3DInt32(30,0,0), Vector3DInt32(63, 63, 63)), &meshHighLOD); surfaceExtractorHigh.execute(); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index c3149de2..6ec45eeb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -82,7 +82,7 @@ namespace PolyVox struct IndexAndMaterial { int32_t iIndex; - int32_t uMaterial; //Should actually use the material type here, but this is ok for now. + typename VolumeType::VoxelType uMaterial; }; enum FaceNames @@ -113,16 +113,16 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif void execute(); private: - int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterial, Array<3, IndexAndMaterial>& existingVertices); + int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices); bool performQuadMerging(std::list& quads); bool mergeQuads(Quad& q1, Quad& q2); @@ -135,7 +135,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; + SurfaceMesh >* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index e069cfbe..03996a6b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -88,7 +88,7 @@ namespace PolyVox { uint32_t regX = x - m_regSizeInVoxels.getLowerX(); - uint32_t material; //Filled in by callback + typename VolumeType::VoxelType material; //Filled in by callback typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); @@ -205,7 +205,7 @@ namespace PolyVox } template - int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) + int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) { for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) { @@ -214,14 +214,14 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); + rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; } //If we have an existing vertex and the material matches then we can return it. - if(rEntry.uMaterial == static_cast(uMaterialIn)) + if(rEntry.uMaterial == uMaterialIn) { return rEntry.iIndex; } @@ -268,7 +268,7 @@ namespace PolyVox { //All four vertices of a given quad have the same material, //so just check that the first pair of vertices match. - if(std::abs(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() - m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) < 0.001) + if(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() == m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) { //Now check whether quad 2 is adjacent to quad one by comparing vertices. //Adjacent quads must share two vertices, and the second quad could be to the diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index fcaebe7b..c74f9b97 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -1,52 +1,52 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_DefaultIsQuadNeeded_H__ -#define __PolyVox_DefaultIsQuadNeeded_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - template - class DefaultIsQuadNeeded - { - public: - bool operator()(VoxelType back, VoxelType front, uint32_t& materialToUse) - { - if((back > 0) && (front == 0)) - { - materialToUse = static_cast(back); - return true; - } - else - { - return false; - } - } - }; -} - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_DefaultIsQuadNeeded_H__ +#define __PolyVox_DefaultIsQuadNeeded_H__ + +#include "PolyVoxCore/Impl/TypeDef.h" + +#include + +namespace PolyVox +{ + template + class DefaultIsQuadNeeded + { + public: + bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) + { + if((back > 0) && (front == 0)) + { + materialToUse = static_cast(back); + return true; + } + else + { + return false; + } + } + }; +} + #endif //__PolyVox_DefaultIsQuadNeeded_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index bd7adf5a..6a7aaa22 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -64,10 +64,8 @@ namespace PolyVox public: /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing densities. typedef VoxelType DensityType; - /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing materials. We're using a float here - /// because this implementation always returns a constant value off 1.0f. PolyVox also uses floats to store the materials in the mesh vertices - /// but this is not really desirable on modern hardware. We'll probably come back to material representation in the future. - typedef float MaterialType; + /// Used to inform the MarchingCubesSurfaceExtractor about which type it should use for representing materials. + typedef VoxelType MaterialType; /** * Constructor diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 31803437..b5a0b637 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -41,9 +41,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); #else - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); #endif void execute(); @@ -193,7 +193,7 @@ namespace PolyVox uint32_t m_uNoOfOccupiedCells; //The surface patch we are currently filling. - SurfaceMesh* m_meshCurrent; + SurfaceMesh >* m_meshCurrent; //Information about the region we are currently processing Region m_regSizeInVoxels; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 0ddc75f7..e4a58f41 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -1,628 +1,628 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Timer.h" - -namespace PolyVox -{ - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) - :m_volData(volData) - ,m_sampVolume(volData) - ,m_meshCurrent(result) - ,m_regSizeInVoxels(region) - ,m_controller(controller) - ,m_tThreshold(m_controller.getThreshold()) - { - //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); - m_regSizeInCells = m_regSizeInVoxels; - m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); - - m_sampVolume.setWrapMode(eWrapMode, tBorderValue); - } - - template - void MarchingCubesSurfaceExtractor::execute() - { - Timer timer; - m_meshCurrent->clear(); - - const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; - const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; - const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions - - //For edge indices - Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesZ(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesX(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); - - Array2DUint8 pPreviousBitmask(arraySizes); - Array2DUint8 pCurrentBitmask(arraySizes); - - //Create a region corresponding to the first slice - m_regSlicePrevious = m_regSizeInVoxels; - Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); - v3dUpperCorner.setZ(m_regSlicePrevious.getLowerZ()); //Set the upper z to the lower z to make it one slice thick. - m_regSlicePrevious.setUpperCorner(v3dUpperCorner); - m_regSliceCurrent = m_regSlicePrevious; - - uint32_t uNoOfNonEmptyCellsForSlice0 = 0; - uint32_t uNoOfNonEmptyCellsForSlice1 = 0; - - //Process the first slice (previous slice not available) - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - - //Process the other slices (previous slice is available) - for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ(); uSlice++) - { - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) - { - generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - } - - m_meshCurrent->m_Region = m_regSizeInVoxels; - - m_meshCurrent->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); - m_meshCurrent->m_vecLodRecords.push_back(lodRecord); - - POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds() - << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() - << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); - } - - template - template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) - { - m_uNoOfOccupiedCells = 0; - - const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperX(); - const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperY(); - - const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); - - //Process the lower left corner - int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); - int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); - - uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - - //Process the edge where x is minimal. - iXVolSpace = m_regSliceCurrent.getLowerX(); - m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerY(), iZVolSpace); - for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveY(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - - //Process the edge where y is minimal. - iYVolSpace = m_regSliceCurrent.getLowerY(); - m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - - //Process all remaining elemnents of the slice. In this case, previous x and y values are always available - for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - } - - return m_uNoOfOccupiedCells; - } - - template - template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) - { - uint8_t iCubeIndex = 0; - - typename VolumeType::VoxelType v000; - typename VolumeType::VoxelType v100; - typename VolumeType::VoxelType v010; - typename VolumeType::VoxelType v110; - typename VolumeType::VoxelType v001; - typename VolumeType::VoxelType v101; - typename VolumeType::VoxelType v011; - typename VolumeType::VoxelType v111; - - if(isPrevZAvail) - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 128; - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iPreviousCubeIndexZ >>= 4; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 160; //160 = 128+32 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; - iCubeIndex = iPreviousCubeIndexZ >> 4; - - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - else //previous Z not available - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v110 = m_sampVolume.peekVoxel1px1py0pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX; - - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v000 = m_sampVolume.getVoxel(); - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - - //Save the bitmask - pCurrentBitmask[uXRegSpace][uYRegSpace] = iCubeIndex; - - if(edgeTable[iCubeIndex] != 0) - { - ++m_uNoOfOccupiedCells; - } - } - - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, - Array2DInt32& m_pCurrentVertexIndicesX, - Array2DInt32& m_pCurrentVertexIndicesY, - Array2DInt32& m_pCurrentVertexIndicesZ) - { - const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); - - //Iterate over each cell in the region - for(int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); iYVolSpace <= m_regSliceCurrent.getUpperY(); iYVolSpace++) - { - const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - for(int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); iXVolSpace <= m_regSliceCurrent.getUpperX(); iXVolSpace++) - { - //Current position - const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - //Check whether the generated vertex will lie on the edge of the region - - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); - const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - m_sampVolume.movePositiveX(); - const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v100, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); - - Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); - - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeX(); - } - if (edgeTable[iCubeIndex] & 8) - { - m_sampVolume.movePositiveY(); - const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v010, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); - - Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); - - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); - - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeY(); - } - if (edgeTable[iCubeIndex] & 256) - { - m_sampVolume.movePositiveZ(); - const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v001, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); - - Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; - - m_sampVolume.moveNegativeZ(); - } - }//For each cell - } - } - - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, - const Array2DInt32& m_pPreviousVertexIndicesX, - const Array2DInt32& m_pPreviousVertexIndicesY, - const Array2DInt32& m_pPreviousVertexIndicesZ, - const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY) - { - int32_t indlist[12]; - for(int i = 0; i < 12; i++) - { - indlist[i] = -1; - } - - const int32_t iZVolSpace = m_regSlicePrevious.getLowerZ(); - - for(int32_t iYVolSpace = m_regSlicePrevious.getLowerY(); iYVolSpace <= m_regSizeInCells.getUpperY(); iYVolSpace++) - { - for(int32_t iXVolSpace = m_regSlicePrevious.getLowerX(); iXVolSpace <= m_regSizeInCells.getUpperX(); iXVolSpace++) - { - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - - //Current position - const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerX(); - const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - indlist[0] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 2) - { - indlist[1] = m_pPreviousVertexIndicesY[uXRegSpace+1][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 4) - { - indlist[2] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace+1]; - } - if (edgeTable[iCubeIndex] & 8) - { - indlist[3] = m_pPreviousVertexIndicesY[uXRegSpace][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 16) - { - indlist[4] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 32) - { - indlist[5] = m_pCurrentVertexIndicesY[uXRegSpace+1][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 64) - { - indlist[6] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace+1]; - } - if (edgeTable[iCubeIndex] & 128) - { - indlist[7] = m_pCurrentVertexIndicesY[uXRegSpace][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 256) - { - indlist[8] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 512) - { - indlist[9] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace]; - } - if (edgeTable[iCubeIndex] & 1024) - { - indlist[10] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace+1]; - } - if (edgeTable[iCubeIndex] & 2048) - { - indlist[11] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace+1]; - } - - for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) - { - const int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - const int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - const int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; - - if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) - { - m_meshCurrent->addTriangle(ind0, ind1, ind2); - } - }//For each triangle - }//For each cell - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/Timer.h" + +namespace PolyVox +{ + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + :m_volData(volData) + ,m_sampVolume(volData) + ,m_meshCurrent(result) + ,m_regSizeInVoxels(region) + ,m_controller(controller) + ,m_tThreshold(m_controller.getThreshold()) + { + //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); + m_regSizeInCells = m_regSizeInVoxels; + m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); + + m_sampVolume.setWrapMode(eWrapMode, tBorderValue); + } + + template + void MarchingCubesSurfaceExtractor::execute() + { + Timer timer; + m_meshCurrent->clear(); + + const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; + const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; + const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions + + //For edge indices + Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); + Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); + Array2DInt32 m_pPreviousVertexIndicesZ(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesX(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); + Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); + + Array2DUint8 pPreviousBitmask(arraySizes); + Array2DUint8 pCurrentBitmask(arraySizes); + + //Create a region corresponding to the first slice + m_regSlicePrevious = m_regSizeInVoxels; + Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); + v3dUpperCorner.setZ(m_regSlicePrevious.getLowerZ()); //Set the upper z to the lower z to make it one slice thick. + m_regSlicePrevious.setUpperCorner(v3dUpperCorner); + m_regSliceCurrent = m_regSlicePrevious; + + uint32_t uNoOfNonEmptyCellsForSlice0 = 0; + uint32_t uNoOfNonEmptyCellsForSlice1 = 0; + + //Process the first slice (previous slice not available) + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + + //Process the other slices (previous slice is available) + for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ(); uSlice++) + { + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) + { + generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + } + + m_meshCurrent->m_Region = m_regSizeInVoxels; + + m_meshCurrent->m_vecLodRecords.clear(); + LodRecord lodRecord; + lodRecord.beginIndex = 0; + lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); + m_meshCurrent->m_vecLodRecords.push_back(lodRecord); + + POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds() + << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() + << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); + } + + template + template + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + { + m_uNoOfOccupiedCells = 0; + + const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperX(); + const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperY(); + + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); + + //Process the lower left corner + int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); + int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); + + uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + + //Process the edge where x is minimal. + iXVolSpace = m_regSliceCurrent.getLowerX(); + m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerY(), iZVolSpace); + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveY(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + + //Process the edge where y is minimal. + iYVolSpace = m_regSliceCurrent.getLowerY(); + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + + //Process all remaining elemnents of the slice. In this case, previous x and y values are always available + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + } + + return m_uNoOfOccupiedCells; + } + + template + template + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + { + uint8_t iCubeIndex = 0; + + typename VolumeType::VoxelType v000; + typename VolumeType::VoxelType v100; + typename VolumeType::VoxelType v010; + typename VolumeType::VoxelType v110; + typename VolumeType::VoxelType v001; + typename VolumeType::VoxelType v101; + typename VolumeType::VoxelType v011; + typename VolumeType::VoxelType v111; + + if(isPrevZAvail) + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 128; + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iPreviousCubeIndexZ >>= 4; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 160; //160 = 128+32 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + iCubeIndex = iPreviousCubeIndexZ >> 4; + + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + else //previous Z not available + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v110 = m_sampVolume.peekVoxel1px1py0pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX; + + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v000 = m_sampVolume.getVoxel(); + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + + //Save the bitmask + pCurrentBitmask[uXRegSpace][uYRegSpace] = iCubeIndex; + + if(edgeTable[iCubeIndex] != 0) + { + ++m_uNoOfOccupiedCells; + } + } + + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + Array2DInt32& m_pCurrentVertexIndicesX, + Array2DInt32& m_pCurrentVertexIndicesY, + Array2DInt32& m_pCurrentVertexIndicesZ) + { + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); + + //Iterate over each cell in the region + for(int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); iYVolSpace <= m_regSliceCurrent.getUpperY(); iYVolSpace++) + { + const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + for(int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); iXVolSpace <= m_regSliceCurrent.getUpperX(); iXVolSpace++) + { + //Current position + const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + const uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + //Check whether the generated vertex will lie on the edge of the region + + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); + const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + m_sampVolume.movePositiveX(); + const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v100, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); + + Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); + + const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeX(); + } + if (edgeTable[iCubeIndex] & 8) + { + m_sampVolume.movePositiveY(); + const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v010, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); + + Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); + + PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeY(); + } + if (edgeTable[iCubeIndex] & 256) + { + m_sampVolume.movePositiveZ(); + const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v001, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); + + Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); + + const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + + m_sampVolume.moveNegativeZ(); + } + }//For each cell + } + } + + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + const Array2DInt32& m_pPreviousVertexIndicesX, + const Array2DInt32& m_pPreviousVertexIndicesY, + const Array2DInt32& m_pPreviousVertexIndicesZ, + const Array2DInt32& m_pCurrentVertexIndicesX, + const Array2DInt32& m_pCurrentVertexIndicesY) + { + int32_t indlist[12]; + for(int i = 0; i < 12; i++) + { + indlist[i] = -1; + } + + const int32_t iZVolSpace = m_regSlicePrevious.getLowerZ(); + + for(int32_t iYVolSpace = m_regSlicePrevious.getLowerY(); iYVolSpace <= m_regSizeInCells.getUpperY(); iYVolSpace++) + { + for(int32_t iXVolSpace = m_regSlicePrevious.getLowerX(); iXVolSpace <= m_regSizeInCells.getUpperX(); iXVolSpace++) + { + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + + //Current position + const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerX(); + const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + const uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + indlist[0] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 2) + { + indlist[1] = m_pPreviousVertexIndicesY[uXRegSpace+1][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 4) + { + indlist[2] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace+1]; + } + if (edgeTable[iCubeIndex] & 8) + { + indlist[3] = m_pPreviousVertexIndicesY[uXRegSpace][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 16) + { + indlist[4] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 32) + { + indlist[5] = m_pCurrentVertexIndicesY[uXRegSpace+1][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 64) + { + indlist[6] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace+1]; + } + if (edgeTable[iCubeIndex] & 128) + { + indlist[7] = m_pCurrentVertexIndicesY[uXRegSpace][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 256) + { + indlist[8] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 512) + { + indlist[9] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace]; + } + if (edgeTable[iCubeIndex] & 1024) + { + indlist[10] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace+1]; + } + if (edgeTable[iCubeIndex] & 2048) + { + indlist[11] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace+1]; + } + + for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) + { + const int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + const int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + const int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + + if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) + { + m_meshCurrent->addTriangle(ind0, ind1, ind2); + } + }//For each triangle + }//For each cell + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/library/PolyVoxCore/include/PolyVoxCore/Material.h index 86bfbc9a..1e4857c3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Material.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Material.h @@ -73,11 +73,11 @@ namespace PolyVox class DefaultIsQuadNeeded< Material > { public: - bool operator()(Material back, Material front, uint32_t& materialToUse) + bool operator()(Material back, Material front, Material& materialToUse) { if((back.getMaterial() > 0) && (front.getMaterial() == 0)) { - materialToUse = static_cast(back.getMaterial()); + materialToUse = back; return true; } else diff --git a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h index 0e5131fd..f8374d9d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h @@ -90,11 +90,11 @@ namespace PolyVox class DefaultIsQuadNeeded< MaterialDensityPair > { public: - bool operator()(MaterialDensityPair back, MaterialDensityPair front, uint32_t& materialToUse) + bool operator()(MaterialDensityPair back, MaterialDensityPair front, MaterialDensityPair& materialToUse) { if((back.getMaterial() > 0) && (front.getMaterial() == 0)) { - materialToUse = static_cast(back.getMaterial()); + materialToUse = back; return true; } else @@ -132,15 +132,15 @@ namespace PolyVox return voxel.getMaterial(); } - MaterialType blendMaterials(MaterialDensityPair a, MaterialDensityPair b, float /*weight*/) + MaterialDensityPair blendMaterials(MaterialDensityPair a, MaterialDensityPair b, float /*weight*/) { if(convertToDensity(a) > convertToDensity(b)) { - return convertToMaterial(a); + return a; } else { - return convertToMaterial(b); + return b; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 75df4b80..9af1a924 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -132,7 +132,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // PositionMaterialNormal //////////////////////////////////////////////////////////////////////////////// - class PositionMaterialNormal; + template class PositionMaterialNormal; //////////////////////////////////////////////////////////////////////////////// // RawVolume diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index e743ed32..3eb18072 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -33,31 +33,110 @@ freely, subject to the following restrictions: namespace PolyVox { +#ifdef SWIG + class PositionMaterial +#else + template + class POLYVOX_API PositionMaterial +#endif + { + public: + PositionMaterial() + { + } + + PositionMaterial(Vector3DFloat positionToSet, MaterialType materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + } + + MaterialType getMaterial(void) const + { + return material; + } + + const Vector3DFloat& getPosition(void) const + { + return position; + } + + void setMaterial(MaterialType materialToSet) + { + material = materialToSet; + } + + void setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } + public: + //Nicely fits into four floats. + Vector3DFloat position; + MaterialType material; + }; + #ifdef SWIG class PositionMaterialNormal #else + template class POLYVOX_API PositionMaterialNormal #endif { public: - PositionMaterialNormal(); - PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet); - PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet); + PositionMaterialNormal() + { + } - float getMaterial(void) const; - const Vector3DFloat& getNormal(void) const; - const Vector3DFloat& getPosition(void) const; + PositionMaterialNormal(Vector3DFloat positionToSet, MaterialType materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + } - void setMaterial(float materialToSet); - void setNormal(const Vector3DFloat& normalToSet); - void setPosition(const Vector3DFloat& positionToSet); + PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, MaterialType materialToSet) + :position(positionToSet) + ,normal(normalToSet) + ,material(materialToSet) + { + } + + MaterialType getMaterial(void) const + { + return material; + } + + const Vector3DFloat& getNormal(void) const + { + return normal; + } + + const Vector3DFloat& getPosition(void) const + { + return position; + } + + void setMaterial(MaterialType materialToSet) + { + material = materialToSet; + } + + void setNormal(const Vector3DFloat& normalToSet) + { + normal = normalToSet; + } + + void setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } public: //Nicely fits into seven floats, meaning we //can squeeze in one more for material blending. Vector3DFloat position; Vector3DFloat normal; - float material; //FIXME: This shouldn't be float on CPU? + MaterialType material; //FIXME: This shouldn't be float on CPU? }; } diff --git a/library/PolyVoxCore/source/VertexTypes.cpp b/library/PolyVoxCore/source/VertexTypes.cpp index dd043554..e69de29b 100644 --- a/library/PolyVoxCore/source/VertexTypes.cpp +++ b/library/PolyVoxCore/source/VertexTypes.cpp @@ -1,75 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/VertexTypes.h" - -namespace PolyVox -{ - PositionMaterialNormal::PositionMaterialNormal() - { - } - - PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - - } - - PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet) - :position(positionToSet) - ,normal(normalToSet) - ,material(materialToSet) - { - } - - float PositionMaterialNormal::getMaterial(void) const - { - return material; - } - - const Vector3DFloat& PositionMaterialNormal::getNormal(void) const - { - return normal; - } - - const Vector3DFloat& PositionMaterialNormal::getPosition(void) const - { - return position; - } - - void PositionMaterialNormal::setMaterial(float materialToSet) - { - material = materialToSet; - } - - void PositionMaterialNormal::setNormal(const Vector3DFloat& normalToSet) - { - normal = normalToSet; - } - - void PositionMaterialNormal::setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } -} diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 8e184162..ba04268a 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -106,7 +106,7 @@ uint32_t testForType(void) { for (int32_t x = 0; x < uVolumeSideLength; x += uRegionSideLength) { - SurfaceMesh result; + SurfaceMesh > result; Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); CubicSurfaceExtractor< SimpleVolume > extractor(&volData, regionToExtract, &result); extractor.execute(); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 796f3b2c..74030b07 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -102,7 +102,7 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) // Runs the surface extractor for a given type. template -void testForType(SurfaceMesh& result) +void testForType(SurfaceMesh >& result) { const int32_t uVolumeSideLength = 32; @@ -131,7 +131,7 @@ void testForType(SurfaceMesh& result) extractor.execute(); } -void testCustomController(SurfaceMesh& result) +void testCustomController(SurfaceMesh >& result) { const int32_t uVolumeSideLength = 32; @@ -163,66 +163,74 @@ void TestSurfaceExtractor::testExecute() const static float fExpectedMaterial = 42.0f; const static float fNoMaterial = 1.0f; - SurfaceMesh mesh; - + SurfaceMesh > int8Mesh; //Run the test for various voxel types. QBENCHMARK { - testForType(mesh); + testForType(int8Mesh); } - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + QCOMPARE(int8Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(int8Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(int8Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > uint8Mesh; + testForType(uint8Mesh); + QCOMPARE(uint8Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(uint8Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(uint8Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > int16Mesh; + testForType(int16Mesh); + QCOMPARE(int16Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(int16Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(int16Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > uint16Mesh; + testForType(uint16Mesh); + QCOMPARE(uint16Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(uint16Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(uint16Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > int32Mesh; + testForType(int32Mesh); + QCOMPARE(int32Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(int32Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(int32Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > uint32Mesh; + testForType(uint32Mesh); + QCOMPARE(uint32Mesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(uint32Mesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(uint32Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > floatMesh; + testForType(floatMesh); + QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > doubleMesh; + testForType(doubleMesh); + QCOMPARE(doubleMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(doubleMesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(doubleMesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + SurfaceMesh > densityMesh; + testForType(densityMesh); + QCOMPARE(densityMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(densityMesh.getNoOfIndices(), uExpectedIndices); + //QCOMPARE(densityMesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fExpectedMaterial); + SurfaceMesh > materialDensityMesh; + testForType(materialDensityMesh); + QCOMPARE(materialDensityMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(materialDensityMesh.getNoOfIndices(), uExpectedIndices); + //QCOMPARE(materialDensityMesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); //Test whether the CustomSurfaceExtractor works. - testCustomController(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); + testCustomController(floatMesh); + QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); } QTEST_MAIN(TestSurfaceExtractor) diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index b9a71b6b..87b57407 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -184,7 +184,7 @@ void TestVolumeSubclass::testExtractSurface() } } - SurfaceMesh result; + SurfaceMesh > result; CubicSurfaceExtractor< VolumeSubclass > cubicSurfaceExtractor(&volumeSubclass, volumeSubclass.getEnclosingRegion(), &result); cubicSurfaceExtractor.execute(); From ae87dbee7702ac45b6cee0d58c51f62e187f7cff Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 8 May 2014 16:40:27 +0200 Subject: [PATCH 044/259] Fixed materials in OpenGL example. --- examples/OpenGL/OpenGLImmediateModeSupport.cpp | 4 ++-- examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp index 553203f4..6c25b915 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ b/examples/OpenGL/OpenGLImmediateModeSupport.cpp @@ -49,8 +49,8 @@ void renderRegionImmediateMode(PolyVox::SurfaceMesh(static_cast(vertex.getMaterial()) + 0.5); - uint8_t material = 1; + uint8_t material = static_cast(static_cast(vertex.getMaterial().getMaterial()) + 0.5); + //uint8_t material = 1; OpenGLColour colour = convertMaterialIDToColour(material); diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp index 066525a7..7066523a 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp @@ -84,8 +84,8 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh(vertex.getMaterial() + 0.5); - uint8_t material = 1; + uint8_t material = static_cast(vertex.getMaterial().getMaterial() + 0.5); + //uint8_t material = 1; OpenGLColour colour = convertMaterialIDToColour(material); From 573c36db871f678b6c15bea07495129197dc1f86 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 11 May 2014 15:17:59 +0200 Subject: [PATCH 045/259] Renamed vertex classes to the far more meaningful 'CubicVertex' and 'MarchingCubesVertex'. The old names didn't make much sense, even less so now they are templatized. --- examples/Basic/OpenGLWidget.cpp | 6 +- examples/Basic/OpenGLWidget.h | 2 +- examples/Basic/main.cpp | 2 +- .../OpenGL/OpenGLImmediateModeSupport.cpp | 6 +- examples/OpenGL/OpenGLImmediateModeSupport.h | 2 +- .../OpenGLVertexBufferObjectSupport.cpp | 8 +- .../OpenGL/OpenGLVertexBufferObjectSupport.h | 4 +- examples/OpenGL/OpenGLWidget.cpp | 4 +- examples/OpenGL/OpenGLWidget.h | 2 +- examples/Paging/OpenGLWidget.cpp | 10 +- examples/Paging/OpenGLWidget.h | 2 +- examples/Paging/main.cpp | 2 +- examples/SmoothLOD/OpenGLWidget.cpp | 20 +-- examples/SmoothLOD/OpenGLWidget.h | 4 +- examples/SmoothLOD/main.cpp | 4 +- .../PolyVoxCore/CubicSurfaceExtractor.h | 6 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 4 +- .../MarchingCubesSurfaceExtractor.h | 6 +- .../MarchingCubesSurfaceExtractor.inl | 8 +- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 15 ++- .../include/PolyVoxCore/VertexTypes.h | 126 ++++++++++-------- tests/TestCubicSurfaceExtractor.cpp | 4 +- tests/TestSurfaceExtractor.cpp | 24 ++-- tests/TestVolumeSubclass.cpp | 2 +- 24 files changed, 147 insertions(+), 126 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 49c0f5c0..a3f6ad96 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -14,7 +14,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -27,7 +27,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &indexBuffer); @@ -36,7 +36,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) glBindVertexArray(0); diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 133c21eb..a7cac3ca 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -42,7 +42,7 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SurfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 9ec7e3a1..c66067df 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); //A mesh object to hold the result of surface extraction - SurfaceMesh > mesh; + SurfaceMesh > mesh; //Create a surface extractor. Comment out one of the following two lines to decide which type gets created. CubicSurfaceExtractor< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp index 6c25b915..7aff64df 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ b/examples/OpenGL/OpenGLImmediateModeSupport.cpp @@ -29,9 +29,9 @@ freely, subject to the following restrictions: using namespace PolyVox; using namespace std; -void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel) +void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel) { - const vector >& vecVertices = mesh.getVertices(); + const vector >& vecVertices = mesh.getVertices(); const vector& vecIndices = mesh.getIndices(); int beginIndex = mesh.m_vecLodRecords[uLodLevel].beginIndex; @@ -41,7 +41,7 @@ void renderRegionImmediateMode(PolyVox::SurfaceMesh::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex) for(int index = beginIndex; index < endIndex; ++index) { - const PositionMaterialNormal & vertex = vecVertices[vecIndices[index]]; + const MarchingCubesVertex & vertex = vecVertices[vecIndices[index]]; const Vector3DFloat& v3dVertexPos = vertex.getPosition(); //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.h b/examples/OpenGL/OpenGLImmediateModeSupport.h index 671d53a5..9f5aea79 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.h +++ b/examples/OpenGL/OpenGLImmediateModeSupport.h @@ -29,6 +29,6 @@ freely, subject to the following restrictions: #include "glew/glew.h" -void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel); +void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLImmediateModeSupport_H__ diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp index 7066523a..ae5afd15 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp @@ -30,7 +30,7 @@ freely, subject to the following restrictions: using namespace PolyVox; using namespace std; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >& mesh) +OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >& mesh) { //Represents our filled in OpenGL vertex and index buffer objects. OpenGLSurfaceMesh result; @@ -39,7 +39,7 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >& vecVertices = mesh.getVertices(); + const vector >& vecVertices = mesh.getVertices(); const vector& vecIndices = mesh.getIndices(); //If we have any indices... @@ -63,9 +63,9 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >::const_iterator iterVertex = vecVertices.begin(); iterVertex != vecVertices.end(); ++iterVertex) + for (vector >::const_iterator iterVertex = vecVertices.begin(); iterVertex != vecVertices.end(); ++iterVertex) { - const PositionMaterialNormal & vertex = *iterVertex; + const MarchingCubesVertex & vertex = *iterVertex; const Vector3DFloat& v3dVertexPos = vertex.getPosition(); //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h index 73a361f5..fc97dfb8 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h @@ -33,10 +33,10 @@ struct OpenGLSurfaceMesh GLulong noOfIndices; GLuint indexBuffer; GLuint vertexBuffer; - const PolyVox::SurfaceMesh >* sourceMesh; + const PolyVox::SurfaceMesh >* sourceMesh; }; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const PolyVox::SurfaceMesh >& mesh); +OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const PolyVox::SurfaceMesh >& mesh); void renderRegionVertexBufferObject(const OpenGLSurfaceMesh& openGLSurfaceMesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLVertexBufferObjectSupport_H__ diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index c761488b..475ba846 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -87,7 +87,7 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume* volDat //Extract the surface for this region //extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent); - std::shared_ptr< SurfaceMesh > > mesh(new SurfaceMesh >); + std::shared_ptr< SurfaceMesh > > mesh(new SurfaceMesh >); MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get()); surfaceExtractor.execute(); @@ -193,7 +193,7 @@ void OpenGLWidget::paintGL() Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); if(m_mapSurfaceMeshes.find(v3dRegPos) != m_mapSurfaceMeshes.end()) { - std::shared_ptr< SurfaceMesh > > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; + std::shared_ptr< SurfaceMesh > > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; unsigned int uLodLevel = 0; //meshCurrent->m_vecLodRecords.size() - 1; if(m_bUseOpenGLVertexBufferObjects) { diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h index 873a5605..1b4b4612 100644 --- a/examples/OpenGL/OpenGLWidget.h +++ b/examples/OpenGL/OpenGLWidget.h @@ -88,7 +88,7 @@ class OpenGLWidget : public QGLWidget //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region std::map m_mapOpenGLSurfaceMeshes; - std::map > >, Vector3DUint8Compare> m_mapSurfaceMeshes; + std::map > >, Vector3DUint8Compare> m_mapSurfaceMeshes; unsigned int m_uRegionSideLength; unsigned int m_uVolumeWidthInRegions; diff --git a/examples/Paging/OpenGLWidget.cpp b/examples/Paging/OpenGLWidget.cpp index 734ac02b..0227a66f 100644 --- a/examples/Paging/OpenGLWidget.cpp +++ b/examples/Paging/OpenGLWidget.cpp @@ -15,7 +15,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { if((surfaceMesh.getNoOfIndices() == 0) || (surfaceMesh.getNoOfVertices() == 0)) { @@ -25,7 +25,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBuffer); @@ -37,7 +37,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), pVertices, GL_STATIC_DRAW); m_uBeginIndex = 0; m_uEndIndex = vecIndices.size(); @@ -109,8 +109,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - //glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(CubicVertex), 0); + //glNormalPointer(GL_FLOAT, sizeof(CubicVertex), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); } diff --git a/examples/Paging/OpenGLWidget.h b/examples/Paging/OpenGLWidget.h index 1dcddd21..61702be1 100644 --- a/examples/Paging/OpenGLWidget.h +++ b/examples/Paging/OpenGLWidget.h @@ -42,7 +42,7 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 9a625a6e..c1879427 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface - SurfaceMesh > mesh; + SurfaceMesh > mesh; CubicSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); //CubicSurfaceExtractorWithNormals surfaceExtractor(&volData, reg, &mesh); diff --git a/examples/SmoothLOD/OpenGLWidget.cpp b/examples/SmoothLOD/OpenGLWidget.cpp index 812a287d..e804240b 100644 --- a/examples/SmoothLOD/OpenGLWidget.cpp +++ b/examples/SmoothLOD/OpenGLWidget.cpp @@ -21,11 +21,11 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBuffer); @@ -37,17 +37,17 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex), pVertices, GL_STATIC_DRAW); m_uBeginIndex = 0; m_uEndIndex = vecIndices.size(); } -void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); + const vector >& vecVertices = surfaceMesh.getVertices(); //Build an OpenGL index buffer glGenBuffers(1, &indexBufferLow); @@ -59,7 +59,7 @@ void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex), pVertices, GL_STATIC_DRAW); m_uBeginIndexLow = 0; m_uEndIndexLow = vecIndices.size(); @@ -152,8 +152,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(MarchingCubesVertex), 0); + glNormalPointer(GL_FLOAT, sizeof(MarchingCubesVertex), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); @@ -162,8 +162,8 @@ void OpenGLWidget::paintGL() //Bind the vertex buffer glBindBuffer(GL_ARRAY_BUFFER, vertexBufferLow); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + glVertexPointer(3, GL_FLOAT, sizeof(MarchingCubesVertex), 0); + glNormalPointer(GL_FLOAT, sizeof(MarchingCubesVertex), (GLvoid*)12); glDrawRangeElements(GL_TRIANGLES, m_uBeginIndexLow, m_uEndIndexLow-1, m_uEndIndexLow - m_uBeginIndexLow, GL_UNSIGNED_INT, 0); diff --git a/examples/SmoothLOD/OpenGLWidget.h b/examples/SmoothLOD/OpenGLWidget.h index e92a812a..895e9e74 100644 --- a/examples/SmoothLOD/OpenGLWidget.h +++ b/examples/SmoothLOD/OpenGLWidget.h @@ -41,8 +41,8 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); - void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh); + void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index d42dd4a8..29e9cd25 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -90,13 +90,13 @@ int main(int argc, char *argv[]) volumeResampler.execute(); //Extract the surface - SurfaceMesh > meshLowLOD; + SurfaceMesh > meshLowLOD; MarchingCubesSurfaceExtractor< RawVolume > surfaceExtractor(&volDataLowLOD, volDataLowLOD.getEnclosingRegion(), &meshLowLOD); surfaceExtractor.execute(); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface - SurfaceMesh > meshHighLOD; + SurfaceMesh > meshHighLOD; MarchingCubesSurfaceExtractor< SimpleVolume > surfaceExtractorHigh(&volData, PolyVox::Region(Vector3DInt32(30,0,0), Vector3DInt32(63, 63, 63)), &meshHighLOD); surfaceExtractorHigh.execute(); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 6ec45eeb..bb349641 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -113,9 +113,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif @@ -135,7 +135,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + SurfaceMesh >* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 03996a6b..822b9256 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -214,7 +214,7 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterialNormal(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); + rEntry.iIndex = m_meshCurrent->addVertex(CubicVertex(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index b5a0b637..87c7df13 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -41,9 +41,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); #else - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); #endif void execute(); @@ -193,7 +193,7 @@ namespace PolyVox uint32_t m_uNoOfOccupiedCells; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + SurfaceMesh >* m_meshCurrent; //Information about the region we are currently processing Region m_regSizeInVoxels; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index e4a58f41..535060bb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -459,7 +459,7 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -488,7 +488,7 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); - PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -516,7 +516,7 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 9af1a924..0d68b3e9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -78,6 +78,11 @@ namespace PolyVox template class DefaultIsQuadNeeded; template > class CubicSurfaceExtractor; + //////////////////////////////////////////////////////////////////////////////// + // CubicVertex + //////////////////////////////////////////////////////////////////////////////// + template class CubicVertex; + //////////////////////////////////////////////////////////////////////////////// // Density //////////////////////////////////////////////////////////////////////////////// @@ -103,6 +108,11 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class LargeVolume; + //////////////////////////////////////////////////////////////////////////////// + // MarchingCubesVertex + //////////////////////////////////////////////////////////////////////////////// + template class MarchingCubesVertex; + //////////////////////////////////////////////////////////////////////////////// // Material //////////////////////////////////////////////////////////////////////////////// @@ -129,11 +139,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class Pager; - //////////////////////////////////////////////////////////////////////////////// - // PositionMaterialNormal - //////////////////////////////////////////////////////////////////////////////// - template class PositionMaterialNormal; - //////////////////////////////////////////////////////////////////////////////// // RawVolume //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 3eb18072..a5a24d79 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -34,74 +34,31 @@ freely, subject to the following restrictions: namespace PolyVox { #ifdef SWIG - class PositionMaterial + class CubicVertex #else - template - class POLYVOX_API PositionMaterial + template + class POLYVOX_API CubicVertex #endif { public: - PositionMaterial() + CubicVertex() { } - PositionMaterial(Vector3DFloat positionToSet, MaterialType materialToSet) + CubicVertex(Vector3DFloat positionToSet, VoxelType materialToSet) :position(positionToSet) ,material(materialToSet) { } - MaterialType getMaterial(void) const - { - return material; - } - - const Vector3DFloat& getPosition(void) const - { - return position; - } - - void setMaterial(MaterialType materialToSet) - { - material = materialToSet; - } - - void setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } - public: - //Nicely fits into four floats. - Vector3DFloat position; - MaterialType material; - }; - -#ifdef SWIG - class PositionMaterialNormal -#else - template - class POLYVOX_API PositionMaterialNormal -#endif - { - public: - PositionMaterialNormal() - { - } - - PositionMaterialNormal(Vector3DFloat positionToSet, MaterialType materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - } - - PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, MaterialType materialToSet) + CubicVertex(Vector3DFloat positionToSet, Vector3DFloat normalToSet, VoxelType materialToSet) :position(positionToSet) ,normal(normalToSet) ,material(materialToSet) { } - MaterialType getMaterial(void) const + VoxelType getMaterial(void) const { return material; } @@ -116,7 +73,7 @@ namespace PolyVox return position; } - void setMaterial(MaterialType materialToSet) + void setMaterial(VoxelType materialToSet) { material = materialToSet; } @@ -131,12 +88,71 @@ namespace PolyVox position = positionToSet; } - public: - //Nicely fits into seven floats, meaning we - //can squeeze in one more for material blending. + public: Vector3DFloat position; Vector3DFloat normal; - MaterialType material; //FIXME: This shouldn't be float on CPU? + VoxelType material; + }; + +#ifdef SWIG + class MarchingCubesVertex +#else + template + class POLYVOX_API MarchingCubesVertex +#endif + { + public: + MarchingCubesVertex() + { + } + + MarchingCubesVertex(Vector3DFloat positionToSet, VoxelType materialToSet) + :position(positionToSet) + , material(materialToSet) + { + } + + MarchingCubesVertex(Vector3DFloat positionToSet, Vector3DFloat normalToSet, VoxelType materialToSet) + :position(positionToSet) + , normal(normalToSet) + , material(materialToSet) + { + } + + VoxelType getMaterial(void) const + { + return material; + } + + const Vector3DFloat& getNormal(void) const + { + return normal; + } + + const Vector3DFloat& getPosition(void) const + { + return position; + } + + void setMaterial(VoxelType materialToSet) + { + material = materialToSet; + } + + void setNormal(const Vector3DFloat& normalToSet) + { + normal = normalToSet; + } + + void setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } + + public: + Vector3DFloat position; + Vector3DFloat normal; + VoxelType material; }; } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index ba04268a..7dc85571 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -106,7 +106,7 @@ uint32_t testForType(void) { for (int32_t x = 0; x < uVolumeSideLength; x += uRegionSideLength) { - SurfaceMesh > result; + SurfaceMesh > result; Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); CubicSurfaceExtractor< SimpleVolume > extractor(&volData, regionToExtract, &result); extractor.execute(); @@ -131,7 +131,7 @@ void TestCubicSurfaceExtractor::testExecute() const static uint32_t uIndexToCheck = 2000; const static uint32_t uExpectedIndex = 1334; - SurfaceMesh mesh;*/ + SurfaceMesh mesh;*/ /*testForType(mesh); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 74030b07..81610212 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -102,7 +102,7 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) // Runs the surface extractor for a given type. template -void testForType(SurfaceMesh >& result) +void testForType(SurfaceMesh >& result) { const int32_t uVolumeSideLength = 32; @@ -131,7 +131,7 @@ void testForType(SurfaceMesh >& result) extractor.execute(); } -void testCustomController(SurfaceMesh >& result) +void testCustomController(SurfaceMesh >& result) { const int32_t uVolumeSideLength = 32; @@ -163,7 +163,7 @@ void TestSurfaceExtractor::testExecute() const static float fExpectedMaterial = 42.0f; const static float fNoMaterial = 1.0f; - SurfaceMesh > int8Mesh; + SurfaceMesh > int8Mesh; //Run the test for various voxel types. QBENCHMARK { testForType(int8Mesh); @@ -172,55 +172,55 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(int8Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(int8Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > uint8Mesh; + SurfaceMesh > uint8Mesh; testForType(uint8Mesh); QCOMPARE(uint8Mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(uint8Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(uint8Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > int16Mesh; + SurfaceMesh > int16Mesh; testForType(int16Mesh); QCOMPARE(int16Mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(int16Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(int16Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > uint16Mesh; + SurfaceMesh > uint16Mesh; testForType(uint16Mesh); QCOMPARE(uint16Mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(uint16Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(uint16Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > int32Mesh; + SurfaceMesh > int32Mesh; testForType(int32Mesh); QCOMPARE(int32Mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(int32Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(int32Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > uint32Mesh; + SurfaceMesh > uint32Mesh; testForType(uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(uint32Mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(uint32Mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > floatMesh; + SurfaceMesh > floatMesh; testForType(floatMesh); QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - SurfaceMesh > doubleMesh; + SurfaceMesh > doubleMesh; testForType(doubleMesh); QCOMPARE(doubleMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(doubleMesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(doubleMesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > densityMesh; + SurfaceMesh > densityMesh; testForType(densityMesh); QCOMPARE(densityMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(densityMesh.getNoOfIndices(), uExpectedIndices); //QCOMPARE(densityMesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); - SurfaceMesh > materialDensityMesh; + SurfaceMesh > materialDensityMesh; testForType(materialDensityMesh); QCOMPARE(materialDensityMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(materialDensityMesh.getNoOfIndices(), uExpectedIndices); diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 87b57407..98bbe8c4 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -184,7 +184,7 @@ void TestVolumeSubclass::testExtractSurface() } } - SurfaceMesh > result; + SurfaceMesh > result; CubicSurfaceExtractor< VolumeSubclass > cubicSurfaceExtractor(&volumeSubclass, volumeSubclass.getEnclosingRegion(), &result); cubicSurfaceExtractor.execute(); From 347028199c4fe65ca41904b27327d3f173b3eb04 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 11 May 2014 16:27:38 +0200 Subject: [PATCH 046/259] Paging example now also uses free-function surface extractor. --- examples/Paging/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 27236afd..64b2e9c6 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -186,11 +186,7 @@ int main(int argc, char *argv[]) std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface - SurfaceMesh mesh; - CubicSurfaceExtractorWithNormals< LargeVolume > surfaceExtractor(&volData, reg, &mesh); - //MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(&volData, reg, &mesh); - //CubicSurfaceExtractorWithNormals surfaceExtractor(&volData, reg, &mesh); - surfaceExtractor.execute(); + auto mesh = extractMarchingCubesSurface(&volData, reg); std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; //Pass the surface to the OpenGL window From 95a3e2e9ce18ef4693529d076ef512e1741bacea Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 11 May 2014 16:29:51 +0200 Subject: [PATCH 047/259] Smooth LOD example now uses free function surface extractor. --- examples/SmoothLOD/main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 9b8f6f78..ba6a9f03 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -90,15 +90,11 @@ int main(int argc, char *argv[]) volumeResampler.execute(); //Extract the surface - SurfaceMesh meshLowLOD; - MarchingCubesSurfaceExtractor< RawVolume > surfaceExtractor(&volDataLowLOD, volDataLowLOD.getEnclosingRegion(), &meshLowLOD); - surfaceExtractor.execute(); + auto meshLowLOD = extractMarchingCubesSurface(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface - SurfaceMesh meshHighLOD; - MarchingCubesSurfaceExtractor< SimpleVolume > surfaceExtractorHigh(&volData, PolyVox::Region(Vector3DInt32(30,0,0), Vector3DInt32(63, 63, 63)), &meshHighLOD); - surfaceExtractorHigh.execute(); + auto meshHighLOD = extractMarchingCubesSurface(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); //Pass the surface to the OpenGL window From 217aa937208b5b0871cc80c04116e2067f528006 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 11 May 2014 16:41:52 +0200 Subject: [PATCH 048/259] Test now uses free-function surface extractor. --- tests/TestSurfaceExtractor.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 796f3b2c..ac146751 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -102,7 +102,7 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) // Runs the surface extractor for a given type. template -void testForType(SurfaceMesh& result) +SurfaceMesh testForType(void) //I think we could avoid specifying this return type by using auto/decltype? { const int32_t uVolumeSideLength = 32; @@ -127,8 +127,10 @@ void testForType(SurfaceMesh& result) DefaultMarchingCubesController controller; controller.setThreshold(50); - MarchingCubesSurfaceExtractor< SimpleVolume > extractor(&volData, volData.getEnclosingRegion(), &result, WrapModes::Border, VoxelType(), controller); - extractor.execute(); + + auto result = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); + + return result; } void testCustomController(SurfaceMesh& result) @@ -167,53 +169,53 @@ void TestSurfaceExtractor::testExecute() //Run the test for various voxel types. QBENCHMARK { - testForType(mesh); + mesh = testForType(); } QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - testForType(mesh); + mesh = testForType(); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fExpectedMaterial); From a34c1063824e18e5d93bf4b3274b24c570603118 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 11 May 2014 20:34:41 +0200 Subject: [PATCH 049/259] I accidentally merged the 'cubiquity-version' feature back into develop. It seems I can't simply reverse this commit (at least through SourceTree ) because it was a merge, so I'm having to simply revert the contents of the commit (i.e. the files). Bit of a mess! --- .../PolyVoxCore/CubicSurfaceExtractor.h | 10 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 12 +-- .../MarchingCubesSurfaceExtractor.h | 6 +- .../MarchingCubesSurfaceExtractor.inl | 10 +- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 4 +- .../include/PolyVoxCore/UncompressedBlock.inl | 2 - .../include/PolyVoxCore/VertexTypes.h | 92 ++++--------------- library/PolyVoxCore/source/VertexTypes.cpp | 77 ++++++++++++++++ 8 files changed, 115 insertions(+), 98 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 86e04020..a225a3b5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -82,7 +82,7 @@ namespace PolyVox struct IndexAndMaterial { int32_t iIndex; - typename VolumeType::VoxelType uMaterial; + int32_t uMaterial; //Should actually use the material type here, but this is ok for now. }; enum FaceNames @@ -113,16 +113,16 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif void execute(); private: - int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices); + int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterial, Array<3, IndexAndMaterial>& existingVertices); bool performQuadMerging(std::list& quads); bool mergeQuads(Quad& q1, Quad& q2); @@ -135,7 +135,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + SurfaceMesh* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 9f8b4650..3174c63f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -88,7 +88,7 @@ namespace PolyVox { uint32_t regX = x - m_regSizeInVoxels.getLowerX(); - typename VolumeType::VoxelType material; //Filled in by callback + uint32_t material; //Filled in by callback typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); @@ -205,7 +205,7 @@ namespace PolyVox } template - int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) + int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) { for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) { @@ -214,14 +214,14 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial (Vector3DFloat(static_cast(uX) - 0.5f, static_cast(uY) - 0.5f, static_cast(uZ) - 0.5f), uMaterialIn)); + rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(static_cast(uX) - 0.5f, static_cast(uY) - 0.5f, static_cast(uZ) - 0.5f), uMaterialIn)); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; } //If we have an existing vertex and the material matches then we can return it. - if(rEntry.uMaterial == uMaterialIn) + if(rEntry.uMaterial == static_cast(uMaterialIn)) { return rEntry.iIndex; } @@ -268,7 +268,7 @@ namespace PolyVox { //All four vertices of a given quad have the same material, //so just check that the first pair of vertices match. - if(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() == m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) + if(std::abs(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() - m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) < 0.001) { //Now check whether quad 2 is adjacent to quad one by comparing vertices. //Adjacent quads must share two vertices, and the second quad could be to the diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 2e9897f9..31803437 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -41,9 +41,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); #else - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); #endif void execute(); @@ -193,7 +193,7 @@ namespace PolyVox uint32_t m_uNoOfOccupiedCells; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + SurfaceMesh* m_meshCurrent; //Information about the region we are currently processing Region m_regSizeInVoxels; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index ac65966b..97b97e79 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -459,7 +459,7 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -488,8 +488,8 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); - PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; m_sampVolume.moveNegativeY(); @@ -516,7 +516,7 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename Controller::MaterialType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast(uMaterial)); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 051fb93e..702e786a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -132,12 +132,12 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // PositionMaterial //////////////////////////////////////////////////////////////////////////////// - template class PositionMaterial; + class PositionMaterial; //////////////////////////////////////////////////////////////////////////////// // PositionMaterialNormal //////////////////////////////////////////////////////////////////////////////// - template class PositionMaterialNormal; + class PositionMaterialNormal; //////////////////////////////////////////////////////////////////////////////// // RawVolume diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 2239b267..4d506d74 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -21,8 +21,6 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/Utility.h" - namespace PolyVox { template diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 3eb18072..033fad6b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -36,107 +36,49 @@ namespace PolyVox #ifdef SWIG class PositionMaterial #else - template class POLYVOX_API PositionMaterial #endif { public: - PositionMaterial() - { - } + PositionMaterial(); + PositionMaterial(Vector3DFloat positionToSet, float materialToSet); - PositionMaterial(Vector3DFloat positionToSet, MaterialType materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - } + float getMaterial(void) const; + const Vector3DFloat& getPosition(void) const; - MaterialType getMaterial(void) const - { - return material; - } - - const Vector3DFloat& getPosition(void) const - { - return position; - } - - void setMaterial(MaterialType materialToSet) - { - material = materialToSet; - } - - void setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } + void setMaterial(float materialToSet); + void setPosition(const Vector3DFloat& positionToSet); public: //Nicely fits into four floats. Vector3DFloat position; - MaterialType material; + float material; }; #ifdef SWIG class PositionMaterialNormal #else - template class POLYVOX_API PositionMaterialNormal #endif { public: - PositionMaterialNormal() - { - } + PositionMaterialNormal(); + PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet); + PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet); - PositionMaterialNormal(Vector3DFloat positionToSet, MaterialType materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - } + float getMaterial(void) const; + const Vector3DFloat& getNormal(void) const; + const Vector3DFloat& getPosition(void) const; - PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, MaterialType materialToSet) - :position(positionToSet) - ,normal(normalToSet) - ,material(materialToSet) - { - } - - MaterialType getMaterial(void) const - { - return material; - } - - const Vector3DFloat& getNormal(void) const - { - return normal; - } - - const Vector3DFloat& getPosition(void) const - { - return position; - } - - void setMaterial(MaterialType materialToSet) - { - material = materialToSet; - } - - void setNormal(const Vector3DFloat& normalToSet) - { - normal = normalToSet; - } - - void setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } + void setMaterial(float materialToSet); + void setNormal(const Vector3DFloat& normalToSet); + void setPosition(const Vector3DFloat& positionToSet); public: //Nicely fits into seven floats, meaning we //can squeeze in one more for material blending. Vector3DFloat position; Vector3DFloat normal; - MaterialType material; //FIXME: This shouldn't be float on CPU? + float material; //FIXME: This shouldn't be float on CPU? }; } diff --git a/library/PolyVoxCore/source/VertexTypes.cpp b/library/PolyVoxCore/source/VertexTypes.cpp index b4dca237..22a55721 100644 --- a/library/PolyVoxCore/source/VertexTypes.cpp +++ b/library/PolyVoxCore/source/VertexTypes.cpp @@ -25,9 +25,86 @@ freely, subject to the following restrictions: namespace PolyVox { + PositionMaterialNormal::PositionMaterialNormal() + { + } + + PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + + } + + PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet) + :position(positionToSet) + ,normal(normalToSet) + ,material(materialToSet) + { + } + + float PositionMaterialNormal::getMaterial(void) const + { + return material; + } + + const Vector3DFloat& PositionMaterialNormal::getNormal(void) const + { + return normal; + } + + const Vector3DFloat& PositionMaterialNormal::getPosition(void) const + { + return position; + } + + void PositionMaterialNormal::setMaterial(float materialToSet) + { + material = materialToSet; + } + + void PositionMaterialNormal::setNormal(const Vector3DFloat& normalToSet) + { + normal = normalToSet; + } + + void PositionMaterialNormal::setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } + //////////////////////////////////////////////////////////////////////////////// // PositionMaterial //////////////////////////////////////////////////////////////////////////////// + PositionMaterial::PositionMaterial() + { + } + + PositionMaterial::PositionMaterial(Vector3DFloat positionToSet, float materialToSet) + :position(positionToSet) + ,material(materialToSet) + { + + } + + float PositionMaterial::getMaterial(void) const + { + return material; + } + + const Vector3DFloat& PositionMaterial::getPosition(void) const + { + return position; + } + void PositionMaterial::setMaterial(float materialToSet) + { + material = materialToSet; + } + + void PositionMaterial::setPosition(const Vector3DFloat& positionToSet) + { + position = positionToSet; + } } From 7fc954a6bf21e97446b5559df1aba08a4394b8d8 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Tue, 20 May 2014 14:43:18 +0100 Subject: [PATCH 050/259] Fix SWIG include paths for C# bindings --- library/bindings/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index 2c806080..8bd8e7b7 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -38,9 +38,9 @@ if(ENABLE_BINDINGS) set(CMAKE_SWIG_FLAGS "") set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON) + include_directories(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore) if(PYTHONLIBS_FOUND) include_directories(${PYTHON_INCLUDE_PATH}) - include_directories(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore) link_directories(${PolyVoxCore_BINARY_DIR}) #set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin") From 51e93fdabce340810fd1304ffd0edec3e9e5ce99 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 22 May 2014 16:25:36 +0200 Subject: [PATCH 051/259] Modifying the OpenGLWidget so that it can render multiple meshes. --- examples/Basic/OpenGLWidget.cpp | 18 +++++++++--------- examples/Basic/OpenGLWidget.h | 13 +++++++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index a3f6ad96..ad0facfa 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -21,17 +21,17 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &indexBuffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); + glGenBuffers(1, &(mMeshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mMeshData.indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); //We need to tell OpenGL how to understand the format of the vertex data @@ -40,7 +40,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh #include +struct OpenGLMeshData +{ + GLuint noOfIndices; + GLuint indexBuffer; + GLuint vertexBuffer; + GLuint vertexArrayObject; +}; + class OpenGLWidget : public QGLWidget { public: @@ -52,10 +60,7 @@ protected: private: //Index/vertex buffer data - GLuint noOfIndices; - GLuint indexBuffer; - GLuint vertexBuffer; - GLuint vertexArrayObject; + OpenGLMeshData mMeshData; QGLShaderProgram shader; From 7d55e00f7686744ba2af998ded014d818c7c8ba9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 22 May 2014 16:38:02 +0200 Subject: [PATCH 052/259] More work adding support for multiple meshes. --- examples/Basic/OpenGLWidget.cpp | 41 ++++++++++++++++++++------------- examples/Basic/OpenGLWidget.h | 2 +- examples/Basic/main.cpp | 6 ++++- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index ad0facfa..e9998220 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -19,19 +19,23 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(mMeshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mMeshData.indexBuffer); + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); //We need to tell OpenGL how to understand the format of the vertex data @@ -40,7 +44,9 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh mMeshData; QGLShaderProgram shader; diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 09dc5423..3b04f04c 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,11 +78,15 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion()); + + auto mesh = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + auto mesh2 = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); + openGLWidget.setSurfaceMeshToRender(mesh2); //Run the message pump. return app.exec(); From 16cbb94d90b1d8a1df1c89759beba30c2f47b52e Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 22 May 2014 16:51:41 +0200 Subject: [PATCH 053/259] Rotation is now applied by moving the camera rather than the meshes. --- examples/Basic/OpenGLWidget.cpp | 27 +++++++++++++++------------ examples/Basic/main.cpp | 8 ++++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index e9998220..5ca5880f 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -129,15 +129,6 @@ void OpenGLWidget::initializeGL() std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); } - - shader.bind(); - - QMatrix4x4 worldToCameraMatrix{}; - worldToCameraMatrix.translate(0, 0, -50); //Move the camera back by 50 units - - shader.setUniformValue("worldToCameraMatrix", worldToCameraMatrix); - - shader.release(); } void OpenGLWidget::resizeGL(int w, int h) @@ -163,9 +154,9 @@ void OpenGLWidget::paintGL() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); QMatrix4x4 modelToWorldMatrix{}; - modelToWorldMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis - modelToWorldMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis - modelToWorldMatrix.translate(-32, -32, -32); //centre the model on the origin + //modelToWorldMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis + //modelToWorldMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis + //modelToWorldMatrix.translate(-32, -32, -32); //centre the model on the origin shader.bind(); @@ -205,5 +196,17 @@ void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) m_yRotation += diff.y(); m_LastFrameMousePos = m_CurrentMousePos; + shader.bind(); + + QMatrix4x4 worldToCameraMatrix{}; + worldToCameraMatrix.translate(0, 0, -50); //Move the camera back by 50 units + worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis + worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis + worldToCameraMatrix.translate(-32, -32, -32); //centre the model on the origin + + shader.setUniformValue("worldToCameraMatrix", worldToCameraMatrix); + + shader.release(); + update(); } diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 3b04f04c..72dd96eb 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,15 +78,15 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - //auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); + auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion()); - auto mesh = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); - auto mesh2 = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); + //auto mesh = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + //auto mesh2 = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); - openGLWidget.setSurfaceMeshToRender(mesh2); + //openGLWidget.setSurfaceMeshToRender(mesh2); //Run the message pump. return app.exec(); From f8ce3a5f3d2f42f83c1fd557d8420ceb65700d80 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 22 May 2014 17:03:06 +0200 Subject: [PATCH 054/259] Tidying camera code. --- examples/Basic/OpenGLWidget.cpp | 19 ++++++++++++++----- examples/Basic/OpenGLWidget.h | 7 +++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 5ca5880f..17355b2f 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -9,6 +9,8 @@ using namespace std; OpenGLWidget::OpenGLWidget(QWidget *parent) :QGLWidget(parent) + ,mCenterPoint(32,32,32) + ,mDistFromCenter(50) ,m_xRotation(0) ,m_yRotation(0) { @@ -129,6 +131,8 @@ void OpenGLWidget::initializeGL() std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); } + + setupWorldToCameraMatrix(); } void OpenGLWidget::resizeGL(int w, int h) @@ -196,17 +200,22 @@ void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) m_yRotation += diff.y(); m_LastFrameMousePos = m_CurrentMousePos; + setupWorldToCameraMatrix(); + + update(); +} + +void OpenGLWidget::setupWorldToCameraMatrix() +{ shader.bind(); QMatrix4x4 worldToCameraMatrix{}; - worldToCameraMatrix.translate(0, 0, -50); //Move the camera back by 50 units + worldToCameraMatrix.translate(0, 0, -mDistFromCenter); //Move the camera back by the required amount worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis - worldToCameraMatrix.translate(-32, -32, -32); //centre the model on the origin + worldToCameraMatrix.translate(-mCenterPoint); //centre the model on the origin shader.setUniformValue("worldToCameraMatrix", worldToCameraMatrix); shader.release(); - - update(); -} +} \ No newline at end of file diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index b797b5b3..5e7e46d9 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -59,6 +59,9 @@ protected: void paintGL(); private: + + void setupWorldToCameraMatrix(); + //Index/vertex buffer data std::vector mMeshData; @@ -67,6 +70,10 @@ private: //Mouse data QPoint m_LastFrameMousePos; QPoint m_CurrentMousePos; + + //Camera setup + QVector3D mCenterPoint; + float mDistFromCenter; int m_xRotation; int m_yRotation; }; From ab741583e4504df1674e574f7c7e8d8f16e4b081 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 22 May 2014 23:26:40 +0200 Subject: [PATCH 055/259] Renamed extractXxxSurface() to extractXxxMesh() --- examples/Basic/main.cpp | 10 +++++----- examples/Paging/main.cpp | 2 +- examples/SmoothLOD/main.cpp | 4 ++-- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 8 ++++---- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 8 ++++---- tests/TestCubicSurfaceExtractor.cpp | 2 +- tests/TestSurfaceExtractor.cpp | 2 +- tests/TestVolumeSubclass.cpp | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 72dd96eb..78de21d4 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -77,12 +77,12 @@ int main(int argc, char *argv[]) SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); - // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); - //auto mesh = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion()); + // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. + auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); - //auto mesh = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); - //auto mesh2 = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); + //auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index b1134fdd..d1e0ae09 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface - auto mesh = extractCubicSurface(&volData, reg); + auto mesh = extractCubicMesh(&volData, reg); std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; //Pass the surface to the OpenGL window diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 2e97c876..5bc79f96 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -90,11 +90,11 @@ int main(int argc, char *argv[]) volumeResampler.execute(); //Extract the surface - auto meshLowLOD = extractMarchingCubesSurface(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface - auto meshHighLOD = extractMarchingCubesSurface(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); + auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); //Pass the surface to the OpenGL window diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index b4493d29..01020ad3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -159,7 +159,7 @@ namespace PolyVox }; template - SurfaceMesh > extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) { SurfaceMesh > result; CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); @@ -171,13 +171,13 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - SurfaceMesh > extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) + SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) #else - SurfaceMesh > extractCubicSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) #endif { DefaultIsQuadNeeded isQuadNeeded; - return extractCubicSurface >(volData, region, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + return extractCubicMesh >(volData, region, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index fe541f74..cf403ab0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -212,7 +212,7 @@ namespace PolyVox }; template< typename VolumeType, typename Controller> - SurfaceMesh > extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) { SurfaceMesh > result; MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); @@ -224,13 +224,13 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - SurfaceMesh > extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) + SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) #else - SurfaceMesh > extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) #endif { DefaultMarchingCubesController controller; - return extractMarchingCubesSurface(volData, region, eWrapMode, tBorderValue, controller); + return extractMarchingCubesMesh(volData, region, eWrapMode, tBorderValue, controller); } } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 3696cd42..7c74dee1 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -108,7 +108,7 @@ uint32_t testForType(void) { Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); - auto result = extractCubicSurface(&volData, regionToExtract); + auto result = extractCubicMesh(&volData, regionToExtract); uTotalVertices += result.getNoOfVertices(); uTotalIndices += result.getNoOfIndices(); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 47d5404b..c11541a5 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -128,7 +128,7 @@ SurfaceMesh > testForType(void) //I think we coul DefaultMarchingCubesController controller; controller.setThreshold(50); - auto result = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); + auto result = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); return result; } diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 7562f1ef..73351113 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -184,7 +184,7 @@ void TestVolumeSubclass::testExtractSurface() } } - auto result = extractCubicSurface(&volumeSubclass, volumeSubclass.getEnclosingRegion()); + auto result = extractCubicMesh(&volumeSubclass, volumeSubclass.getEnclosingRegion()); QCOMPARE(result.getNoOfVertices(), static_cast(8)); } From 4cec89de384169f77b56aaa0da0dec4c41162e66 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 14:32:46 +0200 Subject: [PATCH 056/259] Added ability to specify the visible region so that the example framework can support different volume sizes. --- examples/Basic/OpenGLWidget.cpp | 19 +++++++++++++++---- examples/Basic/OpenGLWidget.h | 5 +++-- examples/Basic/main.cpp | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 17355b2f..eb47180e 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -9,8 +9,7 @@ using namespace std; OpenGLWidget::OpenGLWidget(QWidget *parent) :QGLWidget(parent) - ,mCenterPoint(32,32,32) - ,mDistFromCenter(50) + ,m_viewableRegion(Region(0, 0, 0, 255, 255, 255)) ,m_xRotation(0) ,m_yRotation(0) { @@ -51,6 +50,12 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setViewableRegion(PolyVox::Region viewableRegion); + protected: //Qt OpenGL functions void initializeGL(); @@ -72,8 +74,7 @@ private: QPoint m_CurrentMousePos; //Camera setup - QVector3D mCenterPoint; - float mDistFromCenter; + PolyVox::Region m_viewableRegion; int m_xRotation; int m_yRotation; }; diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 78de21d4..82031152 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -86,6 +86,7 @@ int main(int argc, char *argv[]) //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); //openGLWidget.setSurfaceMeshToRender(mesh2); //Run the message pump. From da8f294847a1e5835baf5f70ba6d0f9739f3e58d Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 14:37:35 +0200 Subject: [PATCH 057/259] Comments --- examples/Basic/OpenGLWidget.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 9009bad8..f95dbdbb 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -42,20 +42,21 @@ struct OpenGLMeshData class OpenGLWidget : public QGLWidget { public: - //Constructor + // Constructor OpenGLWidget(QWidget *parent); - //Mouse handling + // Mouse handling void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); - //Convert a SurfaceMesh to OpenGL index/vertex buffers + // Convert a SurfaceMesh to OpenGL index/vertex buffers void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); protected: - //Qt OpenGL functions + // Qt OpenGL functions void initializeGL(); void resizeGL(int w, int h); void paintGL(); @@ -64,16 +65,16 @@ private: void setupWorldToCameraMatrix(); - //Index/vertex buffer data + // Index/vertex buffer data std::vector mMeshData; QGLShaderProgram shader; - //Mouse data + // Mouse data QPoint m_LastFrameMousePos; QPoint m_CurrentMousePos; - //Camera setup + // Camera setup PolyVox::Region m_viewableRegion; int m_xRotation; int m_yRotation; From 4aae00e4a8d0458f18dadff4e48750f7572cbb71 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 15:17:07 +0200 Subject: [PATCH 058/259] Renamed SurfaceMesh to just Mesh --- examples/Basic/OpenGLWidget.cpp | 2 +- examples/Basic/OpenGLWidget.h | 4 +- examples/Basic/main.cpp | 6 +- .../OpenGL/OpenGLImmediateModeSupport.cpp | 4 +- examples/OpenGL/OpenGLImmediateModeSupport.h | 2 +- .../OpenGLVertexBufferObjectSupport.cpp | 20 +- .../OpenGL/OpenGLVertexBufferObjectSupport.h | 8 +- examples/OpenGL/OpenGLWidget.cpp | 18 +- examples/OpenGL/OpenGLWidget.h | 6 +- examples/OpenGL/main.cpp | 2 +- examples/Paging/OpenGLWidget.cpp | 2 +- examples/Paging/OpenGLWidget.h | 4 +- examples/Paging/main.cpp | 8 +- examples/SmoothLOD/OpenGLWidget.cpp | 4 +- examples/SmoothLOD/OpenGLWidget.h | 6 +- examples/SmoothLOD/main.cpp | 10 +- library/PolyVoxCore/CMakeLists.txt | 4 +- .../PolyVoxCore/CubicSurfaceExtractor.h | 16 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- .../include/PolyVoxCore/GradientEstimators.h | 2 +- .../MarchingCubesSurfaceExtractor.h | 16 +- .../MarchingCubesSurfaceExtractor.inl | 16 +- .../PolyVoxCore/{SurfaceMesh.h => Mesh.h} | 208 ++-- .../PolyVoxCore/{SurfaceMesh.inl => Mesh.inl} | 976 +++++++++--------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 4 +- tests/TestCubicSurfaceExtractor.cpp | 2 +- tests/TestSurfaceExtractor.cpp | 6 +- 27 files changed, 679 insertions(+), 679 deletions(-) rename library/PolyVoxCore/include/PolyVoxCore/{SurfaceMesh.h => Mesh.h} (86%) rename library/PolyVoxCore/include/PolyVoxCore/{SurfaceMesh.inl => Mesh.inl} (85%) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index eb47180e..7fb5f2cb 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -15,7 +15,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index f95dbdbb..266ee0e6 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -24,7 +24,7 @@ distribution. #ifndef __BasicExample_OpenGLWidget_H__ #define __BasicExample_OpenGLWidget_H__ -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "glew/glew.h" @@ -50,7 +50,7 @@ public: void mousePressEvent(QMouseEvent* event); // Convert a SurfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 82031152..c3a53f59 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -25,7 +25,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/SimpleVolume.h" #include @@ -85,9 +85,9 @@ int main(int argc, char *argv[]) //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window - openGLWidget.setSurfaceMeshToRender(mesh); + openGLWidget.setMeshToRender(mesh); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - //openGLWidget.setSurfaceMeshToRender(mesh2); + //openGLWidget.setMeshToRender(mesh2); //Run the message pump. return app.exec(); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp index 7aff64df..ab2522bd 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ b/examples/OpenGL/OpenGLImmediateModeSupport.cpp @@ -24,12 +24,12 @@ freely, subject to the following restrictions: #include "OpenGLImmediateModeSupport.h" #include "OpenGLSupport.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" using namespace PolyVox; using namespace std; -void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel) +void renderRegionImmediateMode(PolyVox::Mesh >& mesh, unsigned int uLodLevel) { const vector >& vecVertices = mesh.getVertices(); const vector& vecIndices = mesh.getIndices(); diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.h b/examples/OpenGL/OpenGLImmediateModeSupport.h index 9f5aea79..3bc45a2b 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.h +++ b/examples/OpenGL/OpenGLImmediateModeSupport.h @@ -29,6 +29,6 @@ freely, subject to the following restrictions: #include "glew/glew.h" -void renderRegionImmediateMode(PolyVox::SurfaceMesh >& mesh, unsigned int uLodLevel); +void renderRegionImmediateMode(PolyVox::Mesh >& mesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLImmediateModeSupport_H__ diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp index ae5afd15..17e9e138 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp @@ -25,15 +25,15 @@ freely, subject to the following restrictions: #include "OpenGLVertexBufferObjectSupport.h" #include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" using namespace PolyVox; using namespace std; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMesh >& mesh) +OpenGLMesh BuildOpenGLMesh(const Mesh >& mesh) { //Represents our filled in OpenGL vertex and index buffer objects. - OpenGLSurfaceMesh result; + OpenGLMesh result; //The source result.sourceMesh = &mesh; @@ -102,23 +102,23 @@ OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const SurfaceMeshm_vecLodRecords[uLodLevel].beginIndex; - int endIndex = openGLSurfaceMesh.sourceMesh->m_vecLodRecords[uLodLevel].endIndex; - glBindBuffer(GL_ARRAY_BUFFER, openGLSurfaceMesh.vertexBuffer); + int beginIndex = openGLMesh.sourceMesh->m_vecLodRecords[uLodLevel].beginIndex; + int endIndex = openGLMesh.sourceMesh->m_vecLodRecords[uLodLevel].endIndex; + glBindBuffer(GL_ARRAY_BUFFER, openGLMesh.vertexBuffer); glVertexPointer(3, GL_FLOAT, 36, 0); glNormalPointer(GL_FLOAT, 36, (GLvoid*)12); glColorPointer(3, GL_FLOAT, 36, (GLvoid*)24); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, openGLSurfaceMesh.indexBuffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, openGLMesh.indexBuffer); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_COLOR_ARRAY); - //glDrawElements(GL_TRIANGLES, openGLSurfaceMesh.noOfIndices, GL_UNSIGNED_INT, 0); - glDrawRangeElements(GL_TRIANGLES, beginIndex, endIndex-1, endIndex - beginIndex,/* openGLSurfaceMesh.noOfIndices,*/ GL_UNSIGNED_INT, 0); + //glDrawElements(GL_TRIANGLES, openGLMesh.noOfIndices, GL_UNSIGNED_INT, 0); + glDrawRangeElements(GL_TRIANGLES, beginIndex, endIndex-1, endIndex - beginIndex,/* openGLMesh.noOfIndices,*/ GL_UNSIGNED_INT, 0); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h index fc97dfb8..e82a8c29 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h @@ -28,15 +28,15 @@ freely, subject to the following restrictions: #include "glew/glew.h" -struct OpenGLSurfaceMesh +struct OpenGLMesh { GLulong noOfIndices; GLuint indexBuffer; GLuint vertexBuffer; - const PolyVox::SurfaceMesh >* sourceMesh; + const PolyVox::Mesh >* sourceMesh; }; -OpenGLSurfaceMesh BuildOpenGLSurfaceMesh(const PolyVox::SurfaceMesh >& mesh); -void renderRegionVertexBufferObject(const OpenGLSurfaceMesh& openGLSurfaceMesh, unsigned int uLodLevel); +OpenGLMesh BuildOpenGLMesh(const PolyVox::Mesh >& mesh); +void renderRegionVertexBufferObject(const OpenGLMesh& openGLMesh, unsigned int uLodLevel); #endif //__OpenGLExample_OpenGLVertexBufferObjectSupport_H__ diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index 475ba846..38c107a9 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -50,8 +50,8 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) void OpenGLWidget::setVolume(PolyVox::LargeVolume* volData) { //First we free anything from the previous volume (if there was one). - m_mapOpenGLSurfaceMeshes.clear(); - m_mapSurfaceMeshes.clear(); + m_mapOpenGLMeshes.clear(); + m_mapMeshes.clear(); m_volData = volData; //If we have any volume data then generate the new surface patches. @@ -87,7 +87,7 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume* volDat //Extract the surface for this region //extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent); - std::shared_ptr< SurfaceMesh > > mesh(new SurfaceMesh >); + std::shared_ptr< Mesh > > mesh(new Mesh >); MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get()); surfaceExtractor.execute(); @@ -105,12 +105,12 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume* volDat Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); if(m_bUseOpenGLVertexBufferObjects) { - OpenGLSurfaceMesh openGLSurfaceMesh = BuildOpenGLSurfaceMesh(*(mesh.get())); - m_mapOpenGLSurfaceMeshes.insert(make_pair(v3dRegPos, openGLSurfaceMesh)); + OpenGLMesh openGLMesh = BuildOpenGLMesh(*(mesh.get())); + m_mapOpenGLMeshes.insert(make_pair(v3dRegPos, openGLMesh)); } //else //{ - m_mapSurfaceMeshes.insert(make_pair(v3dRegPos, mesh)); + m_mapMeshes.insert(make_pair(v3dRegPos, mesh)); //} //delete meshCurrent; } @@ -191,13 +191,13 @@ void OpenGLWidget::paintGL() for(uint16_t uRegionX = 0; uRegionX < m_uVolumeWidthInRegions; ++uRegionX) { Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); - if(m_mapSurfaceMeshes.find(v3dRegPos) != m_mapSurfaceMeshes.end()) + if(m_mapMeshes.find(v3dRegPos) != m_mapMeshes.end()) { - std::shared_ptr< SurfaceMesh > > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; + std::shared_ptr< Mesh > > meshCurrent = m_mapMeshes[v3dRegPos]; unsigned int uLodLevel = 0; //meshCurrent->m_vecLodRecords.size() - 1; if(m_bUseOpenGLVertexBufferObjects) { - renderRegionVertexBufferObject(m_mapOpenGLSurfaceMeshes[v3dRegPos], uLodLevel); + renderRegionVertexBufferObject(m_mapOpenGLMeshes[v3dRegPos], uLodLevel); } else { diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h index 1b4b4612..3511ac75 100644 --- a/examples/OpenGL/OpenGLWidget.h +++ b/examples/OpenGL/OpenGLWidget.h @@ -30,7 +30,7 @@ freely, subject to the following restrictions: #include #include "PolyVoxCore/LargeVolume.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/Impl/Utility.h" #include "OpenGLImmediateModeSupport.h" @@ -87,8 +87,8 @@ class OpenGLWidget : public QGLWidget PolyVox::LargeVolume* m_volData; //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region - std::map m_mapOpenGLSurfaceMeshes; - std::map > >, Vector3DUint8Compare> m_mapSurfaceMeshes; + std::map m_mapOpenGLMeshes; + std::map > >, Vector3DUint8Compare> m_mapMeshes; unsigned int m_uRegionSideLength; unsigned int m_uVolumeWidthInRegions; diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index e6ae33d7..ab70e957 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/LowPassFilter.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/RLEBlockCompressor.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/Impl/Utility.h" #include "OpenGLImmediateModeSupport.h" diff --git a/examples/Paging/OpenGLWidget.cpp b/examples/Paging/OpenGLWidget.cpp index 0227a66f..fa2aa7be 100644 --- a/examples/Paging/OpenGLWidget.cpp +++ b/examples/Paging/OpenGLWidget.cpp @@ -15,7 +15,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) { if((surfaceMesh.getNoOfIndices() == 0) || (surfaceMesh.getNoOfVertices() == 0)) { diff --git a/examples/Paging/OpenGLWidget.h b/examples/Paging/OpenGLWidget.h index 61702be1..63afbb97 100644 --- a/examples/Paging/OpenGLWidget.h +++ b/examples/Paging/OpenGLWidget.h @@ -25,7 +25,7 @@ distribution. #define __BasicExample_OpenGLWidget_H__ #include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "glew/glew.h" @@ -42,7 +42,7 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); + void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index d1e0ae09..77c64d16 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -29,7 +29,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/RLEBlockCompressor.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/LargeVolume.h" #include @@ -185,12 +185,12 @@ int main(int argc, char *argv[]) std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - //Extract the surface - auto mesh = extractCubicMesh(&volData, reg); + //Extract the surface + auto mesh = extractCubicMesh(&volData, reg); std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; //Pass the surface to the OpenGL window - openGLWidget.setSurfaceMeshToRender(mesh); + openGLWidget.setMeshToRender(mesh); //Run the message pump. return app.exec(); diff --git a/examples/SmoothLOD/OpenGLWidget.cpp b/examples/SmoothLOD/OpenGLWidget.cpp index e804240b..d487f73b 100644 --- a/examples/SmoothLOD/OpenGLWidget.cpp +++ b/examples/SmoothLOD/OpenGLWidget.cpp @@ -21,7 +21,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); @@ -43,7 +43,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh) +void OpenGLWidget::setMeshToRenderLowLOD(const PolyVox::Mesh >& surfaceMesh) { //Convienient access to the vertices and indices const vector& vecIndices = surfaceMesh.getIndices(); diff --git a/examples/SmoothLOD/OpenGLWidget.h b/examples/SmoothLOD/OpenGLWidget.h index 895e9e74..af5b96ee 100644 --- a/examples/SmoothLOD/OpenGLWidget.h +++ b/examples/SmoothLOD/OpenGLWidget.h @@ -24,7 +24,7 @@ distribution. #ifndef __BasicExample_OpenGLWidget_H__ #define __BasicExample_OpenGLWidget_H__ -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "glew/glew.h" @@ -41,8 +41,8 @@ public: void mousePressEvent(QMouseEvent* event); //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setSurfaceMeshToRender(const PolyVox::SurfaceMesh >& surfaceMesh); - void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh >& surfaceMesh); + void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); + void setMeshToRenderLowLOD(const PolyVox::Mesh >& surfaceMesh); protected: //Qt OpenGL functions diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 5bc79f96..a0dc6dcd 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -25,7 +25,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Density.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" #include "PolyVoxCore/VolumeResampler.h" @@ -89,17 +89,17 @@ int main(int argc, char *argv[]) VolumeResampler< SimpleVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); volumeResampler.execute(); - //Extract the surface + //Extract the surface auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface - auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); + auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); //Pass the surface to the OpenGL window - openGLWidget.setSurfaceMeshToRender(meshHighLOD); - openGLWidget.setSurfaceMeshToRenderLowLOD(meshLowLOD); + openGLWidget.setMeshToRender(meshHighLOD); + openGLWidget.setMeshToRenderLowLOD(meshLowLOD); //Run the message pump. return app.exec(); diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index e4289feb..42844fce 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -84,8 +84,8 @@ SET(CORE_INC_FILES include/PolyVoxCore/SimpleVolume.inl include/PolyVoxCore/SimpleVolumeBlock.inl include/PolyVoxCore/SimpleVolumeSampler.inl - include/PolyVoxCore/SurfaceMesh.h - include/PolyVoxCore/SurfaceMesh.inl + include/PolyVoxCore/Mesh.h + include/PolyVoxCore/Mesh.inl include/PolyVoxCore/UncompressedBlock.h include/PolyVoxCore/UncompressedBlock.inl include/PolyVoxCore/Vector.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 01020ad3..03e973a3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -31,7 +31,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/DefaultIsQuadNeeded.h" -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" namespace PolyVox { @@ -113,9 +113,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif @@ -135,7 +135,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + Mesh >* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; @@ -159,9 +159,9 @@ namespace PolyVox }; template - SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) { - SurfaceMesh > result; + Mesh > result; CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); extractor.execute(); return result; @@ -171,9 +171,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) + Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) #else - SurfaceMesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) #endif { DefaultIsQuadNeeded isQuadNeeded; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 822b9256..5bc067a9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) diff --git a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h index cb8fcbe4..871dbcb2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h +++ b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h @@ -55,7 +55,7 @@ namespace PolyVox template Vector3DFloat computeSmoothSobelGradient(typename VolumeType::Sampler& volIter); - //POLYVOX_API void computeNormalsForVertices(VolumeType* volumeData, SurfaceMesh& mesh, NormalGenerationMethod normalGenerationMethod); + //POLYVOX_API void computeNormalsForVertices(VolumeType* volumeData, Mesh& mesh, NormalGenerationMethod normalGenerationMethod); //POLYVOX_API Vector3DFloat computeNormal(VolumeType* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index cf403ab0..6510ac5c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -29,7 +29,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? -#include "PolyVoxCore/SurfaceMesh.h" +#include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/DefaultMarchingCubesController.h" namespace PolyVox @@ -41,9 +41,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); #else - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); #endif void execute(); @@ -193,7 +193,7 @@ namespace PolyVox uint32_t m_uNoOfOccupiedCells; //The surface patch we are currently filling. - SurfaceMesh >* m_meshCurrent; + Mesh >* m_meshCurrent; //Information about the region we are currently processing Region m_regSizeInVoxels; @@ -212,9 +212,9 @@ namespace PolyVox }; template< typename VolumeType, typename Controller> - SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) { - SurfaceMesh > result; + Mesh > result; MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); extractor.execute(); return result; @@ -224,9 +224,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) #else - SurfaceMesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) #endif { DefaultMarchingCubesController controller; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 5c2868d9..99998bf4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -25,8 +25,8 @@ freely, subject to the following restrictions: namespace PolyVox { - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -456,10 +456,10 @@ namespace PolyVox v3dNormal.normalise(); } - // Allow the controller to decide how the material should be derived from the voxels. + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -485,11 +485,11 @@ namespace PolyVox v3dNormal.normalise(); } - // Allow the controller to decide how the material should be derived from the voxels. + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; m_sampVolume.moveNegativeY(); @@ -513,10 +513,10 @@ namespace PolyVox v3dNormal.normalise(); } - // Allow the controller to decide how the material should be derived from the voxels. + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); + const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h similarity index 86% rename from library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h rename to library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 1de4a905..90ebbfac 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -1,104 +1,104 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_SurfaceMesh_H__ -#define __PolyVox_SurfaceMesh_H__ - -#include "Impl/TypeDef.h" - -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/VertexTypes.h" //Should probably do away with this on in the future... - -#include -#include -#include -#include -#include -#include - -namespace PolyVox -{ - class LodRecord - { - public: - int beginIndex; - int endIndex; //Let's put it just past the end STL style - }; - - template - class SurfaceMesh - { - public: - SurfaceMesh(); - ~SurfaceMesh(); - - const std::vector& getIndices(void) const; - uint32_t getNoOfIndices(void) const; - uint32_t getNoOfNonUniformTrianges(void) const; - uint32_t getNoOfUniformTrianges(void) const; - uint32_t getNoOfVertices(void) const; - std::vector& getRawVertexData(void); //FIXME - this should be removed - const std::vector& getVertices(void) const; - - void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); - void addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2); - uint32_t addVertex(const VertexType& vertex); - void clear(void); - bool isEmpty(void) const; - - void scaleVertices(float amount); - void translateVertices(const Vector3DFloat& amount); - - //THESE FUNCTIONS TO BE REMOVED IN THE FUTURE. OR AT LEAST MOVED OUT OF THIS CLASS INTO FREE FUNCTIONS. - //THEY ARE CAUSING PROBLEMS WITH THE SWIG BINDINGS. THE FUNCTIONS REGARDING NORMALS MAKE NO SENSE WHEN - //A VERTEX MIGHT NOT HAVE NORMALS. THE EXTRACT SUBSET FUNCTION SHOULD MAYBE BE APPLICATION CODE, AT ANY - //RATE THE STD::SET CAUSES PROBLEMS WITH SWIG. IF YOU UNCOMMENT ANY OF THESE FUNCTIONS, PLEASE POST ON - //THE FORUM SO WE CAN KNOW THE FUNCTIONALITY IS STILL NEEDED IN SOME FORM. - //void sumNearbyNormals(bool bNormaliseResult = true); - //std::shared_ptr< SurfaceMesh > extractSubset(std::set setMaterials); - //void generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices = false); - - int noOfDegenerateTris(void); - void removeDegenerateTris(void); - void removeUnusedVertices(void); - - Region m_Region; - - int32_t m_iTimeStamp; - - int32_t m_iNoOfLod0Tris; - - public: - std::vector m_vecTriangleIndices; - std::vector m_vecVertices; - - std::vector m_vecLodRecords; - }; - - template - std::shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials); -} - -#include "PolyVoxCore/SurfaceMesh.inl" - -#endif /* __SurfaceMesh_H__ */ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Mesh_H__ +#define __PolyVox_Mesh_H__ + +#include "Impl/TypeDef.h" + +#include "PolyVoxCore/Region.h" +#include "PolyVoxCore/VertexTypes.h" //Should probably do away with this on in the future... + +#include +#include +#include +#include +#include +#include + +namespace PolyVox +{ + class LodRecord + { + public: + int beginIndex; + int endIndex; //Let's put it just past the end STL style + }; + + template + class Mesh + { + public: + Mesh(); + ~Mesh(); + + const std::vector& getIndices(void) const; + uint32_t getNoOfIndices(void) const; + uint32_t getNoOfNonUniformTrianges(void) const; + uint32_t getNoOfUniformTrianges(void) const; + uint32_t getNoOfVertices(void) const; + std::vector& getRawVertexData(void); //FIXME - this should be removed + const std::vector& getVertices(void) const; + + void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); + void addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2); + uint32_t addVertex(const VertexType& vertex); + void clear(void); + bool isEmpty(void) const; + + void scaleVertices(float amount); + void translateVertices(const Vector3DFloat& amount); + + //THESE FUNCTIONS TO BE REMOVED IN THE FUTURE. OR AT LEAST MOVED OUT OF THIS CLASS INTO FREE FUNCTIONS. + //THEY ARE CAUSING PROBLEMS WITH THE SWIG BINDINGS. THE FUNCTIONS REGARDING NORMALS MAKE NO SENSE WHEN + //A VERTEX MIGHT NOT HAVE NORMALS. THE EXTRACT SUBSET FUNCTION SHOULD MAYBE BE APPLICATION CODE, AT ANY + //RATE THE STD::SET CAUSES PROBLEMS WITH SWIG. IF YOU UNCOMMENT ANY OF THESE FUNCTIONS, PLEASE POST ON + //THE FORUM SO WE CAN KNOW THE FUNCTIONALITY IS STILL NEEDED IN SOME FORM. + //void sumNearbyNormals(bool bNormaliseResult = true); + //std::shared_ptr< Mesh > extractSubset(std::set setMaterials); + //void generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices = false); + + int noOfDegenerateTris(void); + void removeDegenerateTris(void); + void removeUnusedVertices(void); + + Region m_Region; + + int32_t m_iTimeStamp; + + int32_t m_iNoOfLod0Tris; + + public: + std::vector m_vecTriangleIndices; + std::vector m_vecVertices; + + std::vector m_vecLodRecords; + }; + + template + std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials); +} + +#include "PolyVoxCore/Mesh.inl" + +#endif /* __Mesh_H__ */ diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl similarity index 85% rename from library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl rename to library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index 9b1bf020..44fc5320 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -1,488 +1,488 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - template - SurfaceMesh::SurfaceMesh() - { - m_iTimeStamp = -1; - } - - template - SurfaceMesh::~SurfaceMesh() - { - } - - template - const std::vector& SurfaceMesh::getIndices(void) const - { - return m_vecTriangleIndices; - } - - template - uint32_t SurfaceMesh::getNoOfIndices(void) const - { - return m_vecTriangleIndices.size(); - } - - template - uint32_t SurfaceMesh::getNoOfNonUniformTrianges(void) const - { - uint32_t result = 0; - for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) - { - if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) - && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) - { - } - else - { - result++; - } - } - return result; - } - - template - uint32_t SurfaceMesh::getNoOfUniformTrianges(void) const - { - uint32_t result = 0; - for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) - { - if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) - && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) - { - result++; - } - } - return result; - } - - template - uint32_t SurfaceMesh::getNoOfVertices(void) const - { - return m_vecVertices.size(); - } - - template - std::vector& SurfaceMesh::getRawVertexData(void) - { - return m_vecVertices; - } - - template - const std::vector& SurfaceMesh::getVertices(void) const - { - return m_vecVertices; - } - - template - void SurfaceMesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) - { - //Make sure the specified indices correspond to valid vertices. - POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); - - m_vecTriangleIndices.push_back(index0); - m_vecTriangleIndices.push_back(index1); - m_vecTriangleIndices.push_back(index2); - } - - template - void SurfaceMesh::addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2) - { - //Make sure the specified indices correspond to valid vertices. - POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); - - m_vecTriangleIndices.push_back(index0); - m_vecTriangleIndices.push_back(index1); - m_vecTriangleIndices.push_back(index2); - } - - template - uint32_t SurfaceMesh::addVertex(const VertexType& vertex) - { - m_vecVertices.push_back(vertex); - return m_vecVertices.size() - 1; - } - - template - void SurfaceMesh::clear(void) - { - m_vecVertices.clear(); - m_vecTriangleIndices.clear(); - m_vecLodRecords.clear(); - } - - template - bool SurfaceMesh::isEmpty(void) const - { - return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function can help improve the visual appearance of a surface patch by - /// smoothing normals with other nearby normals. It iterates over each triangle - /// in the surface patch and determines the sum of its corners normals. For any - /// given vertex, these sums are in turn summed for any triangles which use the - /// vertex. Usually, the resulting normals should be renormalised afterwards. - /// Note: This function can cause lighting discontinuities accross region boundaries. - //////////////////////////////////////////////////////////////////////////////// - /*template - void SurfaceMesh::sumNearbyNormals(bool bNormaliseResult) - { - if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return; - } - - std::vector summedNormals(m_vecVertices.size()); - - //Initialise all normals to zero. Should be ok as the vector should store all elements contiguously. - memset(&summedNormals[0], 0, summedNormals.size() * sizeof(Vector3DFloat)); - - for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) - { - PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; - Vector3DFloat& v0New = summedNormals[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; - Vector3DFloat& v1New = summedNormals[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; - Vector3DFloat& v2New = summedNormals[*iterIndex]; - iterIndex++; - - Vector3DFloat sumOfNormals = v0.getNormal() + v1.getNormal() + v2.getNormal(); - - v0New += sumOfNormals; - v1New += sumOfNormals; - v2New += sumOfNormals; - } - - for(uint32_t uIndex = 0; uIndex < summedNormals.size(); uIndex++) - { - if(bNormaliseResult) - { - summedNormals[uIndex].normalise(); - } - m_vecVertices[uIndex].setNormal(summedNormals[uIndex]); - } - }*/ - - /*template - void SurfaceMesh::generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices) - { - Vector3DFloat offset = static_cast(m_Region.getLowerCorner()); - - //Initially zero the normals - for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) - { - if(m_Region.containsPoint(iterVertex->getPosition() + offset, 0.001)) - { - iterVertex->setNormal(Vector3DFloat(0.0f,0.0f,0.0f)); - } - } - - for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) - { - PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; - iterIndex++; - - Vector3DFloat triangleNormal = (v1.getPosition()-v0.getPosition()).cross(v2.getPosition()-v0.getPosition()); - - if(m_Region.containsPoint(v0.getPosition() + offset, 0.001)) - { - v0.setNormal(v0.getNormal() + triangleNormal); - } - if(m_Region.containsPoint(v1.getPosition() + offset, 0.001)) - { - v1.setNormal(v1.getNormal() + triangleNormal); - } - if(m_Region.containsPoint(v2.getPosition() + offset, 0.001)) - { - v2.setNormal(v2.getNormal() + triangleNormal); - } - } - - if(bNormalise) - { - for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) - { - Vector3DFloat normal = iterVertex->getNormal(); - normal.normalise(); - iterVertex->setNormal(normal); - } - } - }*/ - - /*template - std::shared_ptr< SurfaceMesh > SurfaceMesh::extractSubset(std::set setMaterials) - { - std::shared_ptr< SurfaceMesh > result(new SurfaceMesh); - - if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return result; - } - - assert(m_vecLodRecords.size() == 1); - if(m_vecLodRecords.size() != 1) - { - //If we have done progressive LOD then it's too late to split into subsets. - return result; - } - - std::vector indexMap(m_vecVertices.size()); - std::fill(indexMap.begin(), indexMap.end(), -1); - - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt += 3) - { - - PositionMaterialNormal& v0 = m_vecVertices[m_vecTriangleIndices[triCt]]; - PositionMaterialNormal& v1 = m_vecVertices[m_vecTriangleIndices[triCt + 1]]; - PositionMaterialNormal& v2 = m_vecVertices[m_vecTriangleIndices[triCt + 2]]; - - if( - (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v2.getMaterial()) != setMaterials.end())) - { - uint32_t i0; - if(indexMap[m_vecTriangleIndices[triCt]] == -1) - { - indexMap[m_vecTriangleIndices[triCt]] = result->addVertex(v0); - } - i0 = indexMap[m_vecTriangleIndices[triCt]]; - - uint32_t i1; - if(indexMap[m_vecTriangleIndices[triCt+1]] == -1) - { - indexMap[m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); - } - i1 = indexMap[m_vecTriangleIndices[triCt+1]]; - - uint32_t i2; - if(indexMap[m_vecTriangleIndices[triCt+2]] == -1) - { - indexMap[m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); - } - i2 = indexMap[m_vecTriangleIndices[triCt+2]]; - - result->addTriangle(i0,i1,i2); - } - } - - result->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = result->getNoOfIndices(); - result->m_vecLodRecords.push_back(lodRecord); - - return result; - }*/ - - template - int SurfaceMesh::noOfDegenerateTris(void) - { - int count = 0; - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) - { - int v0 = m_vecTriangleIndices[triCt]; - triCt++; - int v1 = m_vecTriangleIndices[triCt]; - triCt++; - int v2 = m_vecTriangleIndices[triCt]; - triCt++; - - if((v0 == v1) || (v1 == v2) || (v2 == v0)) - { - count++; - } - } - return count; - } - - template - void SurfaceMesh::removeDegenerateTris(void) - { - int noOfNonDegenerate = 0; - int targetCt = 0; - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) - { - int v0 = m_vecTriangleIndices[triCt]; - triCt++; - int v1 = m_vecTriangleIndices[triCt]; - triCt++; - int v2 = m_vecTriangleIndices[triCt]; - triCt++; - - if((v0 != v1) && (v1 != v2) & (v2 != v0)) - { - m_vecTriangleIndices[targetCt] = v0; - targetCt++; - m_vecTriangleIndices[targetCt] = v1; - targetCt++; - m_vecTriangleIndices[targetCt] = v2; - targetCt++; - - noOfNonDegenerate++; - } - } - - m_vecTriangleIndices.resize(noOfNonDegenerate * 3); - } - - template - void SurfaceMesh::removeUnusedVertices(void) - { - std::vector isVertexUsed(m_vecVertices.size()); - std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); - - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) - { - int v = m_vecTriangleIndices[triCt]; - isVertexUsed[v] = true; - } - - int noOfUsedVertices = 0; - std::vector newPos(m_vecVertices.size()); - for(uint32_t vertCt = 0; vertCt < m_vecVertices.size(); vertCt++) - { - if(isVertexUsed[vertCt]) - { - m_vecVertices[noOfUsedVertices] = m_vecVertices[vertCt]; - newPos[vertCt] = noOfUsedVertices; - noOfUsedVertices++; - } - } - - m_vecVertices.resize(noOfUsedVertices); - - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) - { - m_vecTriangleIndices[triCt] = newPos[m_vecTriangleIndices[triCt]]; - } - } - - //Currently a free function - think where this needs to go. - template - std::shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials) - { - std::shared_ptr< SurfaceMesh > result(new SurfaceMesh); - - result->m_Region = inputMesh.m_Region; - - if(inputMesh.m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return result; - } - - POLYVOX_ASSERT(inputMesh.m_vecLodRecords.size() == 1, "Number of LOD records must equal one."); - if(inputMesh.m_vecLodRecords.size() != 1) - { - //If we have done progressive LOD then it's too late to split into subsets. - return result; - } - - std::vector indexMap(inputMesh.m_vecVertices.size()); - std::fill(indexMap.begin(), indexMap.end(), -1); - - for(uint32_t triCt = 0; triCt < inputMesh.m_vecTriangleIndices.size(); triCt += 3) - { - - VertexType& v0 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt]]; - VertexType& v1 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 1]]; - VertexType& v2 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 2]]; - - if( - (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v2.getMaterial()) != setMaterials.end())) - { - uint32_t i0; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt]] = result->addVertex(v0); - } - i0 = indexMap[inputMesh.m_vecTriangleIndices[triCt]]; - - uint32_t i1; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); - } - i1 = indexMap[inputMesh.m_vecTriangleIndices[triCt+1]]; - - uint32_t i2; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); - } - i2 = indexMap[inputMesh.m_vecTriangleIndices[triCt+2]]; - - result->addTriangle(i0,i1,i2); - } - } - - result->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = result->getNoOfIndices(); - result->m_vecLodRecords.push_back(lodRecord); - - return result; - } - - template - void SurfaceMesh::scaleVertices(float amount) - { - for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) - { - //TODO: Should rethink accessors here to provide faster access - Vector3DFloat position = m_vecVertices[ct].getPosition(); - position *= amount; - m_vecVertices[ct].setPosition(position); - } - } - - template - void SurfaceMesh::translateVertices(const Vector3DFloat& amount) - { - for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) - { - //TODO: Should rethink accessors here to provide faster access - Vector3DFloat position = m_vecVertices[ct].getPosition(); - position += amount; - m_vecVertices[ct].setPosition(position); - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + template + Mesh::Mesh() + { + m_iTimeStamp = -1; + } + + template + Mesh::~Mesh() + { + } + + template + const std::vector& Mesh::getIndices(void) const + { + return m_vecTriangleIndices; + } + + template + uint32_t Mesh::getNoOfIndices(void) const + { + return m_vecTriangleIndices.size(); + } + + template + uint32_t Mesh::getNoOfNonUniformTrianges(void) const + { + uint32_t result = 0; + for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) + { + if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) + && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) + { + } + else + { + result++; + } + } + return result; + } + + template + uint32_t Mesh::getNoOfUniformTrianges(void) const + { + uint32_t result = 0; + for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) + { + if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) + && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) + { + result++; + } + } + return result; + } + + template + uint32_t Mesh::getNoOfVertices(void) const + { + return m_vecVertices.size(); + } + + template + std::vector& Mesh::getRawVertexData(void) + { + return m_vecVertices; + } + + template + const std::vector& Mesh::getVertices(void) const + { + return m_vecVertices; + } + + template + void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) + { + //Make sure the specified indices correspond to valid vertices. + POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); + POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); + POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); + + m_vecTriangleIndices.push_back(index0); + m_vecTriangleIndices.push_back(index1); + m_vecTriangleIndices.push_back(index2); + } + + template + void Mesh::addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2) + { + //Make sure the specified indices correspond to valid vertices. + POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); + POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); + POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); + + m_vecTriangleIndices.push_back(index0); + m_vecTriangleIndices.push_back(index1); + m_vecTriangleIndices.push_back(index2); + } + + template + uint32_t Mesh::addVertex(const VertexType& vertex) + { + m_vecVertices.push_back(vertex); + return m_vecVertices.size() - 1; + } + + template + void Mesh::clear(void) + { + m_vecVertices.clear(); + m_vecTriangleIndices.clear(); + m_vecLodRecords.clear(); + } + + template + bool Mesh::isEmpty(void) const + { + return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function can help improve the visual appearance of a surface patch by + /// smoothing normals with other nearby normals. It iterates over each triangle + /// in the surface patch and determines the sum of its corners normals. For any + /// given vertex, these sums are in turn summed for any triangles which use the + /// vertex. Usually, the resulting normals should be renormalised afterwards. + /// Note: This function can cause lighting discontinuities accross region boundaries. + //////////////////////////////////////////////////////////////////////////////// + /*template + void Mesh::sumNearbyNormals(bool bNormaliseResult) + { + if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... + { + return; + } + + std::vector summedNormals(m_vecVertices.size()); + + //Initialise all normals to zero. Should be ok as the vector should store all elements contiguously. + memset(&summedNormals[0], 0, summedNormals.size() * sizeof(Vector3DFloat)); + + for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) + { + PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; + Vector3DFloat& v0New = summedNormals[*iterIndex]; + iterIndex++; + PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; + Vector3DFloat& v1New = summedNormals[*iterIndex]; + iterIndex++; + PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; + Vector3DFloat& v2New = summedNormals[*iterIndex]; + iterIndex++; + + Vector3DFloat sumOfNormals = v0.getNormal() + v1.getNormal() + v2.getNormal(); + + v0New += sumOfNormals; + v1New += sumOfNormals; + v2New += sumOfNormals; + } + + for(uint32_t uIndex = 0; uIndex < summedNormals.size(); uIndex++) + { + if(bNormaliseResult) + { + summedNormals[uIndex].normalise(); + } + m_vecVertices[uIndex].setNormal(summedNormals[uIndex]); + } + }*/ + + /*template + void Mesh::generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices) + { + Vector3DFloat offset = static_cast(m_Region.getLowerCorner()); + + //Initially zero the normals + for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) + { + if(m_Region.containsPoint(iterVertex->getPosition() + offset, 0.001)) + { + iterVertex->setNormal(Vector3DFloat(0.0f,0.0f,0.0f)); + } + } + + for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) + { + PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; + iterIndex++; + PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; + iterIndex++; + PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; + iterIndex++; + + Vector3DFloat triangleNormal = (v1.getPosition()-v0.getPosition()).cross(v2.getPosition()-v0.getPosition()); + + if(m_Region.containsPoint(v0.getPosition() + offset, 0.001)) + { + v0.setNormal(v0.getNormal() + triangleNormal); + } + if(m_Region.containsPoint(v1.getPosition() + offset, 0.001)) + { + v1.setNormal(v1.getNormal() + triangleNormal); + } + if(m_Region.containsPoint(v2.getPosition() + offset, 0.001)) + { + v2.setNormal(v2.getNormal() + triangleNormal); + } + } + + if(bNormalise) + { + for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) + { + Vector3DFloat normal = iterVertex->getNormal(); + normal.normalise(); + iterVertex->setNormal(normal); + } + } + }*/ + + /*template + std::shared_ptr< Mesh > Mesh::extractSubset(std::set setMaterials) + { + std::shared_ptr< Mesh > result(new Mesh); + + if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... + { + return result; + } + + assert(m_vecLodRecords.size() == 1); + if(m_vecLodRecords.size() != 1) + { + //If we have done progressive LOD then it's too late to split into subsets. + return result; + } + + std::vector indexMap(m_vecVertices.size()); + std::fill(indexMap.begin(), indexMap.end(), -1); + + for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt += 3) + { + + PositionMaterialNormal& v0 = m_vecVertices[m_vecTriangleIndices[triCt]]; + PositionMaterialNormal& v1 = m_vecVertices[m_vecTriangleIndices[triCt + 1]]; + PositionMaterialNormal& v2 = m_vecVertices[m_vecTriangleIndices[triCt + 2]]; + + if( + (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || + (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || + (setMaterials.find(v2.getMaterial()) != setMaterials.end())) + { + uint32_t i0; + if(indexMap[m_vecTriangleIndices[triCt]] == -1) + { + indexMap[m_vecTriangleIndices[triCt]] = result->addVertex(v0); + } + i0 = indexMap[m_vecTriangleIndices[triCt]]; + + uint32_t i1; + if(indexMap[m_vecTriangleIndices[triCt+1]] == -1) + { + indexMap[m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); + } + i1 = indexMap[m_vecTriangleIndices[triCt+1]]; + + uint32_t i2; + if(indexMap[m_vecTriangleIndices[triCt+2]] == -1) + { + indexMap[m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); + } + i2 = indexMap[m_vecTriangleIndices[triCt+2]]; + + result->addTriangle(i0,i1,i2); + } + } + + result->m_vecLodRecords.clear(); + LodRecord lodRecord; + lodRecord.beginIndex = 0; + lodRecord.endIndex = result->getNoOfIndices(); + result->m_vecLodRecords.push_back(lodRecord); + + return result; + }*/ + + template + int Mesh::noOfDegenerateTris(void) + { + int count = 0; + for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) + { + int v0 = m_vecTriangleIndices[triCt]; + triCt++; + int v1 = m_vecTriangleIndices[triCt]; + triCt++; + int v2 = m_vecTriangleIndices[triCt]; + triCt++; + + if((v0 == v1) || (v1 == v2) || (v2 == v0)) + { + count++; + } + } + return count; + } + + template + void Mesh::removeDegenerateTris(void) + { + int noOfNonDegenerate = 0; + int targetCt = 0; + for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) + { + int v0 = m_vecTriangleIndices[triCt]; + triCt++; + int v1 = m_vecTriangleIndices[triCt]; + triCt++; + int v2 = m_vecTriangleIndices[triCt]; + triCt++; + + if((v0 != v1) && (v1 != v2) & (v2 != v0)) + { + m_vecTriangleIndices[targetCt] = v0; + targetCt++; + m_vecTriangleIndices[targetCt] = v1; + targetCt++; + m_vecTriangleIndices[targetCt] = v2; + targetCt++; + + noOfNonDegenerate++; + } + } + + m_vecTriangleIndices.resize(noOfNonDegenerate * 3); + } + + template + void Mesh::removeUnusedVertices(void) + { + std::vector isVertexUsed(m_vecVertices.size()); + std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); + + for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) + { + int v = m_vecTriangleIndices[triCt]; + isVertexUsed[v] = true; + } + + int noOfUsedVertices = 0; + std::vector newPos(m_vecVertices.size()); + for(uint32_t vertCt = 0; vertCt < m_vecVertices.size(); vertCt++) + { + if(isVertexUsed[vertCt]) + { + m_vecVertices[noOfUsedVertices] = m_vecVertices[vertCt]; + newPos[vertCt] = noOfUsedVertices; + noOfUsedVertices++; + } + } + + m_vecVertices.resize(noOfUsedVertices); + + for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) + { + m_vecTriangleIndices[triCt] = newPos[m_vecTriangleIndices[triCt]]; + } + } + + //Currently a free function - think where this needs to go. + template + std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials) + { + std::shared_ptr< Mesh > result(new Mesh); + + result->m_Region = inputMesh.m_Region; + + if(inputMesh.m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... + { + return result; + } + + POLYVOX_ASSERT(inputMesh.m_vecLodRecords.size() == 1, "Number of LOD records must equal one."); + if(inputMesh.m_vecLodRecords.size() != 1) + { + //If we have done progressive LOD then it's too late to split into subsets. + return result; + } + + std::vector indexMap(inputMesh.m_vecVertices.size()); + std::fill(indexMap.begin(), indexMap.end(), -1); + + for(uint32_t triCt = 0; triCt < inputMesh.m_vecTriangleIndices.size(); triCt += 3) + { + + VertexType& v0 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt]]; + VertexType& v1 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 1]]; + VertexType& v2 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 2]]; + + if( + (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || + (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || + (setMaterials.find(v2.getMaterial()) != setMaterials.end())) + { + uint32_t i0; + if(indexMap[inputMesh.m_vecTriangleIndices[triCt]] == -1) + { + indexMap[inputMesh.m_vecTriangleIndices[triCt]] = result->addVertex(v0); + } + i0 = indexMap[inputMesh.m_vecTriangleIndices[triCt]]; + + uint32_t i1; + if(indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] == -1) + { + indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); + } + i1 = indexMap[inputMesh.m_vecTriangleIndices[triCt+1]]; + + uint32_t i2; + if(indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] == -1) + { + indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); + } + i2 = indexMap[inputMesh.m_vecTriangleIndices[triCt+2]]; + + result->addTriangle(i0,i1,i2); + } + } + + result->m_vecLodRecords.clear(); + LodRecord lodRecord; + lodRecord.beginIndex = 0; + lodRecord.endIndex = result->getNoOfIndices(); + result->m_vecLodRecords.push_back(lodRecord); + + return result; + } + + template + void Mesh::scaleVertices(float amount) + { + for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) + { + //TODO: Should rethink accessors here to provide faster access + Vector3DFloat position = m_vecVertices[ct].getPosition(); + position *= amount; + m_vecVertices[ct].setPosition(position); + } + } + + template + void Mesh::translateVertices(const Vector3DFloat& amount) + { + for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) + { + //TODO: Should rethink accessors here to provide faster access + Vector3DFloat position = m_vecVertices[ct].getPosition(); + position += amount; + m_vecVertices[ct].setPosition(position); + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 0d68b3e9..3d9ef742 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -160,9 +160,9 @@ namespace PolyVox template class MarchingCubesSurfaceExtractor; //////////////////////////////////////////////////////////////////////////////// - // SurfaceMesh + // Mesh //////////////////////////////////////////////////////////////////////////////// - template class SurfaceMesh; + template class Mesh; //////////////////////////////////////////////////////////////////////////////// // Vector diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 7c74dee1..8476b7f8 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -130,7 +130,7 @@ void TestCubicSurfaceExtractor::testExecute() const static uint32_t uIndexToCheck = 2000; const static uint32_t uExpectedIndex = 1334; - SurfaceMesh mesh;*/ + Mesh mesh;*/ /*testForType(mesh); QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index c11541a5..2189b9c2 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -102,7 +102,7 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) // Runs the surface extractor for a given type. template -SurfaceMesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? +Mesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? { const int32_t uVolumeSideLength = 32; @@ -133,7 +133,7 @@ SurfaceMesh > testForType(void) //I think we coul return result; } -void testCustomController(SurfaceMesh >& result) +void testCustomController(Mesh >& result) { const int32_t uVolumeSideLength = 32; @@ -165,7 +165,7 @@ void TestSurfaceExtractor::testExecute() const static float fExpectedMaterial = 42.0f; const static float fNoMaterial = 1.0f; - SurfaceMesh > mesh; + Mesh > mesh; //Run the test for various voxel types. QBENCHMARK { mesh = testForType(); From e8313a683bd748ab36b2aff42ebdd16d28bd5320 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 15:32:28 +0200 Subject: [PATCH 059/259] Compile fixes for VS2012 --- examples/Basic/OpenGLWidget.cpp | 56 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 7fb5f2cb..824a6ca4 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -86,44 +86,44 @@ void OpenGLWidget::initializeGL() glDepthFunc(GL_LEQUAL); glDepthRange(0.0, 1.0); - if (!shader.addShaderFromSourceCode(QGLShader::Vertex, R"( - #version 140 + if (!shader.addShaderFromSourceCode(QGLShader::Vertex, + "#version 140\n" - in vec4 position; //This will be the position of the vertex in model-space + "in vec4 position; //This will be the position of the vertex in model-space\n" - uniform mat4 cameraToClipMatrix; - uniform mat4 worldToCameraMatrix; - uniform mat4 modelToWorldMatrix; + "uniform mat4 cameraToClipMatrix;\n" + "uniform mat4 worldToCameraMatrix;\n" + "uniform mat4 modelToWorldMatrix;\n" - out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals + "out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals\n" - void main() - { - worldPosition = modelToWorldMatrix * position; - vec4 cameraPosition = worldToCameraMatrix * worldPosition; - gl_Position = cameraToClipMatrix * cameraPosition; - } - )")) + "void main()\n" + "{\n" + " worldPosition = modelToWorldMatrix * position;\n" + " vec4 cameraPosition = worldToCameraMatrix * worldPosition;\n" + " gl_Position = cameraToClipMatrix * cameraPosition;\n" + "}\n" + )) { std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader.addShaderFromSourceCode(QGLShader::Fragment, R"( - #version 130 + if (!shader.addShaderFromSourceCode(QGLShader::Fragment, + "#version 130\n" - in vec4 worldPosition; //Passed in from the vertex shader + "in vec4 worldPosition; //Passed in from the vertex shader\n" - out vec4 outputColor; + "out vec4 outputColor;\n" - void main() - { - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + "void main()\n" + "{\n" + " vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz)));\n" - float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); - outputColor = vec4(1.0, 0.5, color, 1.0); - } - )")) + " float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1);\n" + " outputColor = vec4(1.0, 0.5, color, 1.0);\n" + "}" + )) { std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); @@ -149,7 +149,7 @@ void OpenGLWidget::resizeGL(int w, int h) float zNear = 1.0; float zFar = 1000.0; - QMatrix4x4 cameraToClipMatrix{}; + QMatrix4x4 cameraToClipMatrix; cameraToClipMatrix.frustum(-aspectRatio, aspectRatio, -1, 1, zNear, zFar); shader.bind(); @@ -162,7 +162,7 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - QMatrix4x4 modelToWorldMatrix{}; + QMatrix4x4 modelToWorldMatrix; //modelToWorldMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis //modelToWorldMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis //modelToWorldMatrix.translate(-32, -32, -32); //centre the model on the origin @@ -220,7 +220,7 @@ void OpenGLWidget::setupWorldToCameraMatrix() QVector3D centerPoint = (lowerCorner + upperCorner) * 0.5; float fDiagonalLength = (upperCorner - lowerCorner).length(); - QMatrix4x4 worldToCameraMatrix{}; + QMatrix4x4 worldToCameraMatrix; worldToCameraMatrix.translate(0, 0, -fDiagonalLength / 2.0f); //Move the camera back by the required amount worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis From 79acf814dbd25f1be87223665e4fcbbef114ab95 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 16:11:53 +0200 Subject: [PATCH 060/259] Revert "Compile fixes for VS2012" This reverts commit e8313a683bd748ab36b2aff42ebdd16d28bd5320. --- examples/Basic/OpenGLWidget.cpp | 56 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 824a6ca4..7fb5f2cb 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -86,44 +86,44 @@ void OpenGLWidget::initializeGL() glDepthFunc(GL_LEQUAL); glDepthRange(0.0, 1.0); - if (!shader.addShaderFromSourceCode(QGLShader::Vertex, - "#version 140\n" + if (!shader.addShaderFromSourceCode(QGLShader::Vertex, R"( + #version 140 - "in vec4 position; //This will be the position of the vertex in model-space\n" + in vec4 position; //This will be the position of the vertex in model-space - "uniform mat4 cameraToClipMatrix;\n" - "uniform mat4 worldToCameraMatrix;\n" - "uniform mat4 modelToWorldMatrix;\n" + uniform mat4 cameraToClipMatrix; + uniform mat4 worldToCameraMatrix; + uniform mat4 modelToWorldMatrix; - "out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals\n" + out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals - "void main()\n" - "{\n" - " worldPosition = modelToWorldMatrix * position;\n" - " vec4 cameraPosition = worldToCameraMatrix * worldPosition;\n" - " gl_Position = cameraToClipMatrix * cameraPosition;\n" - "}\n" - )) + void main() + { + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + gl_Position = cameraToClipMatrix * cameraPosition; + } + )")) { std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader.addShaderFromSourceCode(QGLShader::Fragment, - "#version 130\n" + if (!shader.addShaderFromSourceCode(QGLShader::Fragment, R"( + #version 130 - "in vec4 worldPosition; //Passed in from the vertex shader\n" + in vec4 worldPosition; //Passed in from the vertex shader - "out vec4 outputColor;\n" + out vec4 outputColor; - "void main()\n" - "{\n" - " vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz)));\n" + void main() + { + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); - " float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1);\n" - " outputColor = vec4(1.0, 0.5, color, 1.0);\n" - "}" - )) + float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); + outputColor = vec4(1.0, 0.5, color, 1.0); + } + )")) { std::cerr << shader.log().toStdString() << std::endl; exit(EXIT_FAILURE); @@ -149,7 +149,7 @@ void OpenGLWidget::resizeGL(int w, int h) float zNear = 1.0; float zFar = 1000.0; - QMatrix4x4 cameraToClipMatrix; + QMatrix4x4 cameraToClipMatrix{}; cameraToClipMatrix.frustum(-aspectRatio, aspectRatio, -1, 1, zNear, zFar); shader.bind(); @@ -162,7 +162,7 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - QMatrix4x4 modelToWorldMatrix; + QMatrix4x4 modelToWorldMatrix{}; //modelToWorldMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis //modelToWorldMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis //modelToWorldMatrix.translate(-32, -32, -32); //centre the model on the origin @@ -220,7 +220,7 @@ void OpenGLWidget::setupWorldToCameraMatrix() QVector3D centerPoint = (lowerCorner + upperCorner) * 0.5; float fDiagonalLength = (upperCorner - lowerCorner).length(); - QMatrix4x4 worldToCameraMatrix; + QMatrix4x4 worldToCameraMatrix{}; worldToCameraMatrix.translate(0, 0, -fDiagonalLength / 2.0f); //Move the camera back by the required amount worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis From 37bdf8e3ac2a4dc5f72298b605859e2d7ff61741 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 16:26:56 +0200 Subject: [PATCH 061/259] Templatised code for example mesh conversion. --- examples/Basic/OpenGLWidget.cpp | 23 +++++++++++++++++------ examples/Basic/OpenGLWidget.h | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index 7fb5f2cb..badf1cba 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -16,6 +16,17 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) } void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) +{ + setMeshToRenderImpl(surfaceMesh); +} + +void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) +{ + setMeshToRenderImpl(surfaceMesh); +} + +template +void OpenGLWidget::setMeshToRenderImpl(const MeshType& surfaceMesh) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -24,27 +35,27 @@ void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& s // This struct holds the OpenGL properties (buffer handles, etc) which will be used // to render our mesh. We copy the data from the PolyVox mesh into this structure. OpenGLMeshData meshData; - + //Create the VAO for the mesh glGenVertexArrays(1, &(meshData.vertexArrayObject)); glBindVertexArray(meshData.vertexArrayObject); - + //The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); - + //and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); - + //We need to tell OpenGL how to understand the format of the vertex data glEnableVertexAttribArray(0); //We're talking about shader attribute '0' glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - + glBindVertexArray(0); - + meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later mMeshData.push_back(meshData); diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 266ee0e6..8e6f048c 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -51,11 +51,15 @@ public: // Convert a SurfaceMesh to OpenGL index/vertex buffers void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); + void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); protected: + template + void setMeshToRenderImpl(const MeshType& surfaceMesh); + // Qt OpenGL functions void initializeGL(); void resizeGL(int w, int h); From 9f5b2e165926ebeadffb799cfb62dfaad887af41 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 17:02:46 +0200 Subject: [PATCH 062/259] Better templatization of addMesh. --- examples/Basic/OpenGLWidget.cpp | 46 --------------------------------- examples/Basic/OpenGLWidget.h | 43 +++++++++++++++++++++++++++--- examples/Basic/main.cpp | 4 +-- 3 files changed, 41 insertions(+), 52 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index badf1cba..edd75b55 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -15,52 +15,6 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } -void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) -{ - setMeshToRenderImpl(surfaceMesh); -} - -void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) -{ - setMeshToRenderImpl(surfaceMesh); -} - -template -void OpenGLWidget::setMeshToRenderImpl(const MeshType& surfaceMesh) -{ - //Convienient access to the vertices and indices - const auto& vecIndices = surfaceMesh.getIndices(); - const auto& vecVertices = surfaceMesh.getVertices(); - - // This struct holds the OpenGL properties (buffer handles, etc) which will be used - // to render our mesh. We copy the data from the PolyVox mesh into this structure. - OpenGLMeshData meshData; - - //Create the VAO for the mesh - glGenVertexArrays(1, &(meshData.vertexArrayObject)); - glBindVertexArray(meshData.vertexArrayObject); - - //The GL_ARRAY_BUFFER will contain the list of vertex positions - glGenBuffers(1, &(meshData.vertexBuffer)); - glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); - - //and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(meshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); - - //We need to tell OpenGL how to understand the format of the vertex data - glEnableVertexAttribArray(0); //We're talking about shader attribute '0' - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - - glBindVertexArray(0); - - meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later - - mMeshData.push_back(meshData); -} - void OpenGLWidget::setViewableRegion(Region viewableRegion) { m_viewableRegion = viewableRegion; diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 8e6f048c..7ac39928 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -50,15 +50,14 @@ public: void mousePressEvent(QMouseEvent* event); // Convert a SurfaceMesh to OpenGL index/vertex buffers - void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); - void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); + template + void addMesh(const MeshType& surfaceMesh); // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); protected: - template - void setMeshToRenderImpl(const MeshType& surfaceMesh); + // Qt OpenGL functions void initializeGL(); @@ -84,4 +83,40 @@ private: int m_yRotation; }; +template +void OpenGLWidget::addMesh(const MeshType& surfaceMesh) +{ + //Convienient access to the vertices and indices + const auto& vecIndices = surfaceMesh.getIndices(); + const auto& vecVertices = surfaceMesh.getVertices(); + + // This struct holds the OpenGL properties (buffer handles, etc) which will be used + // to render our mesh. We copy the data from the PolyVox mesh into this structure. + OpenGLMeshData meshData; + + //Create the VAO for the mesh + glGenVertexArrays(1, &(meshData.vertexArrayObject)); + glBindVertexArray(meshData.vertexArrayObject); + + //The GL_ARRAY_BUFFER will contain the list of vertex positions + glGenBuffers(1, &(meshData.vertexBuffer)); + glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); + + //and GL_ELEMENT_ARRAY_BUFFER will contain the indices + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); + + //We need to tell OpenGL how to understand the format of the vertex data + glEnableVertexAttribArray(0); //We're talking about shader attribute '0' + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + glBindVertexArray(0); + + meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later + + mMeshData.push_back(meshData); +} + #endif //__BasicExample_OpenGLWidget_H__ diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index c3a53f59..b422f1c4 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -85,9 +85,9 @@ int main(int argc, char *argv[]) //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window - openGLWidget.setMeshToRender(mesh); + openGLWidget.addMesh(mesh); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - //openGLWidget.setMeshToRender(mesh2); + //openGLWidget.addMesh(mesh2); //Run the message pump. return app.exec(); From 4f7e1e68460a60cd14cc6523e77ed5ba8095706f Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 22:03:57 +0200 Subject: [PATCH 063/259] Each mesh now has it's own transform matrix applied, so that our example framework can support breaking a volume into regions. --- examples/Basic/OpenGLWidget.cpp | 11 ++--- examples/Basic/OpenGLWidget.h | 80 ++++++++++++++++----------------- examples/Basic/main.cpp | 8 ++-- 3 files changed, 48 insertions(+), 51 deletions(-) diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index edd75b55..78dbff0c 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -127,17 +127,14 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - QMatrix4x4 modelToWorldMatrix{}; - //modelToWorldMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis - //modelToWorldMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis - //modelToWorldMatrix.translate(-32, -32, -32); //centre the model on the origin - shader.bind(); - shader.setUniformValue("modelToWorldMatrix", modelToWorldMatrix); //Update to the latest camera matrix - for (OpenGLMeshData meshData : mMeshData) { + QMatrix4x4 modelToWorldMatrix{}; + modelToWorldMatrix.translate(meshData.translation.getX(), meshData.translation.getY(), meshData.translation.getZ()); // Centre the model on the origin + shader.setUniformValue("modelToWorldMatrix", modelToWorldMatrix); // Update to the latest camera matrix + glBindVertexArray(meshData.vertexArrayObject); glDrawElements(GL_TRIANGLES, meshData.noOfIndices, GL_UNSIGNED_INT, 0); diff --git a/examples/Basic/OpenGLWidget.h b/examples/Basic/OpenGLWidget.h index 7ac39928..2d9cc6d6 100644 --- a/examples/Basic/OpenGLWidget.h +++ b/examples/Basic/OpenGLWidget.h @@ -37,6 +37,7 @@ struct OpenGLMeshData GLuint indexBuffer; GLuint vertexBuffer; GLuint vertexArrayObject; + PolyVox::Vector3DInt32 translation; }; class OpenGLWidget : public QGLWidget @@ -49,13 +50,48 @@ public: void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); - // Convert a SurfaceMesh to OpenGL index/vertex buffers - template - void addMesh(const MeshType& surfaceMesh); - // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); + // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. + template + void addMesh(const MeshType& surfaceMesh) + { + //Convienient access to the vertices and indices + const auto& vecIndices = surfaceMesh.getIndices(); + const auto& vecVertices = surfaceMesh.getVertices(); + + // This struct holds the OpenGL properties (buffer handles, etc) which will be used + // to render our mesh. We copy the data from the PolyVox mesh into this structure. + OpenGLMeshData meshData; + + //Create the VAO for the mesh + glGenVertexArrays(1, &(meshData.vertexArrayObject)); + glBindVertexArray(meshData.vertexArrayObject); + + //The GL_ARRAY_BUFFER will contain the list of vertex positions + glGenBuffers(1, &(meshData.vertexBuffer)); + glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); + + //and GL_ELEMENT_ARRAY_BUFFER will contain the indices + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); + + //We need to tell OpenGL how to understand the format of the vertex data + glEnableVertexAttribArray(0); //We're talking about shader attribute '0' + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + glBindVertexArray(0); + + meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later + + meshData.translation = surfaceMesh.m_Region.getLowerCorner(); + + mMeshData.push_back(meshData); + } + protected: @@ -83,40 +119,4 @@ private: int m_yRotation; }; -template -void OpenGLWidget::addMesh(const MeshType& surfaceMesh) -{ - //Convienient access to the vertices and indices - const auto& vecIndices = surfaceMesh.getIndices(); - const auto& vecVertices = surfaceMesh.getVertices(); - - // This struct holds the OpenGL properties (buffer handles, etc) which will be used - // to render our mesh. We copy the data from the PolyVox mesh into this structure. - OpenGLMeshData meshData; - - //Create the VAO for the mesh - glGenVertexArrays(1, &(meshData.vertexArrayObject)); - glBindVertexArray(meshData.vertexArrayObject); - - //The GL_ARRAY_BUFFER will contain the list of vertex positions - glGenBuffers(1, &(meshData.vertexBuffer)); - glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); - - //and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(meshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); - - //We need to tell OpenGL how to understand the format of the vertex data - glEnableVertexAttribArray(0); //We're talking about shader attribute '0' - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - - glBindVertexArray(0); - - meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later - - mMeshData.push_back(meshData); -} - #endif //__BasicExample_OpenGLWidget_H__ diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index b422f1c4..ee908dd7 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,16 +78,16 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); - //auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); - //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); + auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.addMesh(mesh); + openGLWidget.addMesh(mesh2); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - //openGLWidget.addMesh(mesh2); //Run the message pump. return app.exec(); From d34fd6b3c8d42b4ca1f3ebb9a909820ee99c89cd Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 22:11:47 +0200 Subject: [PATCH 064/259] Moved OpenGLWidget into common folder so it can be used by other examples. --- examples/Basic/CMakeLists.txt | 2 +- examples/Basic/main.cpp | 8 ++++---- examples/{Basic => common}/OpenGLWidget.cpp | 0 examples/{Basic => common}/OpenGLWidget.h | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename examples/{Basic => common}/OpenGLWidget.cpp (100%) rename examples/{Basic => common}/OpenGLWidget.h (100%) diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 02e203d2..30ca5f3e 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(BasicExample) #Projects source files SET(SRC_FILES main.cpp - OpenGLWidget.cpp + ../common/OpenGLWidget.cpp ) #Projects headers files diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index ee908dd7..f123361b 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,15 +78,15 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); - auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); - auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); + //auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.addMesh(mesh); - openGLWidget.addMesh(mesh2); + //openGLWidget.addMesh(mesh2); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); //Run the message pump. diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp similarity index 100% rename from examples/Basic/OpenGLWidget.cpp rename to examples/common/OpenGLWidget.cpp diff --git a/examples/Basic/OpenGLWidget.h b/examples/common/OpenGLWidget.h similarity index 100% rename from examples/Basic/OpenGLWidget.h rename to examples/common/OpenGLWidget.h From 34f57911a741603d404ef06c7dda2816b9d9df46 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 22:18:17 +0200 Subject: [PATCH 065/259] Converting OpenGLExample to use common OpenGLWidget. --- examples/OpenGL/CMakeLists.txt | 8 +- .../OpenGL/OpenGLImmediateModeSupport.cpp | 65 ----- examples/OpenGL/OpenGLImmediateModeSupport.h | 34 --- examples/OpenGL/OpenGLSupport.cpp | 66 ----- examples/OpenGL/OpenGLSupport.h | 40 --- .../OpenGLVertexBufferObjectSupport.cpp | 126 --------- .../OpenGL/OpenGLVertexBufferObjectSupport.h | 42 --- examples/OpenGL/OpenGLWidget.cpp | 246 ------------------ examples/OpenGL/OpenGLWidget.h | 99 ------- examples/OpenGL/main.cpp | 14 +- 10 files changed, 12 insertions(+), 728 deletions(-) delete mode 100644 examples/OpenGL/OpenGLImmediateModeSupport.cpp delete mode 100644 examples/OpenGL/OpenGLImmediateModeSupport.h delete mode 100644 examples/OpenGL/OpenGLSupport.cpp delete mode 100644 examples/OpenGL/OpenGLSupport.h delete mode 100644 examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp delete mode 100644 examples/OpenGL/OpenGLVertexBufferObjectSupport.h delete mode 100644 examples/OpenGL/OpenGLWidget.cpp delete mode 100644 examples/OpenGL/OpenGLWidget.h diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 5cd1ed55..dde5a41b 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -26,18 +26,12 @@ PROJECT(OpenGLExample) #Projects source files SET(SRC_FILES main.cpp - OpenGLImmediateModeSupport.cpp - OpenGLSupport.cpp - OpenGLVertexBufferObjectSupport.cpp - OpenGLWidget.cpp + ../common/OpenGLWidget.cpp Shapes.cpp ) #Projects headers files SET(INC_FILES - OpenGLImmediateModeSupport.h - OpenGLSupport.h - OpenGLVertexBufferObjectSupport.h OpenGLWidget.h Shapes.h ) diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp deleted file mode 100644 index ab2522bd..00000000 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLImmediateModeSupport.h" -#include "OpenGLSupport.h" - -#include "PolyVoxCore/Mesh.h" - -using namespace PolyVox; -using namespace std; - -void renderRegionImmediateMode(PolyVox::Mesh >& mesh, unsigned int uLodLevel) -{ - const vector >& vecVertices = mesh.getVertices(); - const vector& vecIndices = mesh.getIndices(); - - int beginIndex = mesh.m_vecLodRecords[uLodLevel].beginIndex; - int endIndex = mesh.m_vecLodRecords[uLodLevel].endIndex; - - glBegin(GL_TRIANGLES); - //for(vector::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex) - for(int index = beginIndex; index < endIndex; ++index) - { - const MarchingCubesVertex & vertex = vecVertices[vecIndices[index]]; - const Vector3DFloat& v3dVertexPos = vertex.getPosition(); - //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); - const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); - - - - - uint8_t material = static_cast(static_cast(vertex.getMaterial().getMaterial()) + 0.5); - //uint8_t material = 1; - - - OpenGLColour colour = convertMaterialIDToColour(material); - - glColor3f(colour.red, colour.green, colour.blue); - glNormal3f(vertex.getNormal().getX(), vertex.getNormal().getY(), vertex.getNormal().getZ()); - glVertex3f(v3dFinalVertexPos.getX(), v3dFinalVertexPos.getY(), v3dFinalVertexPos.getZ()); - - - } - glEnd(); -} \ No newline at end of file diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.h b/examples/OpenGL/OpenGLImmediateModeSupport.h deleted file mode 100644 index 3bc45a2b..00000000 --- a/examples/OpenGL/OpenGLImmediateModeSupport.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __OpenGLExample_OpenGLImmediateModeSupport_H__ -#define __OpenGLExample_OpenGLImmediateModeSupport_H__ - -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" - -#include "glew/glew.h" - -void renderRegionImmediateMode(PolyVox::Mesh >& mesh, unsigned int uLodLevel); - -#endif //__OpenGLExample_OpenGLImmediateModeSupport_H__ diff --git a/examples/OpenGL/OpenGLSupport.cpp b/examples/OpenGL/OpenGLSupport.cpp deleted file mode 100644 index 73efb444..00000000 --- a/examples/OpenGL/OpenGLSupport.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLSupport.h" - -using namespace PolyVox; - -OpenGLColour convertMaterialIDToColour(uint8_t materialID) -{ - OpenGLColour colour; - - switch(materialID) - { - case 1: - colour.red = 1.0f; - colour.green = 0.0f; - colour.blue = 0.0f; - break; - case 2: - colour.red = 0.0f; - colour.green = 1.0f; - colour.blue = 0.0f; - break; - case 3: - colour.red = 0.0f; - colour.green = 0.0f; - colour.blue = 1.0f; - break; - case 4: - colour.red = 1.0f; - colour.green = 1.0f; - colour.blue = 0.0f; - break; - case 5: - colour.red = 1.0f; - colour.green = 0.0f; - colour.blue = 1.0f; - break; - default: - colour.red = 1.0f; - colour.green = 1.0f; - colour.blue = 1.0f; - } - - return colour; -} \ No newline at end of file diff --git a/examples/OpenGL/OpenGLSupport.h b/examples/OpenGL/OpenGLSupport.h deleted file mode 100644 index 2d4d1185..00000000 --- a/examples/OpenGL/OpenGLSupport.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __OpenGLExample_OpenGLSupport_H__ -#define __OpenGLExample_OpenGLSupport_H__ - -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" - -#include "glew/glew.h" - -struct OpenGLColour -{ - GLfloat red; - GLfloat green; - GLfloat blue; -}; - -OpenGLColour convertMaterialIDToColour(uint8_t materialID); - -#endif //__OpenGLExample_OpenGLSupport_H__ \ No newline at end of file diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp deleted file mode 100644 index 17e9e138..00000000 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLSupport.h" -#include "OpenGLVertexBufferObjectSupport.h" - -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/Mesh.h" - -using namespace PolyVox; -using namespace std; - -OpenGLMesh BuildOpenGLMesh(const Mesh >& mesh) -{ - //Represents our filled in OpenGL vertex and index buffer objects. - OpenGLMesh result; - - //The source - result.sourceMesh = &mesh; - - //Convienient access to the vertices and indices - const vector >& vecVertices = mesh.getVertices(); - const vector& vecIndices = mesh.getIndices(); - - //If we have any indices... - if(!vecIndices.empty()) - { - //Create an OpenGL index buffer - glGenBuffers(1, &result.indexBuffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, result.indexBuffer); - - //Get a pointer to the first index - GLvoid* pIndices = (GLvoid*)(&(vecIndices[0])); - - //Fill the OpenGL index buffer with our data. - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); - } - - result.noOfIndices = vecIndices.size(); - - glGenBuffers(1, &result.vertexBuffer); - glBindBuffer(GL_ARRAY_BUFFER, result.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(GLfloat) * 9, 0, GL_STATIC_DRAW); - GLfloat* ptr = (GLfloat*)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); - - for (vector >::const_iterator iterVertex = vecVertices.begin(); iterVertex != vecVertices.end(); ++iterVertex) - { - const MarchingCubesVertex & vertex = *iterVertex; - const Vector3DFloat& v3dVertexPos = vertex.getPosition(); - //const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength); - const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast(mesh.m_Region.getLowerCorner()); - - *ptr = v3dFinalVertexPos.getX(); - ptr++; - *ptr = v3dFinalVertexPos.getY(); - ptr++; - *ptr = v3dFinalVertexPos.getZ(); - ptr++; - - *ptr = vertex.getNormal().getX(); - ptr++; - *ptr = vertex.getNormal().getY(); - ptr++; - *ptr = vertex.getNormal().getZ(); - ptr++; - - uint8_t material = static_cast(vertex.getMaterial().getMaterial() + 0.5); - //uint8_t material = 1; - - OpenGLColour colour = convertMaterialIDToColour(material); - - *ptr = colour.red; - ptr++; - *ptr = colour.green; - ptr++; - *ptr = colour.blue; - ptr++; - } - - glUnmapBuffer(GL_ARRAY_BUFFER); - - return result; -} - -void renderRegionVertexBufferObject(const OpenGLMesh& openGLMesh, unsigned int uLodLevel) -{ - int beginIndex = openGLMesh.sourceMesh->m_vecLodRecords[uLodLevel].beginIndex; - int endIndex = openGLMesh.sourceMesh->m_vecLodRecords[uLodLevel].endIndex; - glBindBuffer(GL_ARRAY_BUFFER, openGLMesh.vertexBuffer); - glVertexPointer(3, GL_FLOAT, 36, 0); - glNormalPointer(GL_FLOAT, 36, (GLvoid*)12); - glColorPointer(3, GL_FLOAT, 36, (GLvoid*)24); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, openGLMesh.indexBuffer); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - - //glDrawElements(GL_TRIANGLES, openGLMesh.noOfIndices, GL_UNSIGNED_INT, 0); - glDrawRangeElements(GL_TRIANGLES, beginIndex, endIndex-1, endIndex - beginIndex,/* openGLMesh.noOfIndices,*/ GL_UNSIGNED_INT, 0); - - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); -} \ No newline at end of file diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h b/examples/OpenGL/OpenGLVertexBufferObjectSupport.h deleted file mode 100644 index e82a8c29..00000000 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __OpenGLExample_OpenGLVertexBufferObjectSupport_H__ -#define __OpenGLExample_OpenGLVertexBufferObjectSupport_H__ - -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" - -#include "glew/glew.h" - -struct OpenGLMesh -{ - GLulong noOfIndices; - GLuint indexBuffer; - GLuint vertexBuffer; - const PolyVox::Mesh >* sourceMesh; -}; - -OpenGLMesh BuildOpenGLMesh(const PolyVox::Mesh >& mesh); -void renderRegionVertexBufferObject(const OpenGLMesh& openGLMesh, unsigned int uLodLevel); - -#endif //__OpenGLExample_OpenGLVertexBufferObjectSupport_H__ diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp deleted file mode 100644 index 38c107a9..00000000 --- a/examples/OpenGL/OpenGLWidget.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLWidget.h" - -#include - -#include "PolyVoxCore/GradientEstimators.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" - -//Some namespaces we need -using namespace std; -using namespace PolyVox; -using namespace std; - -OpenGLWidget::OpenGLWidget(QWidget *parent) - :QGLWidget(parent) - ,m_volData(0) -{ - m_xRotation = 0; - m_yRotation = 0; - m_uRegionSideLength = 32; - - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(update())); - timer->start(0); -} - -void OpenGLWidget::setVolume(PolyVox::LargeVolume* volData) -{ - //First we free anything from the previous volume (if there was one). - m_mapOpenGLMeshes.clear(); - m_mapMeshes.clear(); - m_volData = volData; - - //If we have any volume data then generate the new surface patches. - if(m_volData != 0) - { - m_uVolumeWidthInRegions = volData->getWidth() / m_uRegionSideLength; - m_uVolumeHeightInRegions = volData->getHeight() / m_uRegionSideLength; - m_uVolumeDepthInRegions = volData->getDepth() / m_uRegionSideLength; - - //Our volume is broken down into cuboid regions, and we create one mesh for each region. - //This three-level for loop iterates over each region. - for(uint16_t uRegionZ = 0; uRegionZ < m_uVolumeDepthInRegions; ++uRegionZ) - { - std::cout << "uRegionZ = " << uRegionZ << " of " << m_uVolumeDepthInRegions << std::endl; - for(uint16_t uRegionY = 0; uRegionY < m_uVolumeHeightInRegions; ++uRegionY) - { - for(uint16_t uRegionX = 0; uRegionX < m_uVolumeWidthInRegions; ++uRegionX) - { - //Compute the extents of the current region - //FIXME - This is a little complex? PolyVox could - //provide more functions for dealing with regions? - int32_t regionStartX = uRegionX * m_uRegionSideLength; - int32_t regionStartY = uRegionY * m_uRegionSideLength; - int32_t regionStartZ = uRegionZ * m_uRegionSideLength; - - int32_t regionEndX = regionStartX + m_uRegionSideLength; - int32_t regionEndY = regionStartY + m_uRegionSideLength; - int32_t regionEndZ = regionStartZ + m_uRegionSideLength; - - Vector3DInt32 regLowerCorner(regionStartX, regionStartY, regionStartZ); - Vector3DInt32 regUpperCorner(regionEndX, regionEndY, regionEndZ); - - //Extract the surface for this region - //extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent); - - std::shared_ptr< Mesh > > mesh(new Mesh >); - MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get()); - surfaceExtractor.execute(); - - //decimatedMesh->generateAveragedFaceNormals(true); - - //computeNormalsForVertices(m_volData, *(decimatedMesh.get()), SOBEL_SMOOTHED); - //*meshCurrent = getSmoothedSurface(*meshCurrent); - //mesh->smooth(0.3f); - //meshCurrent->generateAveragedFaceNormals(true); - - if(mesh->m_vecTriangleIndices.size() > 0) - { - - - Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); - if(m_bUseOpenGLVertexBufferObjects) - { - OpenGLMesh openGLMesh = BuildOpenGLMesh(*(mesh.get())); - m_mapOpenGLMeshes.insert(make_pair(v3dRegPos, openGLMesh)); - } - //else - //{ - m_mapMeshes.insert(make_pair(v3dRegPos, mesh)); - //} - //delete meshCurrent; - } - } - } - } - - //Projection matrix is dependant on volume size, so we need to set it up again. - setupProjectionMatrix(); - } -} - -void OpenGLWidget::initializeGL() -{ - m_bUseOpenGLVertexBufferObjects = true; - if(m_bUseOpenGLVertexBufferObjects) - { - //We need GLEW to access recent OpenGL functionality - GLenum err = glewInit(); - if (GLEW_OK != err) - { - /* Problem: glewInit failed, something is seriously wrong. */ - cout << "GLEW Error: " << glewGetErrorString(err) << endl; - } - } - - glShadeModel(GL_SMOOTH); // Enable Smooth Shading - glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background - glClearDepth(1.0f); // Depth Buffer Setup - glEnable(GL_DEPTH_TEST); // Enables Depth Testing - glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do - glEnable ( GL_COLOR_MATERIAL ); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - - glEnable(GL_LIGHTING); - glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); - glEnable(GL_LIGHT0); - - //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glShadeModel(GL_SMOOTH); -} - -void OpenGLWidget::resizeGL(int w, int h) -{ - //Setup the viewport based on the window size - glViewport(0, 0, w, h); - - //Projection matrix is also dependant on the size of the current volume. - if(m_volData) - { - setupProjectionMatrix(); - } -} - -void OpenGLWidget::paintGL() -{ - if(m_volData) - { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer - - glMatrixMode(GL_MODELVIEW); // Select The Model View Matrix - glLoadIdentity(); // Reset The Current Modelview Matrix - - //Moves the camera back so we can see the volume - glTranslatef(0.0f, 0.0f, -m_volData->getDiagonalLength()); - - glRotatef(m_xRotation, 1.0f, 0.0f, 0.0f); - glRotatef(m_yRotation, 0.0f, 1.0f, 0.0f); - - //Centre the volume on the origin - glTranslatef(-g_uVolumeSideLength/2,-g_uVolumeSideLength/2,-g_uVolumeSideLength/2); - - for(uint16_t uRegionZ = 0; uRegionZ < m_uVolumeDepthInRegions; ++uRegionZ) - { - for(uint16_t uRegionY = 0; uRegionY < m_uVolumeHeightInRegions; ++uRegionY) - { - for(uint16_t uRegionX = 0; uRegionX < m_uVolumeWidthInRegions; ++uRegionX) - { - Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); - if(m_mapMeshes.find(v3dRegPos) != m_mapMeshes.end()) - { - std::shared_ptr< Mesh > > meshCurrent = m_mapMeshes[v3dRegPos]; - unsigned int uLodLevel = 0; //meshCurrent->m_vecLodRecords.size() - 1; - if(m_bUseOpenGLVertexBufferObjects) - { - renderRegionVertexBufferObject(m_mapOpenGLMeshes[v3dRegPos], uLodLevel); - } - else - { - renderRegionImmediateMode(*meshCurrent, uLodLevel); - } - } - } - } - } - - GLenum errCode; - const GLubyte *errString; - - if ((errCode = glGetError()) != GL_NO_ERROR) - { - errString = gluErrorString(errCode); - cout << "OpenGL Error: " << errString << endl; - } - } -} - -void OpenGLWidget::mousePressEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - m_LastFrameMousePos = m_CurrentMousePos; -} - -void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; - m_xRotation += diff.x(); - m_yRotation += diff.y(); - m_LastFrameMousePos = m_CurrentMousePos;; -} - -void OpenGLWidget::setupProjectionMatrix(void) -{ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - float frustumSize = m_volData->getDiagonalLength() / 2.0f; - float aspect = static_cast(width()) / static_cast(height()); - - glOrtho(frustumSize*aspect, -frustumSize*aspect, frustumSize, -frustumSize, 1.0, 5000); -} diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h deleted file mode 100644 index 3511ac75..00000000 --- a/examples/OpenGL/OpenGLWidget.h +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_OpenGLWidget_H__ -#define __PolyVox_OpenGLWidget_H__ - -#include "glew/glew.h" - -#include -#include - -#include "PolyVoxCore/LargeVolume.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/Impl/Utility.h" - -#include "OpenGLImmediateModeSupport.h" -#include "OpenGLVertexBufferObjectSupport.h" -#include "Shapes.h" - -const int32_t g_uVolumeSideLength = 128; - -struct Vector3DUint8Compare -{ - bool operator() (const PolyVox::Vector3DUint8& a, const PolyVox::Vector3DUint8& b) const - { - const uint32_t size = 3; - for(uint32_t ct = 0; ct < size; ++ct) - { - if (a.getElement(ct) < b.getElement(ct)) - return true; - if (b.getElement(ct) < a.getElement(ct)) - return false; - } - return false; - } -}; - -class OpenGLWidget : public QGLWidget - { - - public: - OpenGLWidget(QWidget *parent); - - void setVolume(PolyVox::LargeVolume* volData); - - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - - protected: - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - - private: - void setupProjectionMatrix(void); - QPoint m_LastFrameMousePos; - QPoint m_CurrentMousePos; - - int m_xRotation; - int m_yRotation; - - QTimer *timer; - - bool m_bUseOpenGLVertexBufferObjects; - - //Creates a volume 128x128x128 - PolyVox::LargeVolume* m_volData; - - //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region - std::map m_mapOpenGLMeshes; - std::map > >, Vector3DUint8Compare> m_mapMeshes; - - unsigned int m_uRegionSideLength; - unsigned int m_uVolumeWidthInRegions; - unsigned int m_uVolumeHeightInRegions; - unsigned int m_uVolumeDepthInRegions; - }; - -#endif //__PolyVox_OpenGLWidget_H__ diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index ab70e957..e27987db 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -22,6 +22,7 @@ freely, subject to the following restrictions: *******************************************************************************/ #include "PolyVoxCore/FilePager.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/LargeVolume.h" #include "PolyVoxCore/LowPassFilter.h" @@ -30,8 +31,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/Impl/Utility.h" -#include "OpenGLImmediateModeSupport.h" -#include "OpenGLVertexBufferObjectSupport.h" #include "Shapes.h" #include "OpenGLWidget.h" @@ -48,6 +47,8 @@ using namespace std; using namespace PolyVox; using namespace std; +const int32_t g_uVolumeSideLength = 128; + int main(int argc, char *argv[]) { RLEBlockCompressor* compressor = new RLEBlockCompressor(); @@ -98,9 +99,16 @@ int main(int argc, char *argv[]) QTime time; time.start(); - openGLWidget.setVolume(&volData); + //openGLWidget.setVolume(&volData); cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl; + auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(mesh); + //openGLWidget.addMesh(mesh2); + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + //return 0; return app.exec(); From 6cbb2d44bfbfa37c71a3c6b0fcfbe069c5c69315 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 23 May 2014 22:44:58 +0200 Subject: [PATCH 066/259] Work on making OpenGLExample work with common example framework. --- examples/OpenGL/main.cpp | 56 +++++++++++++++++++++++++++----- examples/common/OpenGLWidget.cpp | 39 ++++++++++------------ examples/common/OpenGLWidget.h | 11 ++++++- 3 files changed, 74 insertions(+), 32 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index e27987db..962079f4 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -81,15 +81,6 @@ int main(int argc, char *argv[]) createCubeInVolume(volData, Vector3DInt32(midPos-10, 1, midPos-10), Vector3DInt32(midPos+10, maxPos-1, midPos+10), MaterialDensityPair44::getMaxDensity()); createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity()); - //I've removed this smoothing because it doesn't really make sense to apply a low pass filter to a volume with material values. - //I could implement the mathematical operators for MaterialDensityPair in such a way that they ignores the materials but this - //seems to be setting a bad example. Users can add this operators in their own classes if they want smoothing. - //RawVolume tempVolume(PolyVox::Region(0,0,0,128, 128, 128)); - //LowPassFilter< LargeVolume, RawVolume > pass1(&volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3); - //pass1.executeSAT(); - //LowPassFilter< RawVolume, LargeVolume > pass2(&tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3); - //pass2.executeSAT(); - QApplication app(argc, argv); OpenGLWidget openGLWidget(0); @@ -97,6 +88,53 @@ int main(int argc, char *argv[]) openGLWidget.show(); + QGLShaderProgram* shader = new QGLShaderProgram; + + if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( + #version 140 + + in vec4 position; //This will be the position of the vertex in model-space + + uniform mat4 cameraToClipMatrix; + uniform mat4 worldToCameraMatrix; + uniform mat4 modelToWorldMatrix; + + out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals + + void main() + { + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + gl_Position = cameraToClipMatrix * cameraPosition; + } + )")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + if (!shader->addShaderFromSourceCode(QGLShader::Fragment, R"( + #version 130 + + in vec4 worldPosition; //Passed in from the vertex shader + + out vec4 outputColor; + + void main() + { + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); + outputColor = vec4(1.0, 1.0, 1.0, 1.0); + } + )")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + openGLWidget.setShader(shader); + QTime time; time.start(); //openGLWidget.setVolume(&volData); diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 78dbff0c..1088d9fe 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -50,8 +50,10 @@ void OpenGLWidget::initializeGL() glDepthMask(GL_TRUE); glDepthFunc(GL_LEQUAL); glDepthRange(0.0, 1.0); + + shader = new QGLShaderProgram; - if (!shader.addShaderFromSourceCode(QGLShader::Vertex, R"( + if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 in vec4 position; //This will be the position of the vertex in model-space @@ -70,11 +72,11 @@ void OpenGLWidget::initializeGL() } )")) { - std::cerr << shader.log().toStdString() << std::endl; + std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader.addShaderFromSourceCode(QGLShader::Fragment, R"( + if (!shader->addShaderFromSourceCode(QGLShader::Fragment, R"( #version 130 in vec4 worldPosition; //Passed in from the vertex shader @@ -90,15 +92,15 @@ void OpenGLWidget::initializeGL() } )")) { - std::cerr << shader.log().toStdString() << std::endl; + std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - shader.bindAttributeLocation("position", 0); + shader->bindAttributeLocation("position", 0); - if(!shader.link()) + if (!shader->link()) { - std::cerr << shader.log().toStdString() << std::endl; + std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } @@ -114,12 +116,8 @@ void OpenGLWidget::resizeGL(int w, int h) float zNear = 1.0; float zFar = 1000.0; - QMatrix4x4 cameraToClipMatrix{}; + cameraToClipMatrix.setToIdentity(); cameraToClipMatrix.frustum(-aspectRatio, aspectRatio, -1, 1, zNear, zFar); - - shader.bind(); - shader.setUniformValue("cameraToClipMatrix", cameraToClipMatrix); - shader.release(); } void OpenGLWidget::paintGL() @@ -127,13 +125,16 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - shader.bind(); + shader->bind(); + + shader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); + shader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); for (OpenGLMeshData meshData : mMeshData) { QMatrix4x4 modelToWorldMatrix{}; modelToWorldMatrix.translate(meshData.translation.getX(), meshData.translation.getY(), meshData.translation.getZ()); // Centre the model on the origin - shader.setUniformValue("modelToWorldMatrix", modelToWorldMatrix); // Update to the latest camera matrix + shader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); // Update to the latest camera matrix glBindVertexArray(meshData.vertexArrayObject); @@ -142,7 +143,7 @@ void OpenGLWidget::paintGL() glBindVertexArray(0); } - shader.release(); + shader->release(); GLenum errCode = glGetError(); if(errCode != GL_NO_ERROR) @@ -174,21 +175,15 @@ void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) void OpenGLWidget::setupWorldToCameraMatrix() { - shader.bind(); - QVector3D lowerCorner(m_viewableRegion.getLowerX(), m_viewableRegion.getLowerY(), m_viewableRegion.getLowerZ()); QVector3D upperCorner(m_viewableRegion.getUpperX(), m_viewableRegion.getUpperY(), m_viewableRegion.getUpperZ()); QVector3D centerPoint = (lowerCorner + upperCorner) * 0.5; float fDiagonalLength = (upperCorner - lowerCorner).length(); - QMatrix4x4 worldToCameraMatrix{}; + worldToCameraMatrix.setToIdentity(); worldToCameraMatrix.translate(0, 0, -fDiagonalLength / 2.0f); //Move the camera back by the required amount worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis worldToCameraMatrix.translate(-centerPoint); //centre the model on the origin - - shader.setUniformValue("worldToCameraMatrix", worldToCameraMatrix); - - shader.release(); } \ No newline at end of file diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 2d9cc6d6..d80b7a70 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -53,6 +53,11 @@ public: // The viewable region can be adjusted so that this example framework can be use for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); + void setShader(QGLShaderProgram* shader) + { + this->shader = shader; + } + // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. template void addMesh(const MeshType& surfaceMesh) @@ -107,7 +112,11 @@ private: // Index/vertex buffer data std::vector mMeshData; - QGLShaderProgram shader; + QGLShaderProgram* shader; + + // Matrices + QMatrix4x4 worldToCameraMatrix; + QMatrix4x4 cameraToClipMatrix; // Mouse data QPoint m_LastFrameMousePos; From f65edddd816d780aba3ffe36e7379b3678f79ea1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 08:38:18 +0200 Subject: [PATCH 067/259] Tidying up. --- examples/common/OpenGLWidget.h | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 5 ++++- library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h | 10 ++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index d80b7a70..96102a99 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -77,7 +77,7 @@ public: //The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); @@ -86,7 +86,7 @@ public: //We need to tell OpenGL how to understand the format of the vertex data glEnableVertexAttribArray(0); //We're talking about shader attribute '0' - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) glBindVertexArray(0); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 90ebbfac..bcb40576 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -45,10 +45,13 @@ namespace PolyVox int endIndex; //Let's put it just past the end STL style }; - template + template class Mesh { public: + + typedef _VertexType VertexType; + Mesh(); ~Mesh(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index a5a24d79..e8d938ae 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -36,11 +36,14 @@ namespace PolyVox #ifdef SWIG class CubicVertex #else - template + template class POLYVOX_API CubicVertex #endif { public: + + typedef _VoxelType VoxelType; + CubicVertex() { } @@ -97,11 +100,14 @@ namespace PolyVox #ifdef SWIG class MarchingCubesVertex #else - template + template class POLYVOX_API MarchingCubesVertex #endif { public: + + typedef _VoxelType VoxelType; + MarchingCubesVertex() { } From aace1f2e36f49ba20e8947040826b1854f683089 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 09:38:01 +0200 Subject: [PATCH 068/259] Exposing normals to example framework. --- examples/OpenGL/main.cpp | 16 ++++++++++++---- examples/common/OpenGLWidget.cpp | 4 +++- examples/common/OpenGLWidget.h | 5 ++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 962079f4..b52b4860 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -93,17 +93,20 @@ int main(int argc, char *argv[]) if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 - in vec4 position; //This will be the position of the vertex in model-space + in vec4 position; // This will be the position of the vertex in model-space + in vec4 normal; // The normal data may not have been set uniform mat4 cameraToClipMatrix; uniform mat4 worldToCameraMatrix; uniform mat4 modelToWorldMatrix; out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals + out vec4 worldNormal; void main() { worldPosition = modelToWorldMatrix * position; + worldNormal = normal; vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; } @@ -117,15 +120,20 @@ int main(int argc, char *argv[]) #version 130 in vec4 worldPosition; //Passed in from the vertex shader + in vec4 worldNormal; out vec4 outputColor; void main() { - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + //vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + vec3 normal = worldNormal.xyz; + + outputColor = vec4(normalize(normal.xyz), 1.0); - float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); - outputColor = vec4(1.0, 1.0, 1.0, 1.0); + //float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); + //outputColor = vec4(1.0, 0.5, color, 1.0); } )")) { diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 1088d9fe..93d1a369 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -56,7 +56,7 @@ void OpenGLWidget::initializeGL() if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 - in vec4 position; //This will be the position of the vertex in model-space + in vec4 position; // This will be the position of the vertex in model-space uniform mat4 cameraToClipMatrix; uniform mat4 worldToCameraMatrix; @@ -80,6 +80,7 @@ void OpenGLWidget::initializeGL() #version 130 in vec4 worldPosition; //Passed in from the vertex shader + in vec4 worldNormal; out vec4 outputColor; @@ -97,6 +98,7 @@ void OpenGLWidget::initializeGL() } shader->bindAttributeLocation("position", 0); + shader->bindAttributeLocation("normal", 1); if (!shader->link()) { diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 96102a99..eff6366a 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -86,7 +86,10 @@ public: //We need to tell OpenGL how to understand the format of the vertex data glEnableVertexAttribArray(0); //We're talking about shader attribute '0' - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + glEnableVertexAttribArray(1); //We're talking about shader attribute '1' + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); glBindVertexArray(0); From 07b9cf05fabcacf515bb4a1fc07afecd4178cbc6 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 21:09:26 +0200 Subject: [PATCH 069/259] Changed OpenGLExample to use MaterialDensityPair88 instead of MaterialDensityPair44. Added material to shaders. --- examples/OpenGL/Shapes.cpp | 12 ++++++------ examples/OpenGL/Shapes.h | 4 ++-- examples/OpenGL/main.cpp | 28 ++++++++++++++++++++++++---- examples/common/OpenGLWidget.cpp | 1 + examples/common/OpenGLWidget.h | 3 +++ 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 558530ba..7a66b988 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: using namespace PolyVox; -void createSphereInVolume(LargeVolume& volData, float fRadius, uint8_t uValue) +void createSphereInVolume(LargeVolume& volData, float fRadius, uint8_t uValue) { //This vector hold the position of the center of the volume Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); @@ -48,17 +48,17 @@ void createSphereInVolume(LargeVolume& volData, float fRa //then we make it solid, otherwise we make it empty space. if(fDistToCenter <= fRadius) { - volData.setVoxelAt(x,y,z, MaterialDensityPair44(uValue, uValue > 0 ? MaterialDensityPair44::getMaxDensity() : MaterialDensityPair44::getMinDensity())); + volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? MaterialDensityPair88::getMaxDensity() : MaterialDensityPair88::getMinDensity())); } } } } } -void createCubeInVolume(LargeVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) +void createCubeInVolume(LargeVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) { - uint8_t maxDen = MaterialDensityPair44::getMaxDensity(); - uint8_t minDen = MaterialDensityPair44::getMinDensity(); + uint8_t maxDen = MaterialDensityPair88::getMaxDensity(); + uint8_t minDen = MaterialDensityPair88::getMinDensity(); //This three-level for loop iterates over every voxel between the specified corners for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++) { @@ -66,7 +66,7 @@ void createCubeInVolume(LargeVolume& volData, Vector3DInt { for (int x = lowerCorner.getX() ; x <= upperCorner.getX(); x++) { - volData.setVoxelAt(x,y,z, MaterialDensityPair44(uValue, uValue > 0 ? maxDen : minDen)); + volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? maxDen : minDen)); } } } diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index 93f047fd..712558fd 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/LargeVolume.h" #include "PolyVoxCore/MaterialDensityPair.h" -void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); -void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); +void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); +void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); #endif //__OpenGLExample_Shapes_H__ \ No newline at end of file diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index b52b4860..03014c72 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -51,9 +51,9 @@ const int32_t g_uVolumeSideLength = 128; int main(int argc, char *argv[]) { - RLEBlockCompressor* compressor = new RLEBlockCompressor(); - FilePager* pager = new FilePager("./"); - LargeVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(g_uVolumeSideLength-1, g_uVolumeSideLength-1, g_uVolumeSideLength-1)), compressor, pager); + RLEBlockCompressor* compressor = new RLEBlockCompressor(); + FilePager* pager = new FilePager("./"); + LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), compressor, pager); //Make our volume contain a sphere in the center. int32_t minPos = 0; @@ -95,6 +95,7 @@ int main(int argc, char *argv[]) in vec4 position; // This will be the position of the vertex in model-space in vec4 normal; // The normal data may not have been set + in vec2 material; uniform mat4 cameraToClipMatrix; uniform mat4 worldToCameraMatrix; @@ -102,11 +103,14 @@ int main(int argc, char *argv[]) out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals out vec4 worldNormal; + out vec2 outMaterial; void main() { + //material = vec2( worldPosition = modelToWorldMatrix * position; worldNormal = normal; + outMaterial = vec2(material.x, material.y); vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; } @@ -121,6 +125,7 @@ int main(int argc, char *argv[]) in vec4 worldPosition; //Passed in from the vertex shader in vec4 worldNormal; + in vec2 outMaterial; out vec4 outputColor; @@ -130,7 +135,22 @@ int main(int argc, char *argv[]) vec3 normal = worldNormal.xyz; - outputColor = vec4(normalize(normal.xyz), 1.0); + if(outMaterial.x < 1.5) + { + outputColor = vec4(1.0, 0.0, 0.0, 1.0); + } + else if(outMaterial.x < 2.5) + { + outputColor = vec4(0.0, 1.0, 0.0, 1.0); + } + else if(outMaterial.x < 3.5) + { + outputColor = vec4(0.0, 0.0, 1.0, 1.0); + } + else + { + outputColor = vec4(1.0, 1.0, 0.0, 1.0); + } //float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); //outputColor = vec4(1.0, 0.5, color, 1.0); diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 93d1a369..1777ba54 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -99,6 +99,7 @@ void OpenGLWidget::initializeGL() shader->bindAttributeLocation("position", 0); shader->bindAttributeLocation("normal", 1); + shader->bindAttributeLocation("material", 2); if (!shader->link()) { diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index eff6366a..521f239e 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -91,6 +91,9 @@ public: glEnableVertexAttribArray(1); //We're talking about shader attribute '1' glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); + glEnableVertexAttribArray(2); //We're talking about shader attribute '2' + glVertexAttribPointer(2, 2, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material))); + glBindVertexArray(0); meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later From 99cf75e9027a0a427e9fd760bc91ad744b2cb448 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 22:53:10 +0200 Subject: [PATCH 070/259] Material now passed to shader as integer rather than float. --- examples/OpenGL/main.cpp | 14 +++++++------- examples/common/OpenGLWidget.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 03014c72..4f4d9d15 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) in vec4 position; // This will be the position of the vertex in model-space in vec4 normal; // The normal data may not have been set - in vec2 material; + in ivec2 material; uniform mat4 cameraToClipMatrix; uniform mat4 worldToCameraMatrix; @@ -103,14 +103,14 @@ int main(int argc, char *argv[]) out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals out vec4 worldNormal; - out vec2 outMaterial; + flat out ivec2 outMaterial; void main() { //material = vec2( worldPosition = modelToWorldMatrix * position; worldNormal = normal; - outMaterial = vec2(material.x, material.y); + outMaterial = ivec2(material.x, material.y); vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; } @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) in vec4 worldPosition; //Passed in from the vertex shader in vec4 worldNormal; - in vec2 outMaterial; + flat in ivec2 outMaterial; out vec4 outputColor; @@ -135,15 +135,15 @@ int main(int argc, char *argv[]) vec3 normal = worldNormal.xyz; - if(outMaterial.x < 1.5) + if(outMaterial.x == 1) { outputColor = vec4(1.0, 0.0, 0.0, 1.0); } - else if(outMaterial.x < 2.5) + else if(outMaterial.x == 2) { outputColor = vec4(0.0, 1.0, 0.0, 1.0); } - else if(outMaterial.x < 3.5) + else if(outMaterial.x == 3) { outputColor = vec4(0.0, 0.0, 1.0, 1.0); } diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 521f239e..a1c1c37c 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -92,7 +92,8 @@ public: glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - glVertexAttribPointer(2, 2, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material))); + GLint size = (std::min)(sizeof(MeshType::VertexType::VoxelType), size_t(4)); + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material))); glBindVertexArray(0); From f78aad8abd7b09ab0ad1f94c9d8d41cb1247a4ae Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 22:58:31 +0200 Subject: [PATCH 071/259] Fixed colors to match previous version of the example. --- examples/OpenGL/main.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 4f4d9d15..14315a95 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -135,21 +135,26 @@ int main(int argc, char *argv[]) vec3 normal = worldNormal.xyz; - if(outMaterial.x == 1) + switch(outMaterial.x) { + case 1: outputColor = vec4(1.0, 0.0, 0.0, 1.0); - } - else if(outMaterial.x == 2) - { + break; + case 2: outputColor = vec4(0.0, 1.0, 0.0, 1.0); - } - else if(outMaterial.x == 3) - { + break; + case 3: outputColor = vec4(0.0, 0.0, 1.0, 1.0); - } - else - { + break; + case 4: outputColor = vec4(1.0, 1.0, 0.0, 1.0); + break; + case 5: + outputColor = vec4(1.0, 0.0, 1.0, 1.0); + break; + default: + outputColor = vec4(1.0, 1.0, 1.0, 1.0); + break; } //float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); From eb39f0bb4c400d28953bd6c717d1b4d1046036de Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 12:28:45 +0200 Subject: [PATCH 072/259] OpenGLExample is once again rendered as multiple separate mehses (but using the example framework this time). --- examples/OpenGL/main.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 14315a95..4f0c0f2f 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -107,7 +107,6 @@ int main(int argc, char *argv[]) void main() { - //material = vec2( worldPosition = modelToWorldMatrix * position; worldNormal = normal; outMaterial = ivec2(material.x, material.y); @@ -173,14 +172,38 @@ int main(int argc, char *argv[]) //openGLWidget.setVolume(&volData); cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl; - auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + const int32_t extractedRegionSize = 32; + const int32_t gapBetweenRegions = 1; // Set this to '1' + int meshCounter = 0; + + for (int32_t z = 0; z < volData.getDepth(); z += extractedRegionSize) + { + for (int32_t y = 0; y < volData.getHeight(); y += extractedRegionSize) + { + for (int32_t x = 0; x < volData.getWidth(); x += extractedRegionSize) + { + // Specify the region to extract based on a starting position and the desired region sze. + Region regToExtract(x, y, z, x + extractedRegionSize, y + extractedRegionSize, z + extractedRegionSize); + + // If you uncomment this line you will be able to see that the volume is rendered as multiple seperate meshes. + //regToExtract.shrink(1); + + // Perform the extraction for this region of the volume + auto mesh = extractMarchingCubesMesh(&volData, regToExtract); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(mesh); + + meshCounter++; + } + } + } + + cout << "Rendering volume as " << meshCounter << " seperate meshes" << endl; + - //Pass the surface to the OpenGL window - openGLWidget.addMesh(mesh); - //openGLWidget.addMesh(mesh2); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - //return 0; return app.exec(); } From e80c88a5ec2207fac256773870fc6c52120cd4f9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:03:52 +0200 Subject: [PATCH 073/259] Paging example now uses the new example OpenGLWidget. --- examples/Paging/CMakeLists.txt | 2 +- examples/Paging/OpenGLWidget.cpp | 135 ------------------------------- examples/Paging/OpenGLWidget.h | 68 ---------------- examples/Paging/main.cpp | 2 +- 4 files changed, 2 insertions(+), 205 deletions(-) delete mode 100644 examples/Paging/OpenGLWidget.cpp delete mode 100644 examples/Paging/OpenGLWidget.h diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index e8020b2d..aa9b2899 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(PagingExample) #Projects source files SET(SRC_FILES main.cpp - OpenGLWidget.cpp + ../common/OpenGLWidget.cpp Perlin.cpp ) diff --git a/examples/Paging/OpenGLWidget.cpp b/examples/Paging/OpenGLWidget.cpp deleted file mode 100644 index fa2aa7be..00000000 --- a/examples/Paging/OpenGLWidget.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include "OpenGLWidget.h" - -#include - -using namespace PolyVox; -using namespace std; - -OpenGLWidget::OpenGLWidget(QWidget *parent) - :QGLWidget(parent) - ,m_uBeginIndex(0) - ,m_uEndIndex(0) - ,noOfIndices(0) - ,m_xRotation(0) - ,m_yRotation(0) -{ -} - -void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) -{ - if((surfaceMesh.getNoOfIndices() == 0) || (surfaceMesh.getNoOfVertices() == 0)) - { - //We don't have a valid mesh - return; - } - - //Convienient access to the vertices and indices - const vector& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); - - //Build an OpenGL index buffer - glGenBuffers(1, &indexBuffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - const GLvoid* pIndices = static_cast(&(vecIndices[0])); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); - - //Build an OpenGL vertex buffer - glGenBuffers(1, &vertexBuffer); - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - const GLvoid* pVertices = static_cast(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex), pVertices, GL_STATIC_DRAW); - - m_uBeginIndex = 0; - m_uEndIndex = vecIndices.size(); - noOfIndices = surfaceMesh.getNoOfIndices(); -} - -void OpenGLWidget::initializeGL() -{ - //We need GLEW to access recent OpenGL functionality - GLenum err = glewInit(); - if (GLEW_OK != err) - { - /* Problem: glewInit failed, something is seriously wrong. */ - std::cout << "GLEW Error: " << glewGetErrorString(err) << std::endl; - } - - //Set up the clear colour - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClearDepth(1.0f); - - //Enable the depth buffer - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - - //Enable smooth lighting - //glEnable(GL_LIGHTING); - //glEnable(GL_LIGHT0); - //glShadeModel(GL_SMOOTH); - - //We'll be rendering with index/vertex arrays - glEnableClientState(GL_VERTEX_ARRAY); - //glEnableClientState(GL_NORMAL_ARRAY); -} - -void OpenGLWidget::resizeGL(int w, int h) -{ - //Setup the viewport - glViewport(0, 0, w, h); - - //Set up the projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - float frustumSize = 128.0f * 1.7f; //Half the volume diagonal - float aspect = static_cast(width()) / static_cast(height()); - glOrtho(frustumSize*aspect, -frustumSize*aspect, frustumSize, -frustumSize, 10.0, 10000); -} - -void OpenGLWidget::paintGL() -{ - if(noOfIndices == 0) - { - //Nothing to render - return; - } - - //Clear the screen - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - //Set up the viewing transformation - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0f,0.0f,-5000.0f); //Centre volume and move back - glRotatef(m_xRotation, 1.0f, 0.0f, 0.0f); - glRotatef(m_yRotation, 0.0f, 1.0f, 0.0f); - glTranslatef(-128.0f,-128.0f,-128.0f); //Centre volume and move back - - //Bind the index buffer - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - - //Bind the vertex buffer - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(CubicVertex), 0); - //glNormalPointer(GL_FLOAT, sizeof(CubicVertex), (GLvoid*)12); - - glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); -} - -void OpenGLWidget::mousePressEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - m_LastFrameMousePos = m_CurrentMousePos; - - update(); -} - -void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; - m_xRotation += diff.x(); - m_yRotation += diff.y(); - m_LastFrameMousePos = m_CurrentMousePos; - - update(); -} diff --git a/examples/Paging/OpenGLWidget.h b/examples/Paging/OpenGLWidget.h deleted file mode 100644 index 63afbb97..00000000 --- a/examples/Paging/OpenGLWidget.h +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __BasicExample_OpenGLWidget_H__ -#define __BasicExample_OpenGLWidget_H__ - -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/Mesh.h" - -#include "glew/glew.h" - -#include - -class OpenGLWidget : public QGLWidget -{ -public: - //Constructor - OpenGLWidget(QWidget *parent); - - //Mouse handling - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - - //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); - -protected: - //Qt OpenGL functions - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - -private: - //Index/vertex buffer data - GLuint m_uBeginIndex; - GLuint m_uEndIndex; - GLuint noOfIndices; - GLuint indexBuffer; - GLuint vertexBuffer; - - //Mouse data - QPoint m_LastFrameMousePos; - QPoint m_CurrentMousePos; - int m_xRotation; - int m_yRotation; -}; - -#endif //__BasicExample_OpenGLWidget_H__ diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 77c64d16..bc4fa222 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -190,7 +190,7 @@ int main(int argc, char *argv[]) std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; //Pass the surface to the OpenGL window - openGLWidget.setMeshToRender(mesh); + openGLWidget.addMesh(mesh); //Run the message pump. return app.exec(); From 349dc2b0e638b182d64289e0d8168bf543f2e226 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:06:44 +0200 Subject: [PATCH 074/259] Centered volume in viewport. --- examples/Paging/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index bc4fa222..3700c632 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -192,6 +192,8 @@ int main(int argc, char *argv[]) //Pass the surface to the OpenGL window openGLWidget.addMesh(mesh); + openGLWidget.setViewableRegion(reg); + //Run the message pump. return app.exec(); } From 6738c4fc9e9c5979b4a43b01738687422b0aaecf Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:15:20 +0200 Subject: [PATCH 075/259] Smooth example now also uses new example OpenGLWidget. --- examples/SmoothLOD/CMakeLists.txt | 2 +- examples/SmoothLOD/OpenGLWidget.cpp | 195 ---------------------------- examples/SmoothLOD/OpenGLWidget.h | 74 ----------- examples/SmoothLOD/main.cpp | 6 +- 4 files changed, 5 insertions(+), 272 deletions(-) delete mode 100644 examples/SmoothLOD/OpenGLWidget.cpp delete mode 100644 examples/SmoothLOD/OpenGLWidget.h diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 570cda55..55c9e934 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(SmoothLODExample) #Projects source files SET(SRC_FILES main.cpp - OpenGLWidget.cpp + ../common/OpenGLWidget.cpp ) #Projects headers files diff --git a/examples/SmoothLOD/OpenGLWidget.cpp b/examples/SmoothLOD/OpenGLWidget.cpp deleted file mode 100644 index d487f73b..00000000 --- a/examples/SmoothLOD/OpenGLWidget.cpp +++ /dev/null @@ -1,195 +0,0 @@ -#include "OpenGLWidget.h" - -#include - -using namespace PolyVox; -using namespace std; - -OpenGLWidget::OpenGLWidget(QWidget *parent) - :QGLWidget(parent) - ,m_uBeginIndex(0) - ,m_uEndIndex(0) - ,indexBuffer(0) - ,vertexBuffer(0) - - ,m_uBeginIndexLow(0) - ,m_uEndIndexLow(0) - ,indexBufferLow(0) - ,vertexBufferLow(0) - ,m_xRotation(0) - ,m_yRotation(0) -{ -} - -void OpenGLWidget::setMeshToRender(const PolyVox::Mesh >& surfaceMesh) -{ - //Convienient access to the vertices and indices - const vector& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); - - //Build an OpenGL index buffer - glGenBuffers(1, &indexBuffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - const GLvoid* pIndices = static_cast(&(vecIndices[0])); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); - - //Build an OpenGL vertex buffer - glGenBuffers(1, &vertexBuffer); - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - const GLvoid* pVertices = static_cast(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex), pVertices, GL_STATIC_DRAW); - - m_uBeginIndex = 0; - m_uEndIndex = vecIndices.size(); -} - -void OpenGLWidget::setMeshToRenderLowLOD(const PolyVox::Mesh >& surfaceMesh) -{ - //Convienient access to the vertices and indices - const vector& vecIndices = surfaceMesh.getIndices(); - const vector >& vecVertices = surfaceMesh.getVertices(); - - //Build an OpenGL index buffer - glGenBuffers(1, &indexBufferLow); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBufferLow); - const GLvoid* pIndices = static_cast(&(vecIndices[0])); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); - - //Build an OpenGL vertex buffer - glGenBuffers(1, &vertexBufferLow); - glBindBuffer(GL_ARRAY_BUFFER, vertexBufferLow); - const GLvoid* pVertices = static_cast(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex), pVertices, GL_STATIC_DRAW); - - m_uBeginIndexLow = 0; - m_uEndIndexLow = vecIndices.size(); -} - -void OpenGLWidget::initializeGL() -{ - //We need GLEW to access recent OpenGL functionality - std::cout << "Initialising GLEW..."; - GLenum result = glewInit(); - if (result == GLEW_OK) - { - std::cout << "success" << std::endl; - } - else - { - /* Problem: glewInit failed, something is seriously wrong. */ - std::cout << "failed" << std::endl; - std::cout << "Initialising GLEW failed with the following error: " << glewGetErrorString(result) << std::endl; - exit(EXIT_FAILURE); - } - - //Print out some information about the OpenGL implementation. - std::cout << "OpenGL Implementation Details:" << std::endl; - if(glGetString(GL_VENDOR)) - std::cout << "\tGL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; - if(glGetString(GL_RENDERER)) - std::cout << "\tGL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; - if(glGetString(GL_VERSION)) - std::cout << "\tGL_VERSION: " << glGetString(GL_VERSION) << std::endl; - if(glGetString(GL_SHADING_LANGUAGE_VERSION)) - std::cout << "\tGL_SHADING_LANGUAGE_VERSION: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; - - //Check our version of OpenGL is recent enough. - //We need at least 1.5 for vertex buffer objects, - if (!GLEW_VERSION_1_5) - { - std::cout << "Error: You need OpenGL version 1.5 to run this example." << std::endl; - exit(EXIT_FAILURE); - } - - //Set up the clear colour - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClearDepth(1.0f); - - //Enable the depth buffer - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - - //Anable smooth lighting - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glShadeModel(GL_SMOOTH); - - //We'll be rendering with index/vertex arrays - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); -} - -void OpenGLWidget::resizeGL(int w, int h) -{ - //Setup the viewport - glViewport(0, 0, w, h); - - //Set up the projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - float frustumSize = 32.0f; //Half the volume size - float aspect = static_cast(width()) / static_cast(height()); - glOrtho(frustumSize*aspect, -frustumSize*aspect, frustumSize, -frustumSize, 1.0, 1000); -} - -void OpenGLWidget::paintGL() -{ - //Clear the screen - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - //Set up the viewing transformation - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0f,0.0f,-100.0f); //Centre volume and move back - glRotatef(-m_xRotation, 0.0f, 1.0f, 0.0f); - glRotatef(-m_yRotation, 1.0f, 0.0f, 0.0f); - glTranslatef(-32.0f,-32.0f,-32.0f); //Centre volume and move back - - //Bind the index buffer - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - - //Bind the vertex buffer - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(MarchingCubesVertex), 0); - glNormalPointer(GL_FLOAT, sizeof(MarchingCubesVertex), (GLvoid*)12); - - glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); - - //Bind the index buffer - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBufferLow); - - //Bind the vertex buffer - glBindBuffer(GL_ARRAY_BUFFER, vertexBufferLow); - glVertexPointer(3, GL_FLOAT, sizeof(MarchingCubesVertex), 0); - glNormalPointer(GL_FLOAT, sizeof(MarchingCubesVertex), (GLvoid*)12); - - glDrawRangeElements(GL_TRIANGLES, m_uBeginIndexLow, m_uEndIndexLow-1, m_uEndIndexLow - m_uBeginIndexLow, GL_UNSIGNED_INT, 0); - - GLenum errCode = glGetError(); - if(errCode != GL_NO_ERROR) - { - //What has replaced getErrorString() in the latest OpenGL? - std::cout << "OpenGL Error: " << errCode << std::endl; - } -} - -void OpenGLWidget::mousePressEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - m_LastFrameMousePos = m_CurrentMousePos; - - update(); -} - -void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; - m_xRotation += diff.x(); - m_yRotation += diff.y(); - m_LastFrameMousePos = m_CurrentMousePos; - - update(); -} diff --git a/examples/SmoothLOD/OpenGLWidget.h b/examples/SmoothLOD/OpenGLWidget.h deleted file mode 100644 index af5b96ee..00000000 --- a/examples/SmoothLOD/OpenGLWidget.h +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __BasicExample_OpenGLWidget_H__ -#define __BasicExample_OpenGLWidget_H__ - -#include "PolyVoxCore/Mesh.h" - -#include "glew/glew.h" - -#include - -class OpenGLWidget : public QGLWidget -{ -public: - //Constructor - OpenGLWidget(QWidget *parent); - - //Mouse handling - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - - //Convert a SrfaceMesh to OpenGL index/vertex buffers - void setMeshToRender(const PolyVox::Mesh >& surfaceMesh); - void setMeshToRenderLowLOD(const PolyVox::Mesh >& surfaceMesh); - -protected: - //Qt OpenGL functions - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - -private: - //Index/vertex buffer data - GLuint m_uBeginIndex; - GLuint m_uEndIndex; - //GLuint noOfIndices; - GLuint indexBuffer; - GLuint vertexBuffer; - - GLuint m_uBeginIndexLow; - GLuint m_uEndIndexLow; - //GLuint noOfIndicesLow; - GLuint indexBufferLow; - GLuint vertexBufferLow; - - //Mouse data - QPoint m_LastFrameMousePos; - QPoint m_CurrentMousePos; - int m_xRotation; - int m_yRotation; -}; - -#endif //__BasicExample_OpenGLWidget_H__ diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index a0dc6dcd..e38dff25 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -98,8 +98,10 @@ int main(int argc, char *argv[]) meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); //Pass the surface to the OpenGL window - openGLWidget.setMeshToRender(meshHighLOD); - openGLWidget.setMeshToRenderLowLOD(meshLowLOD); + openGLWidget.addMesh(meshHighLOD); + openGLWidget.addMesh(meshLowLOD); + + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); //Run the message pump. return app.exec(); From b63a09cab34113f42fb172826ad5fd3510f0c584 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:29:44 +0200 Subject: [PATCH 076/259] Changing the way the examples handle translation and scaling. --- examples/OpenGL/main.cpp | 2 +- examples/common/OpenGLWidget.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 4f0c0f2f..3e5c5785 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) auto mesh = extractMarchingCubesMesh(&volData, regToExtract); //Pass the surface to the OpenGL window - openGLWidget.addMesh(mesh); + openGLWidget.addMesh(mesh, Vector3DInt32(x, y, z)); meshCounter++; } diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index a1c1c37c..fe13a23a 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -38,6 +38,7 @@ struct OpenGLMeshData GLuint vertexBuffer; GLuint vertexArrayObject; PolyVox::Vector3DInt32 translation; + float scale; }; class OpenGLWidget : public QGLWidget @@ -60,7 +61,7 @@ public: // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. template - void addMesh(const MeshType& surfaceMesh) + void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) { //Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -99,7 +100,8 @@ public: meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later - meshData.translation = surfaceMesh.m_Region.getLowerCorner(); + meshData.translation = translation; + meshData.scale = scale; mMeshData.push_back(meshData); } From 22869e48611dffc91a11f259e4c223c8d97a4b62 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:36:41 +0200 Subject: [PATCH 077/259] More tweaks to scaling and translation. --- examples/SmoothLOD/main.cpp | 6 ++---- examples/common/OpenGLWidget.cpp | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index e38dff25..60b35c98 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -91,15 +91,13 @@ int main(int argc, char *argv[]) //Extract the surface auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); - meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); //Extract the surface auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); - meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); //Pass the surface to the OpenGL window - openGLWidget.addMesh(meshHighLOD); - openGLWidget.addMesh(meshLowLOD); + openGLWidget.addMesh(meshHighLOD, Vector3DInt32(30, 0, 0)); + openGLWidget.addMesh(meshLowLOD, Vector3DInt32(0, 0, 0), 63.0f / 31.0f); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 1777ba54..c561d537 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -136,8 +136,9 @@ void OpenGLWidget::paintGL() for (OpenGLMeshData meshData : mMeshData) { QMatrix4x4 modelToWorldMatrix{}; - modelToWorldMatrix.translate(meshData.translation.getX(), meshData.translation.getY(), meshData.translation.getZ()); // Centre the model on the origin - shader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); // Update to the latest camera matrix + modelToWorldMatrix.translate(meshData.translation.getX(), meshData.translation.getY(), meshData.translation.getZ()); + modelToWorldMatrix.scale(meshData.scale); + shader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); glBindVertexArray(meshData.vertexArrayObject); From 499db6a1852f16cc53c89cd5ce74cf2c5d93269b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:43:37 +0200 Subject: [PATCH 078/259] Changed default shader to use normal as RGB (more useful for debugging). --- examples/common/OpenGLWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index c561d537..587ef1c5 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -89,7 +89,7 @@ void OpenGLWidget::initializeGL() vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); - outputColor = vec4(1.0, 0.5, color, 1.0); + outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); } )")) { From ec08b28002bdfe40dd29fa80df7e6899c39acb3d Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 21:45:28 +0200 Subject: [PATCH 079/259] Turned off back-face culling in examples, as this makes it easier to view certain shapes such as heightmaps. --- examples/common/OpenGLWidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 587ef1c5..76bdff47 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -45,7 +45,6 @@ void OpenGLWidget::initializeGL() glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0f); - glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); glDepthFunc(GL_LEQUAL); From b97bf5221494f7c9e2ec68e84cdfa61874eb0efa Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 23:34:12 +0200 Subject: [PATCH 080/259] Tidying up. --- examples/OpenGL/main.cpp | 1 - examples/common/OpenGLWidget.cpp | 2 +- examples/common/OpenGLWidget.h | 14 ++++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 3e5c5785..586b5197 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -173,7 +173,6 @@ int main(int argc, char *argv[]) cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl; const int32_t extractedRegionSize = 32; - const int32_t gapBetweenRegions = 1; // Set this to '1' int meshCounter = 0; for (int32_t z = 0; z < volData.getDepth(); z += extractedRegionSize) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 76bdff47..380c6fe0 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -135,7 +135,7 @@ void OpenGLWidget::paintGL() for (OpenGLMeshData meshData : mMeshData) { QMatrix4x4 modelToWorldMatrix{}; - modelToWorldMatrix.translate(meshData.translation.getX(), meshData.translation.getY(), meshData.translation.getZ()); + modelToWorldMatrix.translate(meshData.translation); modelToWorldMatrix.scale(meshData.scale); shader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index fe13a23a..755563fa 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -31,16 +31,21 @@ distribution. #include #include +// This structure holds all the data required +// to render one of our meshes through OpenGL. struct OpenGLMeshData { GLuint noOfIndices; GLuint indexBuffer; GLuint vertexBuffer; GLuint vertexArrayObject; - PolyVox::Vector3DInt32 translation; + QVector3D translation; float scale; }; +// Our OpenGLWidget is used by all the examples to render the extracted meshes. It is +// fairly specific to our needs (you probably won't want to use it in your own project) +// but should provide a useful illustration of how PolyVox meshes can be rendered. class OpenGLWidget : public QGLWidget { public: @@ -51,9 +56,11 @@ public: void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); - // The viewable region can be adjusted so that this example framework can be use for different volume sizes. + // The viewable region can be adjusted so that this example framework can be used for different volume sizes. void setViewableRegion(PolyVox::Region viewableRegion); + // For our purposes we use a single shader for the whole volume, and + // this example framework is only meant to show a single volume at a time void setShader(QGLShaderProgram* shader) { this->shader = shader; @@ -100,14 +107,13 @@ public: meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later - meshData.translation = translation; + meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); meshData.scale = scale; mMeshData.push_back(meshData); } protected: - // Qt OpenGL functions void initializeGL(); From 9e835a1110889fdd9cc44176bdc8e77e1cf7e276 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 23:40:55 +0200 Subject: [PATCH 081/259] Shader now passed by shared pointer. --- examples/OpenGL/main.cpp | 2 +- examples/common/OpenGLWidget.cpp | 35 ++++++++++++++++++-------------- examples/common/OpenGLWidget.h | 7 ++----- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 586b5197..6ef88601 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) openGLWidget.show(); - QGLShaderProgram* shader = new QGLShaderProgram; + QSharedPointer shader(new QGLShaderProgram); if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 380c6fe0..15f16852 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -21,6 +21,11 @@ void OpenGLWidget::setViewableRegion(Region viewableRegion) setupWorldToCameraMatrix(); } +void OpenGLWidget::setShader(QSharedPointer shader) +{ + mShader = shader; +} + void OpenGLWidget::initializeGL() { GLenum err = glewInit(); @@ -50,9 +55,9 @@ void OpenGLWidget::initializeGL() glDepthFunc(GL_LEQUAL); glDepthRange(0.0, 1.0); - shader = new QGLShaderProgram; + mShader = QSharedPointer(new QGLShaderProgram); - if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( + if (!mShader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 in vec4 position; // This will be the position of the vertex in model-space @@ -71,11 +76,11 @@ void OpenGLWidget::initializeGL() } )")) { - std::cerr << shader->log().toStdString() << std::endl; + std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader->addShaderFromSourceCode(QGLShader::Fragment, R"( + if (!mShader->addShaderFromSourceCode(QGLShader::Fragment, R"( #version 130 in vec4 worldPosition; //Passed in from the vertex shader @@ -92,17 +97,17 @@ void OpenGLWidget::initializeGL() } )")) { - std::cerr << shader->log().toStdString() << std::endl; + std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - shader->bindAttributeLocation("position", 0); - shader->bindAttributeLocation("normal", 1); - shader->bindAttributeLocation("material", 2); + mShader->bindAttributeLocation("position", 0); + mShader->bindAttributeLocation("normal", 1); + mShader->bindAttributeLocation("material", 2); - if (!shader->link()) + if (!mShader->link()) { - std::cerr << shader->log().toStdString() << std::endl; + std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } @@ -127,17 +132,17 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - shader->bind(); + mShader->bind(); - shader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); - shader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); + mShader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); + mShader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); for (OpenGLMeshData meshData : mMeshData) { QMatrix4x4 modelToWorldMatrix{}; modelToWorldMatrix.translate(meshData.translation); modelToWorldMatrix.scale(meshData.scale); - shader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); + mShader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); glBindVertexArray(meshData.vertexArrayObject); @@ -146,7 +151,7 @@ void OpenGLWidget::paintGL() glBindVertexArray(0); } - shader->release(); + mShader->release(); GLenum errCode = glGetError(); if(errCode != GL_NO_ERROR) diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 755563fa..a56ed7f1 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -61,10 +61,7 @@ public: // For our purposes we use a single shader for the whole volume, and // this example framework is only meant to show a single volume at a time - void setShader(QGLShaderProgram* shader) - { - this->shader = shader; - } + void setShader(QSharedPointer shader); // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. template @@ -127,7 +124,7 @@ private: // Index/vertex buffer data std::vector mMeshData; - QGLShaderProgram* shader; + QSharedPointer mShader; // Matrices QMatrix4x4 worldToCameraMatrix; From 2a072f93478ed12c0bae4d8df7852d3362f18646 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 25 May 2014 23:44:37 +0200 Subject: [PATCH 082/259] Rearranged some functions. --- examples/common/OpenGLWidget.cpp | 55 +++++++++++++++++++------------- examples/common/OpenGLWidget.h | 22 ++++++------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 15f16852..a83fa70d 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -7,6 +7,9 @@ using namespace PolyVox; using namespace std; +//////////////////////////////////////////////////////////////////////////////// +// Public functions +//////////////////////////////////////////////////////////////////////////////// OpenGLWidget::OpenGLWidget(QWidget *parent) :QGLWidget(parent) ,m_viewableRegion(Region(0, 0, 0, 255, 255, 255)) @@ -15,17 +18,41 @@ OpenGLWidget::OpenGLWidget(QWidget *parent) { } +void OpenGLWidget::setShader(QSharedPointer shader) +{ + mShader = shader; +} + void OpenGLWidget::setViewableRegion(Region viewableRegion) { m_viewableRegion = viewableRegion; setupWorldToCameraMatrix(); } -void OpenGLWidget::setShader(QSharedPointer shader) +void OpenGLWidget::mousePressEvent(QMouseEvent* event) { - mShader = shader; + m_CurrentMousePos = event->pos(); + m_LastFrameMousePos = m_CurrentMousePos; + + update(); } +void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) +{ + m_CurrentMousePos = event->pos(); + QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; + m_xRotation += diff.x(); + m_yRotation += diff.y(); + m_LastFrameMousePos = m_CurrentMousePos; + + setupWorldToCameraMatrix(); + + update(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Protected functions +//////////////////////////////////////////////////////////////////////////////// void OpenGLWidget::initializeGL() { GLenum err = glewInit(); @@ -160,27 +187,9 @@ void OpenGLWidget::paintGL() } } -void OpenGLWidget::mousePressEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - m_LastFrameMousePos = m_CurrentMousePos; - - update(); -} - -void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) -{ - m_CurrentMousePos = event->pos(); - QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; - m_xRotation += diff.x(); - m_yRotation += diff.y(); - m_LastFrameMousePos = m_CurrentMousePos; - - setupWorldToCameraMatrix(); - - update(); -} - +//////////////////////////////////////////////////////////////////////////////// +// Private functions +//////////////////////////////////////////////////////////////////////////////// void OpenGLWidget::setupWorldToCameraMatrix() { QVector3D lowerCorner(m_viewableRegion.getLowerX(), m_viewableRegion.getLowerY(), m_viewableRegion.getLowerZ()); diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index a56ed7f1..af660909 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -52,17 +52,6 @@ public: // Constructor OpenGLWidget(QWidget *parent); - // Mouse handling - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - - // The viewable region can be adjusted so that this example framework can be used for different volume sizes. - void setViewableRegion(PolyVox::Region viewableRegion); - - // For our purposes we use a single shader for the whole volume, and - // this example framework is only meant to show a single volume at a time - void setShader(QSharedPointer shader); - // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. template void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) @@ -110,6 +99,17 @@ public: mMeshData.push_back(meshData); } + // For our purposes we use a single shader for the whole volume, and + // this example framework is only meant to show a single volume at a time + void setShader(QSharedPointer shader); + + // The viewable region can be adjusted so that this example framework can be used for different volume sizes. + void setViewableRegion(PolyVox::Region viewableRegion); + + // Mouse handling + void mouseMoveEvent(QMouseEvent* event); + void mousePressEvent(QMouseEvent* event); + protected: // Qt OpenGL functions From e9c8daa9cb0131539005bf1c854b86a6c303d86c Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 16:31:12 +0200 Subject: [PATCH 083/259] Add comments and tidying. --- examples/common/OpenGLWidget.cpp | 9 +++++++-- examples/common/OpenGLWidget.h | 30 +++++++++++++++++++----------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index a83fa70d..f26c2237 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -26,27 +26,32 @@ void OpenGLWidget::setShader(QSharedPointer shader) void OpenGLWidget::setViewableRegion(Region viewableRegion) { m_viewableRegion = viewableRegion; + + // The user has specifed a new viewable region + // so we need to regenerate our camera matrix. setupWorldToCameraMatrix(); } void OpenGLWidget::mousePressEvent(QMouseEvent* event) { + // Initialise these variables which will be used when the mouse actually moves. m_CurrentMousePos = event->pos(); m_LastFrameMousePos = m_CurrentMousePos; - - update(); } void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) { + // Update the x and y rotations based on the mouse movement. m_CurrentMousePos = event->pos(); QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; m_xRotation += diff.x(); m_yRotation += diff.y(); m_LastFrameMousePos = m_CurrentMousePos; + // The camera rotation has changed so we need to regenerate the matrix. setupWorldToCameraMatrix(); + // Re-render. update(); } diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index af660909..d87b4161 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -52,11 +52,11 @@ public: // Constructor OpenGLWidget(QWidget *parent); - // Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised. + // Convert a PolyVox mesh to OpenGL index/vertex buffers. Inlined because it's templatised. template void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) { - //Convienient access to the vertices and indices + // Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); const auto& vecVertices = surfaceMesh.getVertices(); @@ -64,38 +64,46 @@ public: // to render our mesh. We copy the data from the PolyVox mesh into this structure. OpenGLMeshData meshData; - //Create the VAO for the mesh + // Create the VAO for the mesh glGenVertexArrays(1, &(meshData.vertexArrayObject)); glBindVertexArray(meshData.vertexArrayObject); - //The GL_ARRAY_BUFFER will contain the list of vertex positions + // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); - //and GL_ELEMENT_ARRAY_BUFFER will contain the indices + // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); - //We need to tell OpenGL how to understand the format of the vertex data - glEnableVertexAttribArray(0); //We're talking about shader attribute '0' + // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out + glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - glEnableVertexAttribArray(1); //We're talking about shader attribute '1' + // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor + // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the + // shader. This is mostly just to simplify this example code - in a real application you will know whether your + // chosen surface extractor generates normals and can skip uploading them if not. + glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); + // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code + // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(MeshType::VertexType::VoxelType), size_t(4)); + GLint size = (std::min)(sizeof(MeshType::VertexType::VoxelType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material))); + // We're done uploading and can now unbind. glBindVertexArray(0); - meshData.noOfIndices = vecIndices.size(); //Save this for the call to glDrawElements later - + // A few additional properties can be copied across for use during rendering. + meshData.noOfIndices = vecIndices.size(); meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); meshData.scale = scale; + // Now add the mesh to the list of meshes to render. mMeshData.push_back(meshData); } From 4ae25d6b1e961f83fd280eb04982c47a0fd79e26 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 16:50:13 +0200 Subject: [PATCH 084/259] More commenting. --- examples/common/OpenGLWidget.cpp | 35 +++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index f26c2237..e0ea7de4 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -89,19 +89,25 @@ void OpenGLWidget::initializeGL() mShader = QSharedPointer(new QGLShaderProgram); + // This is basically a simple fallback vertex shader which does the most basic rendering possible. + // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. if (!mShader->addShaderFromSourceCode(QGLShader::Vertex, R"( #version 140 in vec4 position; // This will be the position of the vertex in model-space + // The usual matrices are provided uniform mat4 cameraToClipMatrix; uniform mat4 worldToCameraMatrix; uniform mat4 modelToWorldMatrix; - out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals + // This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach + // but we use it in this example framework because not all surface extractor generate surface normals. + out vec4 worldPosition; void main() { + // Standard sequence of OpenGL transformations. worldPosition = modelToWorldMatrix * position; vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; @@ -112,19 +118,26 @@ void OpenGLWidget::initializeGL() exit(EXIT_FAILURE); } + // This is basically a simple fallback fragment shader which does the most basic rendering possible. + // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. if (!mShader->addShaderFromSourceCode(QGLShader::Fragment, R"( #version 130 - in vec4 worldPosition; //Passed in from the vertex shader + // Passed in from the vertex shader + in vec4 worldPosition; in vec4 worldNormal; + // the color that gets written to the display out vec4 outputColor; void main() { + // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback + // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); - float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); + // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. + // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); } )")) @@ -133,7 +146,11 @@ void OpenGLWidget::initializeGL() exit(EXIT_FAILURE); } + // Bind the position semantic - this is defined in the vertex shader above. mShader->bindAttributeLocation("position", 0); + + // Bind the other semantics. Note that these don't actually exist in our example shader above! However, other + // example shaders may choose to provide them and having the binding code here does not seem to cause any problems. mShader->bindAttributeLocation("normal", 1); mShader->bindAttributeLocation("material", 2); @@ -143,6 +160,7 @@ void OpenGLWidget::initializeGL() exit(EXIT_FAILURE); } + // Initial setup of camera. setupWorldToCameraMatrix(); } @@ -164,27 +182,34 @@ void OpenGLWidget::paintGL() //Clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + // Our example framework only uses a single shader for the scene (for all meshes). mShader->bind(); + // These two matrices are constant for all meshes. mShader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); mShader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); + // Iterate over each mesh which the user added to our list, and render it. for (OpenGLMeshData meshData : mMeshData) { + //Set up the model matrrix based on provided translation and scale. QMatrix4x4 modelToWorldMatrix{}; modelToWorldMatrix.translate(meshData.translation); modelToWorldMatrix.scale(meshData.scale); mShader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); + // Bind the vertex array for the current mesh glBindVertexArray(meshData.vertexArrayObject); - + // Draw the mesh glDrawElements(GL_TRIANGLES, meshData.noOfIndices, GL_UNSIGNED_INT, 0); - + // Unbind the vertex array. glBindVertexArray(0); } + // We're done with the shader for this frame. mShader->release(); + // Check for errors. GLenum errCode = glGetError(); if(errCode != GL_NO_ERROR) { From 40e528d782f2e4a5f25f7d47576c949c50edd756 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 17:00:26 +0200 Subject: [PATCH 085/259] Added lighting to OpenGL example. --- examples/OpenGL/main.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 6ef88601..23736a0a 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -130,34 +130,38 @@ int main(int argc, char *argv[]) void main() { - //vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); - vec3 normal = worldNormal.xyz; + vec4 surfaceColor = vec4(0.0, 0.0, 0.0, 0.0); switch(outMaterial.x) { case 1: - outputColor = vec4(1.0, 0.0, 0.0, 1.0); + surfaceColor = vec4(1.0, 0.0, 0.0, 1.0); break; case 2: - outputColor = vec4(0.0, 1.0, 0.0, 1.0); + surfaceColor = vec4(0.0, 1.0, 0.0, 1.0); break; case 3: - outputColor = vec4(0.0, 0.0, 1.0, 1.0); + surfaceColor = vec4(0.0, 0.0, 1.0, 1.0); break; case 4: - outputColor = vec4(1.0, 1.0, 0.0, 1.0); + surfaceColor = vec4(1.0, 1.0, 0.0, 1.0); break; case 5: - outputColor = vec4(1.0, 0.0, 1.0, 1.0); + surfaceColor = vec4(1.0, 0.0, 1.0, 1.0); break; default: - outputColor = vec4(1.0, 1.0, 1.0, 1.0); + surfaceColor = vec4(1.0, 1.0, 1.0, 1.0); break; } - - //float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1); - //outputColor = vec4(1.0, 0.5, color, 1.0); + + vec3 lightDir = vec3(1.0, 0.0, 0.0); + float diffuse = dot(lightDir, normal); + diffuse *= 0.6; + float ambient = 0.4; + float lightVal = diffuse + ambient; + + outputColor = surfaceColor * lightVal; } )")) { From fd3879faebc784cda49387d191590446b580b445 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 21:10:07 +0200 Subject: [PATCH 086/259] Tidying OpenGLExample shader code. --- examples/OpenGL/main.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 23736a0a..f57b661e 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -102,16 +102,17 @@ int main(int argc, char *argv[]) uniform mat4 modelToWorldMatrix; out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals - out vec4 worldNormal; + out vec3 normalFromVS; flat out ivec2 outMaterial; void main() { worldPosition = modelToWorldMatrix * position; - worldNormal = normal; - outMaterial = ivec2(material.x, material.y); vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; + + normalFromVS = normal.xyz; + outMaterial = ivec2(material.x, material.y); } )")) { @@ -123,16 +124,16 @@ int main(int argc, char *argv[]) #version 130 in vec4 worldPosition; //Passed in from the vertex shader - in vec4 worldNormal; + in vec3 normalFromVS; flat in ivec2 outMaterial; out vec4 outputColor; void main() { - vec3 normal = worldNormal.xyz; - vec4 surfaceColor = vec4(0.0, 0.0, 0.0, 0.0); - + // The first byte of our voxel data is the material. + // We use this to decide how to color the fragment. + vec4 surfaceColor; switch(outMaterial.x) { case 1: @@ -155,13 +156,15 @@ int main(int argc, char *argv[]) break; } - vec3 lightDir = vec3(1.0, 0.0, 0.0); - float diffuse = dot(lightDir, normal); - diffuse *= 0.6; - float ambient = 0.4; - float lightVal = diffuse + ambient; + // Quick and dirty lighting, obviously a real implementation + // should pass light properties as shader parameters, etc. + vec3 lightDir = vec3(0.0, 0.0, 1.0); + float diffuse = clamp(dot(lightDir, normalFromVS), 0.0, 1.0); + diffuse *= 0.7; // Dim the diffuse a bit + float ambient = 0.3; // Add some ambient + float lightIntensity = diffuse + ambient; // Compute the final light intensity - outputColor = surfaceColor * lightVal; + outputColor = surfaceColor * lightIntensity; //Compute final rendered color } )")) { From 5a23299634ae9c01414f3ad87e16c711494fdc28 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 21:14:54 +0200 Subject: [PATCH 087/259] More tidying shader code. --- examples/OpenGL/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index f57b661e..7e2451e1 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -103,16 +103,19 @@ int main(int argc, char *argv[]) out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals out vec3 normalFromVS; - flat out ivec2 outMaterial; + flat out ivec2 materialFromVS; void main() { - worldPosition = modelToWorldMatrix * position; - vec4 cameraPosition = worldToCameraMatrix * worldPosition; - gl_Position = cameraToClipMatrix * cameraPosition; + // Compute the usual OpenGL transformation to clip space. + gl_Position = cameraToClipMatrix * worldToCameraMatrix * modelToWorldMatrix * position; + // This example is demonstrating the marching cubes mesh, which does have per-vertex normals. We can + // just pass them through, though real code might want to deal with transforming normals appropriatly. normalFromVS = normal.xyz; - outMaterial = ivec2(material.x, material.y); + + // Nothing special here, we just pass the material through to the fragment shader. + materialFromVS = material; } )")) { @@ -125,7 +128,7 @@ int main(int argc, char *argv[]) in vec4 worldPosition; //Passed in from the vertex shader in vec3 normalFromVS; - flat in ivec2 outMaterial; + flat in ivec2 materialFromVS; out vec4 outputColor; @@ -134,7 +137,7 @@ int main(int argc, char *argv[]) // The first byte of our voxel data is the material. // We use this to decide how to color the fragment. vec4 surfaceColor; - switch(outMaterial.x) + switch(materialFromVS.x) { case 1: surfaceColor = vec4(1.0, 0.0, 0.0, 1.0); From ba58cff8158fc45b0ac0a0abce88ce78f1b2c2fa Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 22:51:09 +0200 Subject: [PATCH 088/259] Removed use of 'R' raw string literals as CS 2012 doesn't support them. --- examples/OpenGL/main.cpp | 128 +++++++++++++++---------------- examples/common/OpenGLWidget.cpp | 70 ++++++++--------- 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 7e2451e1..27b0ac6b 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -90,86 +90,86 @@ int main(int argc, char *argv[]) QSharedPointer shader(new QGLShaderProgram); - if (!shader->addShaderFromSourceCode(QGLShader::Vertex, R"( - #version 140 + if (!shader->addShaderFromSourceCode(QGLShader::Vertex, + "#version 140\n" - in vec4 position; // This will be the position of the vertex in model-space - in vec4 normal; // The normal data may not have been set - in ivec2 material; + "in vec4 position; // This will be the position of the vertex in model-space\n" + "in vec4 normal; // The normal data may not have been set\n" + "in ivec2 material;\n" - uniform mat4 cameraToClipMatrix; - uniform mat4 worldToCameraMatrix; - uniform mat4 modelToWorldMatrix; + "uniform mat4 cameraToClipMatrix;\n" + "uniform mat4 worldToCameraMatrix;\n" + "uniform mat4 modelToWorldMatrix;\n" - out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals - out vec3 normalFromVS; - flat out ivec2 materialFromVS; + "out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals\n" + "out vec3 normalFromVS;\n" + "flat out ivec2 materialFromVS;\n" - void main() - { - // Compute the usual OpenGL transformation to clip space. - gl_Position = cameraToClipMatrix * worldToCameraMatrix * modelToWorldMatrix * position; + "void main()\n" + "{\n" + " // Compute the usual OpenGL transformation to clip space.\n" + " gl_Position = cameraToClipMatrix * worldToCameraMatrix * modelToWorldMatrix * position;\n" - // This example is demonstrating the marching cubes mesh, which does have per-vertex normals. We can - // just pass them through, though real code might want to deal with transforming normals appropriatly. - normalFromVS = normal.xyz; + " // This example is demonstrating the marching cubes mesh, which does have per-vertex normals. We can \n" + " // just pass them through, though real code might want to deal with transforming normals appropriatly.\n" + " normalFromVS = normal.xyz;\n" - // Nothing special here, we just pass the material through to the fragment shader. - materialFromVS = material; - } - )")) + " // Nothing special here, we just pass the material through to the fragment shader.\n" + " materialFromVS = material;\n" + "}\n" + )) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader->addShaderFromSourceCode(QGLShader::Fragment, R"( - #version 130 + if (!shader->addShaderFromSourceCode(QGLShader::Fragment, + "#version 130\n" - in vec4 worldPosition; //Passed in from the vertex shader - in vec3 normalFromVS; - flat in ivec2 materialFromVS; + "in vec4 worldPosition; //Passed in from the vertex shader\n" + "in vec3 normalFromVS;\n" + "flat in ivec2 materialFromVS;\n" - out vec4 outputColor; + "out vec4 outputColor;\n" - void main() - { - // The first byte of our voxel data is the material. - // We use this to decide how to color the fragment. - vec4 surfaceColor; - switch(materialFromVS.x) - { - case 1: - surfaceColor = vec4(1.0, 0.0, 0.0, 1.0); - break; - case 2: - surfaceColor = vec4(0.0, 1.0, 0.0, 1.0); - break; - case 3: - surfaceColor = vec4(0.0, 0.0, 1.0, 1.0); - break; - case 4: - surfaceColor = vec4(1.0, 1.0, 0.0, 1.0); - break; - case 5: - surfaceColor = vec4(1.0, 0.0, 1.0, 1.0); - break; - default: - surfaceColor = vec4(1.0, 1.0, 1.0, 1.0); - break; - } + "void main()\n" + "{\n" + " // The first byte of our voxel data is the material.\n" + " // We use this to decide how to color the fragment.\n" + " vec4 surfaceColor;\n" + " switch(materialFromVS.x)\n" + " {\n" + " case 1:\n" + " surfaceColor = vec4(1.0, 0.0, 0.0, 1.0);\n" + " break;\n" + " case 2:\n" + " surfaceColor = vec4(0.0, 1.0, 0.0, 1.0);\n" + " break;\n" + " case 3:\n" + " surfaceColor = vec4(0.0, 0.0, 1.0, 1.0);\n" + " break;\n" + " case 4:\n" + " surfaceColor = vec4(1.0, 1.0, 0.0, 1.0);\n" + " break;\n" + " case 5:\n" + " surfaceColor = vec4(1.0, 0.0, 1.0, 1.0);\n" + " break;\n" + " default:\n" + " surfaceColor = vec4(1.0, 1.0, 1.0, 1.0);\n" + " break;\n" + " }\n" - // Quick and dirty lighting, obviously a real implementation - // should pass light properties as shader parameters, etc. - vec3 lightDir = vec3(0.0, 0.0, 1.0); - float diffuse = clamp(dot(lightDir, normalFromVS), 0.0, 1.0); - diffuse *= 0.7; // Dim the diffuse a bit - float ambient = 0.3; // Add some ambient - float lightIntensity = diffuse + ambient; // Compute the final light intensity + " // Quick and dirty lighting, obviously a real implementation\n" + " // should pass light properties as shader parameters, etc.\n" + " vec3 lightDir = vec3(0.0, 0.0, 1.0);\n" + " float diffuse = clamp(dot(lightDir, normalFromVS), 0.0, 1.0);\n" + " diffuse *= 0.7; // Dim the diffuse a bit\n" + " float ambient = 0.3; // Add some ambient\n" + " float lightIntensity = diffuse + ambient; // Compute the final light intensity\n" - outputColor = surfaceColor * lightIntensity; //Compute final rendered color - } - )")) + " outputColor = surfaceColor * lightIntensity; //Compute final rendered color\n" + "}\n" + )) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index e0ea7de4..96cbe1ce 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -91,28 +91,28 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback vertex shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceCode(QGLShader::Vertex, R"( - #version 140 + if (!mShader->addShaderFromSourceCode(QGLShader::Vertex, + "#version 140\n" - in vec4 position; // This will be the position of the vertex in model-space + "in vec4 position; // This will be the position of the vertex in model-space\n" - // The usual matrices are provided - uniform mat4 cameraToClipMatrix; - uniform mat4 worldToCameraMatrix; - uniform mat4 modelToWorldMatrix; + "// The usual matrices are provided\n" + "uniform mat4 cameraToClipMatrix;\n" + "uniform mat4 worldToCameraMatrix;\n" + "uniform mat4 modelToWorldMatrix;\n" - // This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach - // but we use it in this example framework because not all surface extractor generate surface normals. - out vec4 worldPosition; + "// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach\n" + "// but we use it in this example framework because not all surface extractor generate surface normals.\n" + "out vec4 worldPosition;\n" - void main() - { - // Standard sequence of OpenGL transformations. - worldPosition = modelToWorldMatrix * position; - vec4 cameraPosition = worldToCameraMatrix * worldPosition; - gl_Position = cameraToClipMatrix * cameraPosition; - } - )")) + "void main()\n" + "{\n" + " // Standard sequence of OpenGL transformations.\n" + " worldPosition = modelToWorldMatrix * position;\n" + " vec4 cameraPosition = worldToCameraMatrix * worldPosition;\n" + " gl_Position = cameraToClipMatrix * cameraPosition;\n" + "}\n" + )) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); @@ -120,27 +120,27 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback fragment shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceCode(QGLShader::Fragment, R"( - #version 130 + if (!mShader->addShaderFromSourceCode(QGLShader::Fragment, + "#version 130\n" - // Passed in from the vertex shader - in vec4 worldPosition; - in vec4 worldNormal; + "// Passed in from the vertex shader\n" + "in vec4 worldPosition;\n" + "in vec4 worldNormal;\n" - // the color that gets written to the display - out vec4 outputColor; + "// the color that gets written to the display\n" + "out vec4 outputColor;\n" - void main() - { - // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback - // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + "void main()\n" + "{\n" + " // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback \n" + " // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations.\n" + " vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz)));\n" - // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. - // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. - outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); - } - )")) + " // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. \n" + " // Obviously a real shader would also do texuring, lighting, or whatever is required for the application.\n" + " outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0);\n" + "}\n" + )) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); From 321d3eb7d4d0c1dc6c6bf060a4767afa2fa06e17 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 22:51:55 +0200 Subject: [PATCH 089/259] Removed initializer which isn't supported in VS 2012. --- examples/common/OpenGLWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 96cbe1ce..ddc314eb 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -193,7 +193,7 @@ void OpenGLWidget::paintGL() for (OpenGLMeshData meshData : mMeshData) { //Set up the model matrrix based on provided translation and scale. - QMatrix4x4 modelToWorldMatrix{}; + QMatrix4x4 modelToWorldMatrix; modelToWorldMatrix.translate(meshData.translation); modelToWorldMatrix.scale(meshData.scale); mShader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); From 1d8fc25cb752d1a250c50dc794ffe9eff03ed932 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 26 May 2014 23:14:29 +0200 Subject: [PATCH 090/259] Compile fixes for GCC/Linux --- examples/OpenGL/main.cpp | 2 +- examples/common/OpenGLWidget.cpp | 4 ++-- examples/common/OpenGLWidget.h | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 27b0ac6b..c339fa0b 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) for (int32_t x = 0; x < volData.getWidth(); x += extractedRegionSize) { // Specify the region to extract based on a starting position and the desired region sze. - Region regToExtract(x, y, z, x + extractedRegionSize, y + extractedRegionSize, z + extractedRegionSize); + PolyVox::Region regToExtract(x, y, z, x + extractedRegionSize, y + extractedRegionSize, z + extractedRegionSize); // If you uncomment this line you will be able to see that the volume is rendered as multiple seperate meshes. //regToExtract.shrink(1); diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index ddc314eb..bc2d3e40 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -12,7 +12,7 @@ using namespace std; //////////////////////////////////////////////////////////////////////////////// OpenGLWidget::OpenGLWidget(QWidget *parent) :QGLWidget(parent) - ,m_viewableRegion(Region(0, 0, 0, 255, 255, 255)) + ,m_viewableRegion(PolyVox::Region(0, 0, 0, 255, 255, 255)) ,m_xRotation(0) ,m_yRotation(0) { @@ -23,7 +23,7 @@ void OpenGLWidget::setShader(QSharedPointer shader) mShader = shader; } -void OpenGLWidget::setViewableRegion(Region viewableRegion) +void OpenGLWidget::setViewableRegion(PolyVox::Region viewableRegion) { m_viewableRegion = viewableRegion; diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index d87b4161..eaff700a 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -71,7 +71,7 @@ public: // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(typename MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); @@ -80,20 +80,20 @@ public: // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(MeshType::VertexType::VoxelType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material))); + GLint size = (std::min)(sizeof(typename MeshType::VertexType::VoxelType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, material))); // We're done uploading and can now unbind. glBindVertexArray(0); From 140cbc0fc72971f329244e4a86059ab19794ee2e Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Tue, 27 May 2014 15:08:20 +0100 Subject: [PATCH 091/259] Move shader code to external files rather than embedded A bit of CMake code in each example copies the files to the correct location and Qt loads them from the application's binary directory. --- examples/Basic/CMakeLists.txt | 3 ++ examples/OpenGL/CMakeLists.txt | 3 ++ examples/Paging/CMakeLists.txt | 3 ++ examples/SmoothLOD/CMakeLists.txt | 3 ++ examples/common/OpenGLWidget.cpp | 46 ++----------------------------- examples/common/example.frag | 19 +++++++++++++ examples/common/example.vert | 20 ++++++++++++++ 7 files changed, 54 insertions(+), 43 deletions(-) create mode 100644 examples/common/example.frag create mode 100644 examples/common/example.vert diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 30ca5f3e..4bf89fcb 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -55,6 +55,9 @@ ENDIF(MSVC) TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS BasicExample diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index dde5a41b..90d91b99 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -57,6 +57,9 @@ ENDIF(MSVC) TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS OpenGLExample diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index aa9b2899..54db88bd 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -57,6 +57,9 @@ ENDIF(MSVC) TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples") +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS PagingExample diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 55c9e934..c2fa3170 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -55,6 +55,9 @@ ENDIF(MSVC) TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples") +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS SmoothLODExample diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index bc2d3e40..788d934d 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -2,6 +2,7 @@ #include #include +#include //#include using namespace PolyVox; @@ -91,28 +92,7 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback vertex shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceCode(QGLShader::Vertex, - "#version 140\n" - - "in vec4 position; // This will be the position of the vertex in model-space\n" - - "// The usual matrices are provided\n" - "uniform mat4 cameraToClipMatrix;\n" - "uniform mat4 worldToCameraMatrix;\n" - "uniform mat4 modelToWorldMatrix;\n" - - "// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach\n" - "// but we use it in this example framework because not all surface extractor generate surface normals.\n" - "out vec4 worldPosition;\n" - - "void main()\n" - "{\n" - " // Standard sequence of OpenGL transformations.\n" - " worldPosition = modelToWorldMatrix * position;\n" - " vec4 cameraPosition = worldToCameraMatrix * worldPosition;\n" - " gl_Position = cameraToClipMatrix * cameraPosition;\n" - "}\n" - )) + if (!mShader->addShaderFromSourceFile(QGLShader::Vertex, QCoreApplication::applicationDirPath()+"/"+"example.vert")) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); @@ -120,27 +100,7 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback fragment shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceCode(QGLShader::Fragment, - "#version 130\n" - - "// Passed in from the vertex shader\n" - "in vec4 worldPosition;\n" - "in vec4 worldNormal;\n" - - "// the color that gets written to the display\n" - "out vec4 outputColor;\n" - - "void main()\n" - "{\n" - " // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback \n" - " // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations.\n" - " vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz)));\n" - - " // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. \n" - " // Obviously a real shader would also do texuring, lighting, or whatever is required for the application.\n" - " outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0);\n" - "}\n" - )) + if (!mShader->addShaderFromSourceFile(QGLShader::Fragment, QCoreApplication::applicationDirPath()+"/"+"example.frag")) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); diff --git a/examples/common/example.frag b/examples/common/example.frag new file mode 100644 index 00000000..c9cbf215 --- /dev/null +++ b/examples/common/example.frag @@ -0,0 +1,19 @@ +#version 130 + +// Passed in from the vertex shader +in vec4 worldPosition; +in vec4 worldNormal; + +// the color that gets written to the display +out vec4 outputColor; + +void main() +{ + // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback + // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. + // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. + outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); +} diff --git a/examples/common/example.vert b/examples/common/example.vert new file mode 100644 index 00000000..94d35f44 --- /dev/null +++ b/examples/common/example.vert @@ -0,0 +1,20 @@ +#version 140 + +in vec4 position; // This will be the position of the vertex in model-space + +// The usual matrices are provided +uniform mat4 cameraToClipMatrix; +uniform mat4 worldToCameraMatrix; +uniform mat4 modelToWorldMatrix; + +// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach +// but we use it in this example framework because not all surface extractor generate surface normals. +out vec4 worldPosition; + +void main() +{ + // Standard sequence of OpenGL transformations. + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + gl_Position = cameraToClipMatrix * cameraPosition; +} From 764c9ac97cf0efcfbe285625e388a11ae7a23d8b Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 27 May 2014 17:05:15 +0200 Subject: [PATCH 092/259] Simplified vertex types to structs with public members. Added (currently dummy) decode methods. --- .../PolyVoxCore/CubicSurfaceExtractor.inl | 7 +- .../MarchingCubesSurfaceExtractor.inl | 18 ++- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 18 +++ .../PolyVoxCore/PolyVoxForwardDeclarations.h | 4 +- .../include/PolyVoxCore/VertexTypes.h | 150 +++++------------- tests/TestSurfaceExtractor.cpp | 22 +-- 6 files changed, 95 insertions(+), 124 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 5bc067a9..f62ce7ae 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -214,7 +214,10 @@ namespace PolyVox if(rEntry.iIndex == -1) { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - rEntry.iIndex = m_meshCurrent->addVertex(CubicVertex(Vector3DFloat(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f), uMaterialIn)); + CubicVertex cubicVertex; + cubicVertex.position.setElements(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f); + cubicVertex.material = uMaterialIn; + rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); rEntry.uMaterial = uMaterialIn; return rEntry.iIndex; @@ -268,7 +271,7 @@ namespace PolyVox { //All four vertices of a given quad have the same material, //so just check that the first pair of vertices match. - if(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() == m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) + if(m_meshCurrent->getVertices()[q1.vertices[0]].material == m_meshCurrent->getVertices()[q2.vertices[0]].material) { //Now check whether quad 2 is adjacent to quad one by comparing vertices. //Adjacent quads must share two vertices, and the second quad could be to the diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 99998bf4..6b6a688b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -459,7 +459,11 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); + MarchingCubesVertex surfaceVertex; + surfaceVertex.position = v3dPosition; + surfaceVertex.normal = v3dNormal; + surfaceVertex.material = uMaterial; + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -488,7 +492,11 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); - MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); + MarchingCubesVertex surfaceVertex; + surfaceVertex.position = v3dPosition; + surfaceVertex.normal = v3dNormal; + surfaceVertex.material = uMaterial; + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -516,7 +524,11 @@ namespace PolyVox // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - const MarchingCubesVertex surfaceVertex(v3dPosition, v3dNormal, uMaterial); + MarchingCubesVertex surfaceVertex; + surfaceVertex.position = v3dPosition; + surfaceVertex.normal = v3dNormal; + surfaceVertex.material = uMaterial; + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index bcb40576..bad1a7fb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -100,6 +100,24 @@ namespace PolyVox template std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials); + + template + Mesh< Vertex< typename MeshType::VertexType::VoxelType > > decode(const MeshType& mesh) + { + Mesh< Vertex< typename MeshType::VertexType::VoxelType > > result; + result.m_vecVertices.reserve(mesh.m_vecVertices.size()); + + for(uint32_t ct = 0; ct < mesh.m_vecVertices.size(); ct++) + { + result.m_vecVertices[ct] = decode(mesh.m_vecVertices[ct]); + } + + result.m_vecTriangleIndices = mesh.m_vecTriangleIndices; + + result.m_Region = mesh.m_Region; + + return result; + } } #include "PolyVoxCore/Mesh.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 3d9ef742..49bd882c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -81,7 +81,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // CubicVertex //////////////////////////////////////////////////////////////////////////////// - template class CubicVertex; + template struct CubicVertex; //////////////////////////////////////////////////////////////////////////////// // Density @@ -111,7 +111,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesVertex; + template struct MarchingCubesVertex; //////////////////////////////////////////////////////////////////////////////// // Material diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index e8d938ae..1f421fd9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -32,134 +32,72 @@ freely, subject to the following restrictions: #include namespace PolyVox -{ -#ifdef SWIG - class CubicVertex +{ + #ifdef SWIG + struct Vertex #else template - class POLYVOX_API CubicVertex + struct POLYVOX_API Vertex #endif { - public: - typedef _VoxelType VoxelType; - CubicVertex() - { - } - - CubicVertex(Vector3DFloat positionToSet, VoxelType materialToSet) - :position(positionToSet) - ,material(materialToSet) - { - } - - CubicVertex(Vector3DFloat positionToSet, Vector3DFloat normalToSet, VoxelType materialToSet) - :position(positionToSet) - ,normal(normalToSet) - ,material(materialToSet) - { - } - - VoxelType getMaterial(void) const - { - return material; - } - - const Vector3DFloat& getNormal(void) const - { - return normal; - } - - const Vector3DFloat& getPosition(void) const - { - return position; - } - - void setMaterial(VoxelType materialToSet) - { - material = materialToSet; - } - - void setNormal(const Vector3DFloat& normalToSet) - { - normal = normalToSet; - } - - void setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } - - public: Vector3DFloat position; Vector3DFloat normal; VoxelType material; }; #ifdef SWIG - class MarchingCubesVertex + struct CubicVertex #else template - class POLYVOX_API MarchingCubesVertex + struct POLYVOX_API CubicVertex #endif { - public: - typedef _VoxelType VoxelType; - MarchingCubesVertex() - { - } - - MarchingCubesVertex(Vector3DFloat positionToSet, VoxelType materialToSet) - :position(positionToSet) - , material(materialToSet) - { - } - - MarchingCubesVertex(Vector3DFloat positionToSet, Vector3DFloat normalToSet, VoxelType materialToSet) - :position(positionToSet) - , normal(normalToSet) - , material(materialToSet) - { - } - - VoxelType getMaterial(void) const - { - return material; - } - - const Vector3DFloat& getNormal(void) const - { - return normal; - } - - const Vector3DFloat& getPosition(void) const - { - return position; - } - - void setMaterial(VoxelType materialToSet) - { - material = materialToSet; - } - - void setNormal(const Vector3DFloat& normalToSet) - { - normal = normalToSet; - } - - void setPosition(const Vector3DFloat& positionToSet) - { - position = positionToSet; - } - - public: Vector3DFloat position; Vector3DFloat normal; VoxelType material; }; + +#ifdef SWIG + struct MarchingCubesVertex +#else + template + struct POLYVOX_API MarchingCubesVertex +#endif + { + typedef _VoxelType VoxelType; + + Vector3DFloat position; + Vector3DFloat normal; + VoxelType material; + }; + + // Hopefully the compiler will implement the 'Return value optimization' here, but + // performance critical code will most likely decode the vertices in a shader anyway. + template + Vertex decode(const CubicVertex& cubicVertex) + { + Vertex result; + result.position = cubicVertex.position; + result.normal = cubicVertex.normal; + result.material = cubicVertex.material; + return result; + } + + // Hopefully the compiler will implement the 'Return value optimization' here, but + // performance critical code will most likely decode the vertices in a shader anyway. + template + Vertex decode(const MarchingCubesVertex& cubicVertex) + { + Vertex result; + result.position = cubicVertex.position; + result.normal = cubicVertex.normal; + result.material = cubicVertex.material; + return result; + } } #endif diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 2189b9c2..e621fa99 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -172,58 +172,58 @@ void TestSurfaceExtractor::testExecute() } QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh1 = testForType(); QCOMPARE(mesh1.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh1.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh1.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh1.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh2 = testForType(); QCOMPARE(mesh2.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh2.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh2.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh2.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh3 = testForType(); QCOMPARE(mesh3.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh3.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh3.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh3.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh4 = testForType(); QCOMPARE(mesh4.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh4.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh4.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh4.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh5 = testForType(); QCOMPARE(mesh5.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh5.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh5.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh5.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh6 = testForType(); QCOMPARE(mesh6.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh6.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh6.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh6.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh7 = testForType(); QCOMPARE(mesh7.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh7.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh7.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh7.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh8 = testForType(); QCOMPARE(mesh8.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh8.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh8.getVertices()[uMaterialToCheck].getMaterial(), static_cast(fNoMaterial)); + QCOMPARE(mesh8.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); auto mesh9 = testForType(); QCOMPARE(mesh9.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh9.getNoOfIndices(), uExpectedIndices); - //QCOMPARE(mesh9.getVertices()[uMaterialToCheck].getMaterial(), fExpectedMaterial); + //QCOMPARE(mesh9.getVertices()[uMaterialToCheck].material, fExpectedMaterial); //Test whether the CustomSurfaceExtractor works. /*testCustomController(floatMesh); QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial);*/ + QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].material, fNoMaterial);*/ } QTEST_MAIN(TestSurfaceExtractor) From 37ba9ab33870354268977c3e5384de207092d66b Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 27 May 2014 23:01:38 +0200 Subject: [PATCH 093/259] CubicVertex now uses a more memory efficient representation which can be decoded on the CPU or GPU. --- examples/Basic/main.cpp | 7 ++++--- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 2 +- library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h | 9 +++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index f123361b..a13da717 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -81,11 +81,12 @@ int main(int argc, char *argv[]) auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); - //auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); - //auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); + // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to + // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. + auto decodedMesh = decode(mesh); //Pass the surface to the OpenGL window - openGLWidget.addMesh(mesh); + openGLWidget.addMesh(decodedMesh); //openGLWidget.addMesh(mesh2); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index f62ce7ae..b152f90c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -215,7 +215,7 @@ namespace PolyVox { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. CubicVertex cubicVertex; - cubicVertex.position.setElements(static_cast(uX)-0.5f, static_cast(uY)-0.5f, static_cast(uZ)-0.5f); + cubicVertex.position.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); cubicVertex.material = uMaterialIn; rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); rEntry.uMaterial = uMaterialIn; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index bad1a7fb..d23f7716 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -105,7 +105,7 @@ namespace PolyVox Mesh< Vertex< typename MeshType::VertexType::VoxelType > > decode(const MeshType& mesh) { Mesh< Vertex< typename MeshType::VertexType::VoxelType > > result; - result.m_vecVertices.reserve(mesh.m_vecVertices.size()); + result.m_vecVertices.resize(mesh.m_vecVertices.size()); for(uint32_t ct = 0; ct < mesh.m_vecVertices.size(); ct++) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 1f421fd9..fc53fc2e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -56,8 +56,8 @@ namespace PolyVox { typedef _VoxelType VoxelType; - Vector3DFloat position; - Vector3DFloat normal; + Vector3DUint8 position; + uint8_t normal; VoxelType material; }; @@ -81,8 +81,9 @@ namespace PolyVox Vertex decode(const CubicVertex& cubicVertex) { Vertex result; - result.position = cubicVertex.position; - result.normal = cubicVertex.normal; + Vector3DUint8 temp = cubicVertex.position; // For some reason we can't cast Vector3DUint8 to Vector3DFloat - investigate why. + result.position = Vector3DFloat(temp.getX(), temp.getY(), temp.getZ()) - Vector3DFloat(0.5, 0.5, 0.5); + //result.normal = cubicVertex.normal; result.material = cubicVertex.material; return result; } From 35049b7a535ce94db3bc7ad1c9e863713cd370b1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 27 May 2014 23:23:24 +0200 Subject: [PATCH 094/259] Throw exception if extracted region is too large. --- examples/Paging/main.cpp | 10 ++++++---- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 3700c632..ee2d2d23 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -186,13 +186,15 @@ int main(int argc, char *argv[]) std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface - auto mesh = extractCubicMesh(&volData, reg); + auto mesh = extractCubicMesh(&volData, reg2); std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; - //Pass the surface to the OpenGL window - openGLWidget.addMesh(mesh); + auto decodedMesh = decode(mesh); - openGLWidget.setViewableRegion(reg); + //Pass the surface to the OpenGL window + openGLWidget.addMesh(decodedMesh); + + openGLWidget.setViewableRegion(reg2); //Run the message pump. return app.exec(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index b152f90c..da7803cd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -45,6 +45,12 @@ namespace PolyVox ,m_tBorderValue(tBorderValue) { m_funcIsQuadNeededCallback = isQuadNeeded; + + // This extractor has a limit as to how large the extracted region can be, because the vertex positions are encoded with a single byte per component. + int32_t maxReionDimension = 256; + POLYVOX_THROW_IF(region.getWidthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); + POLYVOX_THROW_IF(region.getHeightInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); + POLYVOX_THROW_IF(region.getDepthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); } template From c26686476d0dca9e8951c4e8a3242d77e93af16e Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 28 May 2014 10:29:05 +0100 Subject: [PATCH 095/259] Use Qt's resource system to store the shader source The shader source is included inside each comipled binary file. The OpenGL example also provides its own shader files which overrides the default. Common shader code is in the 'common' directory and each example's custom shader is alongside the example's C++ code. --- examples/Basic/CMakeLists.txt | 8 ++-- examples/OpenGL/CMakeLists.txt | 9 ++-- examples/OpenGL/main.cpp | 77 +----------------------------- examples/OpenGL/openglexample.frag | 45 +++++++++++++++++ examples/OpenGL/openglexample.qrc | 6 +++ examples/OpenGL/openglexample.vert | 26 ++++++++++ examples/Paging/CMakeLists.txt | 5 +- examples/SmoothLOD/CMakeLists.txt | 5 +- examples/common/OpenGLWidget.cpp | 4 +- examples/common/example.qrc | 6 +++ 10 files changed, 104 insertions(+), 87 deletions(-) create mode 100644 examples/OpenGL/openglexample.frag create mode 100644 examples/OpenGL/openglexample.qrc create mode 100644 examples/OpenGL/openglexample.vert create mode 100644 examples/common/example.qrc diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 4bf89fcb..2d89215b 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -47,17 +47,17 @@ FIND_PACKAGE(OpenGL REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + #Build -ADD_EXECUTABLE(BasicExample ${SRC_FILES}) +ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") -configure_file(../common/example.vert example.vert COPYONLY) -configure_file(../common/example.frag example.frag COPYONLY) - #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS BasicExample diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 90d91b99..d6db1712 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -49,17 +49,18 @@ FIND_PACKAGE(OpenGL REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +QT4_ADD_RESOURCES(OPENGLEXAMPLE_RESOURCES_RCC openglexample.qrc) + #Build -ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) +ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPLE_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") -configure_file(../common/example.vert example.vert COPYONLY) -configure_file(../common/example.frag example.frag COPYONLY) - #Install - Only install the example in Windows IF(WIN32) INSTALL(TARGETS OpenGLExample diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index c339fa0b..a4dc8ed4 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -90,86 +90,13 @@ int main(int argc, char *argv[]) QSharedPointer shader(new QGLShaderProgram); - if (!shader->addShaderFromSourceCode(QGLShader::Vertex, - "#version 140\n" - - "in vec4 position; // This will be the position of the vertex in model-space\n" - "in vec4 normal; // The normal data may not have been set\n" - "in ivec2 material;\n" - - "uniform mat4 cameraToClipMatrix;\n" - "uniform mat4 worldToCameraMatrix;\n" - "uniform mat4 modelToWorldMatrix;\n" - - "out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals\n" - "out vec3 normalFromVS;\n" - "flat out ivec2 materialFromVS;\n" - - "void main()\n" - "{\n" - " // Compute the usual OpenGL transformation to clip space.\n" - " gl_Position = cameraToClipMatrix * worldToCameraMatrix * modelToWorldMatrix * position;\n" - - " // This example is demonstrating the marching cubes mesh, which does have per-vertex normals. We can \n" - " // just pass them through, though real code might want to deal with transforming normals appropriatly.\n" - " normalFromVS = normal.xyz;\n" - - " // Nothing special here, we just pass the material through to the fragment shader.\n" - " materialFromVS = material;\n" - "}\n" - )) + if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/openglexample.vert")) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - if (!shader->addShaderFromSourceCode(QGLShader::Fragment, - "#version 130\n" - - "in vec4 worldPosition; //Passed in from the vertex shader\n" - "in vec3 normalFromVS;\n" - "flat in ivec2 materialFromVS;\n" - - "out vec4 outputColor;\n" - - "void main()\n" - "{\n" - " // The first byte of our voxel data is the material.\n" - " // We use this to decide how to color the fragment.\n" - " vec4 surfaceColor;\n" - " switch(materialFromVS.x)\n" - " {\n" - " case 1:\n" - " surfaceColor = vec4(1.0, 0.0, 0.0, 1.0);\n" - " break;\n" - " case 2:\n" - " surfaceColor = vec4(0.0, 1.0, 0.0, 1.0);\n" - " break;\n" - " case 3:\n" - " surfaceColor = vec4(0.0, 0.0, 1.0, 1.0);\n" - " break;\n" - " case 4:\n" - " surfaceColor = vec4(1.0, 1.0, 0.0, 1.0);\n" - " break;\n" - " case 5:\n" - " surfaceColor = vec4(1.0, 0.0, 1.0, 1.0);\n" - " break;\n" - " default:\n" - " surfaceColor = vec4(1.0, 1.0, 1.0, 1.0);\n" - " break;\n" - " }\n" - - " // Quick and dirty lighting, obviously a real implementation\n" - " // should pass light properties as shader parameters, etc.\n" - " vec3 lightDir = vec3(0.0, 0.0, 1.0);\n" - " float diffuse = clamp(dot(lightDir, normalFromVS), 0.0, 1.0);\n" - " diffuse *= 0.7; // Dim the diffuse a bit\n" - " float ambient = 0.3; // Add some ambient\n" - " float lightIntensity = diffuse + ambient; // Compute the final light intensity\n" - - " outputColor = surfaceColor * lightIntensity; //Compute final rendered color\n" - "}\n" - )) + if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/openglexample.frag")) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); diff --git a/examples/OpenGL/openglexample.frag b/examples/OpenGL/openglexample.frag new file mode 100644 index 00000000..75aa0e74 --- /dev/null +++ b/examples/OpenGL/openglexample.frag @@ -0,0 +1,45 @@ +#version 130 + +in vec4 worldPosition; //Passed in from the vertex shader +in vec3 normalFromVS; +flat in ivec2 materialFromVS; + +out vec4 outputColor; + +void main() +{ + // The first byte of our voxel data is the material. + // We use this to decide how to color the fragment. + vec4 surfaceColor; + switch(materialFromVS.x) + { + case 1: + surfaceColor = vec4(1.0, 0.0, 0.0, 1.0); + break; + case 2: + surfaceColor = vec4(0.0, 1.0, 0.0, 1.0); + break; + case 3: + surfaceColor = vec4(0.0, 0.0, 1.0, 1.0); + break; + case 4: + surfaceColor = vec4(1.0, 1.0, 0.0, 1.0); + break; + case 5: + surfaceColor = vec4(1.0, 0.0, 1.0, 1.0); + break; + default: + surfaceColor = vec4(1.0, 1.0, 1.0, 1.0); + break; + } + + // Quick and dirty lighting, obviously a real implementation + // should pass light properties as shader parameters, etc. + vec3 lightDir = vec3(0.0, 0.0, 1.0); + float diffuse = clamp(dot(lightDir, normalFromVS), 0.0, 1.0); + diffuse *= 0.7; // Dim the diffuse a bit + float ambient = 0.3; // Add some ambient + float lightIntensity = diffuse + ambient; // Compute the final light intensity + + outputColor = surfaceColor * lightIntensity; //Compute final rendered color +} diff --git a/examples/OpenGL/openglexample.qrc b/examples/OpenGL/openglexample.qrc new file mode 100644 index 00000000..128acb5a --- /dev/null +++ b/examples/OpenGL/openglexample.qrc @@ -0,0 +1,6 @@ + + + openglexample.vert + openglexample.frag + + diff --git a/examples/OpenGL/openglexample.vert b/examples/OpenGL/openglexample.vert new file mode 100644 index 00000000..381fac12 --- /dev/null +++ b/examples/OpenGL/openglexample.vert @@ -0,0 +1,26 @@ +#version 140 + +in vec4 position; // This will be the position of the vertex in model-space +in vec4 normal; // The normal data may not have been set +in ivec2 material; + +uniform mat4 cameraToClipMatrix; +uniform mat4 worldToCameraMatrix; +uniform mat4 modelToWorldMatrix; + +out vec4 worldPosition; //This is being passed to the fragment shader to calculate the normals +out vec3 normalFromVS; +flat out ivec2 materialFromVS; + +void main() +{ + // Compute the usual OpenGL transformation to clip space. + gl_Position = cameraToClipMatrix * worldToCameraMatrix * modelToWorldMatrix * position; + + // This example is demonstrating the marching cubes mesh, which does have per-vertex normals. We can + // just pass them through, though real code might want to deal with transforming normals appropriatly. + normalFromVS = normal.xyz; + + // Nothing special here, we just pass the material through to the fragment shader. + materialFromVS = material; +} diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index 54db88bd..3566e76e 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -49,8 +49,11 @@ FIND_PACKAGE(OpenGL REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + #Build -ADD_EXECUTABLE(PagingExample ${SRC_FILES}) +ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index c2fa3170..4a024664 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -47,8 +47,11 @@ FIND_PACKAGE(OpenGL REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + #Build -ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES}) +ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings ENDIF(MSVC) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 788d934d..439264bf 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -92,7 +92,7 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback vertex shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceFile(QGLShader::Vertex, QCoreApplication::applicationDirPath()+"/"+"example.vert")) + if (!mShader->addShaderFromSourceFile(QGLShader::Vertex, ":/example.vert")) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); @@ -100,7 +100,7 @@ void OpenGLWidget::initializeGL() // This is basically a simple fallback fragment shader which does the most basic rendering possible. // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceFile(QGLShader::Fragment, QCoreApplication::applicationDirPath()+"/"+"example.frag")) + if (!mShader->addShaderFromSourceFile(QGLShader::Fragment, ":/example.frag")) { std::cerr << mShader->log().toStdString() << std::endl; exit(EXIT_FAILURE); diff --git a/examples/common/example.qrc b/examples/common/example.qrc new file mode 100644 index 00000000..8efd5747 --- /dev/null +++ b/examples/common/example.qrc @@ -0,0 +1,6 @@ + + + example.vert + example.frag + + From e9ba998f2ff041d5df4b03968fee91a003f2fd4b Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 28 May 2014 14:03:26 +0200 Subject: [PATCH 096/259] Changes to the folder organization of some files in Visual Studio (via CMake's source_group). --- examples/Basic/CMakeLists.txt | 8 +++----- examples/OpenGL/CMakeLists.txt | 8 +++----- examples/Paging/CMakeLists.txt | 8 +++----- examples/Python/CMakeLists.txt | 2 -- examples/SmoothLOD/CMakeLists.txt | 8 +++----- library/PolyVoxCore/CMakeLists.txt | 8 ++++---- library/PolyVoxUtil/CMakeLists.txt | 4 ++-- 7 files changed, 18 insertions(+), 28 deletions(-) diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 2d89215b..c34dc96c 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -36,11 +36,6 @@ SET(INC_FILES add_definitions(-DGLEW_STATIC) -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Sources" FILES ${SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${INC_FILES}) - FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) @@ -50,6 +45,9 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + #Build ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index d6db1712..14e9f4d1 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -38,11 +38,6 @@ SET(INC_FILES add_definitions(-DGLEW_STATIC) -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Sources" FILES ${SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${INC_FILES}) - FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) @@ -53,6 +48,9 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) QT4_ADD_RESOURCES(OPENGLEXAMPLE_RESOURCES_RCC openglexample.qrc) +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} openglexample.qrc ${OPENGLEXAMPLE_RESOURCES_RCC}) + #Build ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPLE_RESOURCES_RCC}) IF(MSVC) diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index 3566e76e..95a3ef8a 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -38,11 +38,6 @@ SET(INC_FILES add_definitions(-DGLEW_STATIC) -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Sources" FILES ${SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${INC_FILES}) - FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) @@ -52,6 +47,9 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + #Build ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) diff --git a/examples/Python/CMakeLists.txt b/examples/Python/CMakeLists.txt index 1d101d6e..dd7176a7 100644 --- a/examples/Python/CMakeLists.txt +++ b/examples/Python/CMakeLists.txt @@ -21,6 +21,4 @@ PROJECT(PythonExample) -SOURCE_GROUP("Sources" FILES PythonExample.py) - configure_file(PythonExample.py PythonExample.py COPYONLY) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 4a024664..abdc59e5 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -36,11 +36,6 @@ SET(INC_FILES add_definitions(-DGLEW_STATIC) -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Sources" FILES ${SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${INC_FILES}) - FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) @@ -50,6 +45,9 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + #Build ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 42844fce..3fbb260b 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -130,11 +130,11 @@ SET(IMPL_INC_FILES #"Sources" and "Headers" are the group names in Visual Studio. #They may have other uses too... -SOURCE_GROUP("Sources" FILES ${CORE_SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${CORE_INC_FILES}) +SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) +SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) -SOURCE_GROUP("Sources\\Impl" FILES ${IMPL_SRC_FILES}) -SOURCE_GROUP("Headers\\Impl" FILES ${IMPL_INC_FILES}) +SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) +SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) #Tell CMake the paths INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt index 7fbdb43e..2160dc5c 100644 --- a/library/PolyVoxUtil/CMakeLists.txt +++ b/library/PolyVoxUtil/CMakeLists.txt @@ -36,8 +36,8 @@ ADD_DEFINITIONS(-DPOLYVOX_SHARED_EXPORTS) #Export symbols in the .dll #"Sources" and "Headers" are the group names in Visual Studio. #They may have other uses too... -SOURCE_GROUP("Sources" FILES ${UTIL_SRC_FILES}) -SOURCE_GROUP("Headers" FILES ${UTIL_INC_FILES}) +SOURCE_GROUP("Source Files" FILES ${UTIL_SRC_FILES}) +SOURCE_GROUP("Header Files" FILES ${UTIL_INC_FILES}) #Tell CMake the paths INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include) From 85c5686ff9e48db239b783edececaf652c6b4b99 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 09:53:16 +0200 Subject: [PATCH 097/259] Work on more compact version of MarchingCubesVertex. --- examples/OpenGL/main.cpp | 5 ++++- .../PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 9 ++++++--- library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h | 5 +++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index a4dc8ed4..a95d66e5 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -127,8 +127,11 @@ int main(int argc, char *argv[]) // Perform the extraction for this region of the volume auto mesh = extractMarchingCubesMesh(&volData, regToExtract); + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMesh = decode(mesh); + //Pass the surface to the OpenGL window - openGLWidget.addMesh(mesh, Vector3DInt32(x, y, z)); + openGLWidget.addMesh(decodedMesh, Vector3DInt32(x, y, z)); meshCounter++; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 6b6a688b..bbe18ad2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -446,6 +446,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); + const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); @@ -460,7 +461,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPosition; + surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; surfaceVertex.material = uMaterial; @@ -479,6 +480,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); + const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); @@ -493,7 +495,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPosition; + surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; surfaceVertex.material = uMaterial; @@ -512,6 +514,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); + const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so @@ -525,7 +528,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPosition; + surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; surfaceVertex.material = uMaterial; diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index fc53fc2e..1044f472 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -70,7 +70,7 @@ namespace PolyVox { typedef _VoxelType VoxelType; - Vector3DFloat position; + Vector3DUint16 position; Vector3DFloat normal; VoxelType material; }; @@ -94,7 +94,8 @@ namespace PolyVox Vertex decode(const MarchingCubesVertex& cubicVertex) { Vertex result; - result.position = cubicVertex.position; + result.position = Vector3DFloat(cubicVertex.position.getX(), cubicVertex.position.getY(), cubicVertex.position.getZ()); + result.position *= (1.0 / 256.0); result.normal = cubicVertex.normal; result.material = cubicVertex.material; return result; From 2090b0087c8a95ead22fcd66e1a93224f062fa82 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 11:39:29 +0200 Subject: [PATCH 098/259] Vertices now carry general purpose 'data' rather than a 'material', though the data will be treated as a material in many cases. This is part of making the architecture more generic and involves some renaming. --- examples/SmoothLOD/main.cpp | 8 +++-- examples/common/OpenGLWidget.h | 4 +-- .../PolyVoxCore/CubicSurfaceExtractor.inl | 6 ++-- .../MarchingCubesSurfaceExtractor.inl | 6 ++-- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 4 +-- .../include/PolyVoxCore/VertexTypes.h | 34 +++++++++---------- tests/TestSurfaceExtractor.cpp | 24 ++++++------- 7 files changed, 45 insertions(+), 41 deletions(-) diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 60b35c98..01c2fdaf 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -91,13 +91,17 @@ int main(int argc, char *argv[]) //Extract the surface auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMeshLowLOD = decode(meshLowLOD); //Extract the surface auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMeshHighLOD = decode(meshHighLOD); //Pass the surface to the OpenGL window - openGLWidget.addMesh(meshHighLOD, Vector3DInt32(30, 0, 0)); - openGLWidget.addMesh(meshLowLOD, Vector3DInt32(0, 0, 0), 63.0f / 31.0f); + openGLWidget.addMesh(decodedMeshHighLOD, Vector3DInt32(30, 0, 0)); + openGLWidget.addMesh(decodedMeshLowLOD, Vector3DInt32(0, 0, 0), 63.0f / 31.0f); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index eaff700a..930cb3d8 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -92,8 +92,8 @@ public: // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(typename MeshType::VertexType::VoxelType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, material))); + GLint size = (std::min)(sizeof(typename MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, data))); // We're done uploading and can now unbind. glBindVertexArray(0); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index da7803cd..7fe9286b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -222,7 +222,7 @@ namespace PolyVox //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. CubicVertex cubicVertex; cubicVertex.position.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); - cubicVertex.material = uMaterialIn; + cubicVertex.data = uMaterialIn; rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); rEntry.uMaterial = uMaterialIn; @@ -275,9 +275,9 @@ namespace PolyVox template bool CubicSurfaceExtractor::mergeQuads(Quad& q1, Quad& q2) { - //All four vertices of a given quad have the same material, + //All four vertices of a given quad have the same data, //so just check that the first pair of vertices match. - if(m_meshCurrent->getVertices()[q1.vertices[0]].material == m_meshCurrent->getVertices()[q2.vertices[0]].material) + if (m_meshCurrent->getVertices()[q1.vertices[0]].data == m_meshCurrent->getVertices()[q2.vertices[0]].data) { //Now check whether quad 2 is adjacent to quad one by comparing vertices. //Adjacent quads must share two vertices, and the second quad could be to the diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index bbe18ad2..1b50431e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -463,7 +463,7 @@ namespace PolyVox MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; - surfaceVertex.material = uMaterial; + surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -497,7 +497,7 @@ namespace PolyVox MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; - surfaceVertex.material = uMaterial; + surfaceVertex.data = uMaterial; uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; @@ -530,7 +530,7 @@ namespace PolyVox MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dPositionAsUint; surfaceVertex.normal = v3dNormal; - surfaceVertex.material = uMaterial; + surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index d23f7716..f0ce39ea 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -102,9 +102,9 @@ namespace PolyVox std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials); template - Mesh< Vertex< typename MeshType::VertexType::VoxelType > > decode(const MeshType& mesh) + Mesh< Vertex< typename MeshType::VertexType::DataType > > decode(const MeshType& mesh) { - Mesh< Vertex< typename MeshType::VertexType::VoxelType > > result; + Mesh< Vertex< typename MeshType::VertexType::DataType > > result; result.m_vecVertices.resize(mesh.m_vecVertices.size()); for(uint32_t ct = 0; ct < mesh.m_vecVertices.size(); ct++) diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index 1044f472..dcab6c17 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -36,68 +36,68 @@ namespace PolyVox #ifdef SWIG struct Vertex #else - template + template struct POLYVOX_API Vertex #endif { - typedef _VoxelType VoxelType; + typedef _DataType DataType; Vector3DFloat position; Vector3DFloat normal; - VoxelType material; + DataType data; }; #ifdef SWIG struct CubicVertex #else - template + template struct POLYVOX_API CubicVertex #endif { - typedef _VoxelType VoxelType; + typedef _DataType DataType; Vector3DUint8 position; uint8_t normal; - VoxelType material; + DataType data; }; #ifdef SWIG struct MarchingCubesVertex #else - template + template struct POLYVOX_API MarchingCubesVertex #endif { - typedef _VoxelType VoxelType; + typedef _DataType DataType; Vector3DUint16 position; Vector3DFloat normal; - VoxelType material; + DataType data; }; // Hopefully the compiler will implement the 'Return value optimization' here, but // performance critical code will most likely decode the vertices in a shader anyway. - template - Vertex decode(const CubicVertex& cubicVertex) + template + Vertex decode(const CubicVertex& cubicVertex) { - Vertex result; + Vertex result; Vector3DUint8 temp = cubicVertex.position; // For some reason we can't cast Vector3DUint8 to Vector3DFloat - investigate why. result.position = Vector3DFloat(temp.getX(), temp.getY(), temp.getZ()) - Vector3DFloat(0.5, 0.5, 0.5); //result.normal = cubicVertex.normal; - result.material = cubicVertex.material; + result.data = cubicVertex.data; return result; } // Hopefully the compiler will implement the 'Return value optimization' here, but // performance critical code will most likely decode the vertices in a shader anyway. - template - Vertex decode(const MarchingCubesVertex& cubicVertex) + template + Vertex decode(const MarchingCubesVertex& cubicVertex) { - Vertex result; + Vertex result; result.position = Vector3DFloat(cubicVertex.position.getX(), cubicVertex.position.getY(), cubicVertex.position.getZ()); result.position *= (1.0 / 256.0); result.normal = cubicVertex.normal; - result.material = cubicVertex.material; + result.data = cubicVertex.data; return result; } } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index e621fa99..682fa0dc 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -162,7 +162,7 @@ void TestSurfaceExtractor::testExecute() const static uint32_t uExpectedVertices = 4731; const static uint32_t uExpectedIndices = 12810; const static uint32_t uMaterialToCheck = 3000; - const static float fExpectedMaterial = 42.0f; + const static float fExpectedData = 42.0f; const static float fNoMaterial = 1.0f; Mesh > mesh; @@ -172,58 +172,58 @@ void TestSurfaceExtractor::testExecute() } QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh1 = testForType(); QCOMPARE(mesh1.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh1.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh1.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh1.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh2 = testForType(); QCOMPARE(mesh2.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh2.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh2.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh2.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh3 = testForType(); QCOMPARE(mesh3.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh3.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh3.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh3.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh4 = testForType(); QCOMPARE(mesh4.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh4.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh4.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh4.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh5 = testForType(); QCOMPARE(mesh5.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh5.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh5.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh5.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh6 = testForType(); QCOMPARE(mesh6.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh6.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh6.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh6.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh7 = testForType(); QCOMPARE(mesh7.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh7.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh7.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh7.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh8 = testForType(); QCOMPARE(mesh8.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh8.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh8.getVertices()[uMaterialToCheck].material, static_cast(fNoMaterial)); + QCOMPARE(mesh8.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); auto mesh9 = testForType(); QCOMPARE(mesh9.getNoOfVertices(), uExpectedVertices); QCOMPARE(mesh9.getNoOfIndices(), uExpectedIndices); - //QCOMPARE(mesh9.getVertices()[uMaterialToCheck].material, fExpectedMaterial); + //QCOMPARE(mesh9.getVertices()[uMaterialToCheck].data, fExpectedMaterial); //Test whether the CustomSurfaceExtractor works. /*testCustomController(floatMesh); QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].material, fNoMaterial);*/ + QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].data, fExpectedData);*/ } QTEST_MAIN(TestSurfaceExtractor) From b635e9d29dd51e23b572eb99d599ae9688a4c923 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 12:20:33 +0200 Subject: [PATCH 099/259] Copied BasicExample as base for new 'DecodeOnGPU' example. --- CMakeLists.txt | 1 + examples/DecodeOnGPU/CMakeLists.txt | 74 ++++++++++++++++++++++ examples/DecodeOnGPU/main.cpp | 95 +++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 examples/DecodeOnGPU/CMakeLists.txt create mode 100644 examples/DecodeOnGPU/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 6691be4a..ae1cdeb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) ADD_SUBDIRECTORY(examples/Paging) ADD_SUBDIRECTORY(examples/OpenGL) ADD_SUBDIRECTORY(examples/SmoothLOD) + ADD_SUBDIRECTORY(examples/DecodeOnGPU) ADD_SUBDIRECTORY(examples/Python) SET(BUILD_EXAMPLES ON) ELSE() diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt new file mode 100644 index 00000000..fb298715 --- /dev/null +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -0,0 +1,74 @@ +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(DecodeOnGPUExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp +) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET DecodeOnGPUExample PROPERTY FOLDER "Examples") + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS DecodeOnGPUExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp new file mode 100644 index 00000000..a13da717 --- /dev/null +++ b/examples/DecodeOnGPU/main.cpp @@ -0,0 +1,95 @@ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "OpenGLWidget.h" + +#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/SimpleVolume.h" + +#include + +//Use the PolyVox namespace +using namespace PolyVox; + +void createSphereInVolume(SimpleVolume& volData, float fRadius) +{ + //This vector hold the position of the center of the volume + Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + uint8_t uVoxelValue = 0; + + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new voxel value + uVoxelValue = 255; + } + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, uVoxelValue); + } + } + } +} + +int main(int argc, char *argv[]) +{ + //Create and show the Qt OpenGL window + QApplication app(argc, argv); + OpenGLWidget openGLWidget(0); + openGLWidget.show(); + + //Create an empty volume and then place a sphere in it + SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + createSphereInVolume(volData, 30); + + // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. + auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + + // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to + // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. + auto decodedMesh = decode(mesh); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(decodedMesh); + //openGLWidget.addMesh(mesh2); + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + + //Run the message pump. + return app.exec(); +} \ No newline at end of file From f945fd4ce4feb4f5b0af60510fe656e36f0a836f Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 12:38:43 +0200 Subject: [PATCH 100/259] Work on example to decode vertices on the GPU. --- examples/DecodeOnGPU/main.cpp | 57 ++++++++++++++++++++++++++++++++-- examples/common/OpenGLWidget.h | 19 +++++++----- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index a13da717..83950b1b 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -66,6 +66,58 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) } } +OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::Vertex< uint8_t > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) +{ + // Convienient access to the vertices and indices + const auto& vecIndices = surfaceMesh.getIndices(); + const auto& vecVertices = surfaceMesh.getVertices(); + + // This struct holds the OpenGL properties (buffer handles, etc) which will be used + // to render our mesh. We copy the data from the PolyVox mesh into this structure. + OpenGLMeshData meshData; + + // Create the VAO for the mesh + glGenVertexArrays(1, &(meshData.vertexArrayObject)); + glBindVertexArray(meshData.vertexArrayObject); + + // The GL_ARRAY_BUFFER will contain the list of vertex positions + glGenBuffers(1, &(meshData.vertexBuffer)); + glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(Vertex< uint8_t >), vecVertices.data(), GL_STATIC_DRAW); + + // and GL_ELEMENT_ARRAY_BUFFER will contain the indices + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); + + // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out + glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor + // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the + // shader. This is mostly just to simplify this example code - in a real application you will know whether your + // chosen surface extractor generates normals and can skip uploading them if not. + glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, normal))); + + // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code + // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. + glEnableVertexAttribArray(2); //We're talking about shader attribute '2' + GLint size = (std::min)(sizeof(uint8_t), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, data))); + + // We're done uploading and can now unbind. + glBindVertexArray(0); + + // A few additional properties can be copied across for use during rendering. + meshData.noOfIndices = vecIndices.size(); + meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); + meshData.scale = scale; + + return meshData; +} + int main(int argc, char *argv[]) { //Create and show the Qt OpenGL window @@ -86,8 +138,9 @@ int main(int argc, char *argv[]) auto decodedMesh = decode(mesh); //Pass the surface to the OpenGL window - openGLWidget.addMesh(decodedMesh); - //openGLWidget.addMesh(mesh2); + OpenGLMeshData meshData = buildOpenGLMeshData(decodedMesh); + openGLWidget.addMeshData(meshData); + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); //Run the message pump. diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 930cb3d8..a0150556 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -53,8 +53,8 @@ public: OpenGLWidget(QWidget *parent); // Convert a PolyVox mesh to OpenGL index/vertex buffers. Inlined because it's templatised. - template - void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) + template + void addMesh(const PolyVox::Mesh< PolyVox::Vertex< DataType > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) { // Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -71,7 +71,7 @@ public: // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(typename MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(Vertex< DataType >), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); @@ -80,20 +80,20 @@ public: // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(typename MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, data))); + GLint size = (std::min)(sizeof(DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, data))); // We're done uploading and can now unbind. glBindVertexArray(0); @@ -104,6 +104,11 @@ public: meshData.scale = scale; // Now add the mesh to the list of meshes to render. + addMeshData(meshData); + } + + void addMeshData(OpenGLMeshData meshData) + { mMeshData.push_back(meshData); } From 8604d1209eb2e2ebbd260b65c27f550887b9c95a Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 14:23:22 +0200 Subject: [PATCH 101/259] Initial version of decoding shaders. --- examples/DecodeOnGPU/CMakeLists.txt | 5 +++-- examples/DecodeOnGPU/decode.frag | 19 +++++++++++++++++++ examples/DecodeOnGPU/decode.qrc | 6 ++++++ examples/DecodeOnGPU/decode.vert | 20 ++++++++++++++++++++ examples/DecodeOnGPU/main.cpp | 16 ++++++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 examples/DecodeOnGPU/decode.frag create mode 100644 examples/DecodeOnGPU/decode.qrc create mode 100644 examples/DecodeOnGPU/decode.vert diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt index fb298715..07f87101 100644 --- a/examples/DecodeOnGPU/CMakeLists.txt +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -44,12 +44,13 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +QT4_ADD_RESOURCES(DECODE_RESOURCES_RCC decode.qrc) # Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} decode.qrc ${DECODE_RESOURCES_RCC}) #Build -ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) +ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${DECODE_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) diff --git a/examples/DecodeOnGPU/decode.frag b/examples/DecodeOnGPU/decode.frag new file mode 100644 index 00000000..c9cbf215 --- /dev/null +++ b/examples/DecodeOnGPU/decode.frag @@ -0,0 +1,19 @@ +#version 130 + +// Passed in from the vertex shader +in vec4 worldPosition; +in vec4 worldNormal; + +// the color that gets written to the display +out vec4 outputColor; + +void main() +{ + // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback + // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. + // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. + outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); +} diff --git a/examples/DecodeOnGPU/decode.qrc b/examples/DecodeOnGPU/decode.qrc new file mode 100644 index 00000000..f29bc1ad --- /dev/null +++ b/examples/DecodeOnGPU/decode.qrc @@ -0,0 +1,6 @@ + + + decode.vert + decode.frag + + diff --git a/examples/DecodeOnGPU/decode.vert b/examples/DecodeOnGPU/decode.vert new file mode 100644 index 00000000..94d35f44 --- /dev/null +++ b/examples/DecodeOnGPU/decode.vert @@ -0,0 +1,20 @@ +#version 140 + +in vec4 position; // This will be the position of the vertex in model-space + +// The usual matrices are provided +uniform mat4 cameraToClipMatrix; +uniform mat4 worldToCameraMatrix; +uniform mat4 modelToWorldMatrix; + +// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach +// but we use it in this example framework because not all surface extractor generate surface normals. +out vec4 worldPosition; + +void main() +{ + // Standard sequence of OpenGL transformations. + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + gl_Position = cameraToClipMatrix * cameraPosition; +} diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 83950b1b..3a36fd48 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -125,6 +125,22 @@ int main(int argc, char *argv[]) OpenGLWidget openGLWidget(0); openGLWidget.show(); + QSharedPointer shader(new QGLShaderProgram); + + if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/decode.vert")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/decode.frag")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + openGLWidget.setShader(shader); + //Create an empty volume and then place a sphere in it SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); From e40eb6d7620b572ee10572f26fb8a625fe5da1be Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 19:29:15 +0200 Subject: [PATCH 102/259] Work on GPU decoding. --- examples/DecodeOnGPU/decode.vert | 7 ++++-- examples/DecodeOnGPU/main.cpp | 22 +++++++++++-------- .../MarchingCubesSurfaceExtractor.inl | 12 +++++----- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/examples/DecodeOnGPU/decode.vert b/examples/DecodeOnGPU/decode.vert index 94d35f44..de61bc42 100644 --- a/examples/DecodeOnGPU/decode.vert +++ b/examples/DecodeOnGPU/decode.vert @@ -1,6 +1,6 @@ #version 140 -in vec4 position; // This will be the position of the vertex in model-space +in uvec4 position; // This will be the position of the vertex in model-space // The usual matrices are provided uniform mat4 cameraToClipMatrix; @@ -13,8 +13,11 @@ out vec4 worldPosition; void main() { + vec4 decodedPosition = position; + decodedPosition.xyz = decodedPosition.xyz * (1.0 / 256.0); + // Standard sequence of OpenGL transformations. - worldPosition = modelToWorldMatrix * position; + worldPosition = modelToWorldMatrix * decodedPosition; vec4 cameraPosition = worldToCameraMatrix * worldPosition; gl_Position = cameraToClipMatrix * cameraPosition; } diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 3a36fd48..fd1e0b16 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -66,7 +66,7 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) } } -OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::Vertex< uint8_t > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) +OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) { // Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -83,7 +83,7 @@ OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::Vertex< uint8_t // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(Vertex< uint8_t >), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex< uint8_t >), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); @@ -92,20 +92,20 @@ OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::Vertex< uint8_t // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribIPointer(0, 3, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' GLint size = (std::min)(sizeof(uint8_t), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(Vertex< uint8_t >), (GLvoid*)(offsetof(Vertex< uint8_t >, data))); + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, data))); // We're done uploading and can now unbind. glBindVertexArray(0); @@ -133,12 +133,16 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + std::cout << shader->log().toStdString() << std::endl; + if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/decode.frag")) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } + std::cout << shader->log().toStdString() << std::endl; + openGLWidget.setShader(shader); //Create an empty volume and then place a sphere in it @@ -146,15 +150,15 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); - //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. - auto decodedMesh = decode(mesh); + //auto decodedMesh = decode(mesh); //Pass the surface to the OpenGL window - OpenGLMeshData meshData = buildOpenGLMeshData(decodedMesh); + OpenGLMeshData meshData = buildOpenGLMeshData(mesh); openGLWidget.addMeshData(meshData); openGLWidget.setViewableRegion(volData.getEnclosingRegion()); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 1b50431e..3fedba49 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -446,7 +446,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); - const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); @@ -461,7 +461,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPositionAsUint; + surfaceVertex.position = v3dScaledPosition; surfaceVertex.normal = v3dNormal; surfaceVertex.data = uMaterial; @@ -480,7 +480,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); - const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); @@ -495,7 +495,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPositionAsUint; + surfaceVertex.position = v3dScaledPosition; surfaceVertex.normal = v3dNormal; surfaceVertex.data = uMaterial; @@ -514,7 +514,7 @@ namespace PolyVox const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); - const Vector3DUint16 v3dPositionAsUint(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so @@ -528,7 +528,7 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dPositionAsUint; + surfaceVertex.position = v3dScaledPosition; surfaceVertex.normal = v3dNormal; surfaceVertex.data = uMaterial; From a6a1c4dbb74c2c10baf4fef120a4206a3fd31b52 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 19:34:43 +0200 Subject: [PATCH 103/259] Getting ready to decode normal. --- examples/DecodeOnGPU/decode.frag | 4 ++-- examples/DecodeOnGPU/decode.vert | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/DecodeOnGPU/decode.frag b/examples/DecodeOnGPU/decode.frag index c9cbf215..fb576125 100644 --- a/examples/DecodeOnGPU/decode.frag +++ b/examples/DecodeOnGPU/decode.frag @@ -11,9 +11,9 @@ void main() { // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + //vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. - outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); + outputColor = vec4(abs(worldNormal.xyz) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); } diff --git a/examples/DecodeOnGPU/decode.vert b/examples/DecodeOnGPU/decode.vert index de61bc42..00675617 100644 --- a/examples/DecodeOnGPU/decode.vert +++ b/examples/DecodeOnGPU/decode.vert @@ -1,6 +1,7 @@ #version 140 in uvec4 position; // This will be the position of the vertex in model-space +in vec4 normal; // The usual matrices are provided uniform mat4 cameraToClipMatrix; @@ -10,12 +11,15 @@ uniform mat4 modelToWorldMatrix; // This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach // but we use it in this example framework because not all surface extractor generate surface normals. out vec4 worldPosition; +out vec4 worldNormal; void main() { vec4 decodedPosition = position; decodedPosition.xyz = decodedPosition.xyz * (1.0 / 256.0); + worldNormal = normal; + // Standard sequence of OpenGL transformations. worldPosition = modelToWorldMatrix * decodedPosition; vec4 cameraPosition = worldToCameraMatrix * worldPosition; From 2c916300eaabbc550e5b741faa6c0dc751b59961 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 21:45:26 +0200 Subject: [PATCH 104/259] Work on encoded marching cubes normals. --- .../MarchingCubesSurfaceExtractor.inl | 33 +++++++++++++++++-- .../include/PolyVoxCore/VertexTypes.h | 17 +++++++--- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 3fedba49..9514e22e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -457,12 +457,21 @@ namespace PolyVox v3dNormal.normalise(); } + v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); + uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); + uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); + uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); + POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); + uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = v3dNormal; + surfaceVertex.normal = encodedNormal; surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -491,12 +500,21 @@ namespace PolyVox v3dNormal.normalise(); } + v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); + uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); + uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); + uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); + POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); + uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = v3dNormal; + surfaceVertex.normal = encodedNormal; surfaceVertex.data = uMaterial; uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -524,12 +542,21 @@ namespace PolyVox v3dNormal.normalise(); } + v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); + uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); + uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); + uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); + POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); + uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; + // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = v3dNormal; + surfaceVertex.normal = encodedNormal; surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index dcab6c17..a4c31b27 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -71,7 +71,7 @@ namespace PolyVox typedef _DataType DataType; Vector3DUint16 position; - Vector3DFloat normal; + uint16_t normal; DataType data; }; @@ -91,13 +91,20 @@ namespace PolyVox // Hopefully the compiler will implement the 'Return value optimization' here, but // performance critical code will most likely decode the vertices in a shader anyway. template - Vertex decode(const MarchingCubesVertex& cubicVertex) + Vertex decode(const MarchingCubesVertex& marchingCubesVertex) { Vertex result; - result.position = Vector3DFloat(cubicVertex.position.getX(), cubicVertex.position.getY(), cubicVertex.position.getZ()); + result.position = Vector3DFloat(marchingCubesVertex.position.getX(), marchingCubesVertex.position.getY(), marchingCubesVertex.position.getZ()); result.position *= (1.0 / 256.0); - result.normal = cubicVertex.normal; - result.data = cubicVertex.data; + + uint16_t encodedX = (marchingCubesVertex.normal >> 10) & 0x1F; + uint16_t encodedY = (marchingCubesVertex.normal >> 5) & 0x1F; + uint16_t encodedZ = (marchingCubesVertex.normal) & 0x1F; + result.normal = Vector3DFloat(encodedX, encodedY, encodedZ); + result.normal /= 15.5f; + result.normal -= Vector3DFloat(1.0f, 1.0f, 1.0f); + + result.data = marchingCubesVertex.data; return result; } } From 224c27de5092735a930515939cb9eec6b27b9a06 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 29 May 2014 23:31:36 +0200 Subject: [PATCH 105/259] Got normal decoding working in shader. --- examples/DecodeOnGPU/decode.vert | 10 ++++++++-- examples/DecodeOnGPU/main.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/DecodeOnGPU/decode.vert b/examples/DecodeOnGPU/decode.vert index 00675617..5164468a 100644 --- a/examples/DecodeOnGPU/decode.vert +++ b/examples/DecodeOnGPU/decode.vert @@ -1,7 +1,7 @@ #version 140 in uvec4 position; // This will be the position of the vertex in model-space -in vec4 normal; +in uint normal; // The usual matrices are provided uniform mat4 cameraToClipMatrix; @@ -18,7 +18,13 @@ void main() vec4 decodedPosition = position; decodedPosition.xyz = decodedPosition.xyz * (1.0 / 256.0); - worldNormal = normal; + uint encodedX = (normal >> 10u) & 0x1Fu; + uint encodedY = (normal >> 5u) & 0x1Fu; + uint encodedZ = (normal) & 0x1Fu; + worldNormal.xyz = vec3(encodedX, encodedY, encodedZ); + worldNormal.xyz = worldNormal.xyz / 15.5; + worldNormal.xyz = worldNormal.xyz - vec3(1.0, 1.0, 1.0); + worldNormal.w = 1.0; // Standard sequence of OpenGL transformations. worldPosition = modelToWorldMatrix * decodedPosition; diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index fd1e0b16..f286efc2 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -99,7 +99,7 @@ OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVe // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, normal))); + glVertexAttribIPointer(1, 1, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. From 4f1863eccbe349b304297a65170c744cad847a7d Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 30 May 2014 16:36:24 +0200 Subject: [PATCH 106/259] Removed apparently-incorrect use of logging statements (crashing under Visual Studio). --- examples/DecodeOnGPU/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index f286efc2..3826543d 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -133,16 +133,12 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - std::cout << shader->log().toStdString() << std::endl; - if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/decode.frag")) { std::cerr << shader->log().toStdString() << std::endl; exit(EXIT_FAILURE); } - std::cout << shader->log().toStdString() << std::endl; - openGLWidget.setShader(shader); //Create an empty volume and then place a sphere in it From 78ac1d12b55f589e68996bbc9777350548944d5a Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 1 Jun 2014 17:01:36 +0200 Subject: [PATCH 107/259] The new, more compact vertex types are specific to their respective surface extractors, so they belong in the corresponding source files. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 28 +++++++++ .../MarchingCubesSurfaceExtractor.h | 35 +++++++++++ .../include/PolyVoxCore/VertexTypes.h | 61 ------------------- 3 files changed, 63 insertions(+), 61 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 03e973a3..efd001e4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -32,9 +32,37 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/DefaultIsQuadNeeded.h" #include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/VertexTypes.h" namespace PolyVox { +#ifdef SWIG + struct CubicVertex +#else + template + struct POLYVOX_API CubicVertex +#endif + { + typedef _DataType DataType; + + Vector3DUint8 position; + uint8_t normal; + DataType data; + }; + + // Hopefully the compiler will implement the 'Return value optimization' here, but + // performance critical code will most likely decode the vertices in a shader anyway. + template + Vertex decode(const CubicVertex& cubicVertex) + { + Vertex result; + Vector3DUint8 temp = cubicVertex.position; // For some reason we can't cast Vector3DUint8 to Vector3DFloat - investigate why. + result.position = Vector3DFloat(temp.getX(), temp.getY(), temp.getZ()) - Vector3DFloat(0.5, 0.5, 0.5); + //result.normal = cubicVertex.normal; + result.data = cubicVertex.data; + return result; + } + /// The CubicSurfaceExtractor creates a mesh in which each voxel appears to be rendered as a cube //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Introduction diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 6510ac5c..a609326f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -31,9 +31,44 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/DefaultMarchingCubesController.h" +#include "PolyVoxCore/VertexTypes.h" namespace PolyVox { +#ifdef SWIG + struct MarchingCubesVertex +#else + template + struct POLYVOX_API MarchingCubesVertex +#endif + { + typedef _DataType DataType; + + Vector3DUint16 position; + uint16_t normal; + DataType data; + }; + + // Hopefully the compiler will implement the 'Return value optimization' here, but + // performance critical code will most likely decode the vertices in a shader anyway. + template + Vertex decode(const MarchingCubesVertex& marchingCubesVertex) + { + Vertex result; + result.position = Vector3DFloat(marchingCubesVertex.position.getX(), marchingCubesVertex.position.getY(), marchingCubesVertex.position.getZ()); + result.position *= (1.0 / 256.0); + + uint16_t encodedX = (marchingCubesVertex.normal >> 10) & 0x1F; + uint16_t encodedY = (marchingCubesVertex.normal >> 5) & 0x1F; + uint16_t encodedZ = (marchingCubesVertex.normal) & 0x1F; + result.normal = Vector3DFloat(encodedX, encodedY, encodedZ); + result.normal /= 15.5f; + result.normal -= Vector3DFloat(1.0f, 1.0f, 1.0f); + + result.data = marchingCubesVertex.data; + return result; + } + template< typename VolumeType, typename Controller = DefaultMarchingCubesController > class MarchingCubesSurfaceExtractor { diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h index a4c31b27..964ff88d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h @@ -46,67 +46,6 @@ namespace PolyVox Vector3DFloat normal; DataType data; }; - -#ifdef SWIG - struct CubicVertex -#else - template - struct POLYVOX_API CubicVertex -#endif - { - typedef _DataType DataType; - - Vector3DUint8 position; - uint8_t normal; - DataType data; - }; - -#ifdef SWIG - struct MarchingCubesVertex -#else - template - struct POLYVOX_API MarchingCubesVertex -#endif - { - typedef _DataType DataType; - - Vector3DUint16 position; - uint16_t normal; - DataType data; - }; - - // Hopefully the compiler will implement the 'Return value optimization' here, but - // performance critical code will most likely decode the vertices in a shader anyway. - template - Vertex decode(const CubicVertex& cubicVertex) - { - Vertex result; - Vector3DUint8 temp = cubicVertex.position; // For some reason we can't cast Vector3DUint8 to Vector3DFloat - investigate why. - result.position = Vector3DFloat(temp.getX(), temp.getY(), temp.getZ()) - Vector3DFloat(0.5, 0.5, 0.5); - //result.normal = cubicVertex.normal; - result.data = cubicVertex.data; - return result; - } - - // Hopefully the compiler will implement the 'Return value optimization' here, but - // performance critical code will most likely decode the vertices in a shader anyway. - template - Vertex decode(const MarchingCubesVertex& marchingCubesVertex) - { - Vertex result; - result.position = Vector3DFloat(marchingCubesVertex.position.getX(), marchingCubesVertex.position.getY(), marchingCubesVertex.position.getZ()); - result.position *= (1.0 / 256.0); - - uint16_t encodedX = (marchingCubesVertex.normal >> 10) & 0x1F; - uint16_t encodedY = (marchingCubesVertex.normal >> 5) & 0x1F; - uint16_t encodedZ = (marchingCubesVertex.normal) & 0x1F; - result.normal = Vector3DFloat(encodedX, encodedY, encodedZ); - result.normal /= 15.5f; - result.normal -= Vector3DFloat(1.0f, 1.0f, 1.0f); - - result.data = marchingCubesVertex.data; - return result; - } } #endif From 392ccab7034c9c67437bf552e4ce57e7db2da853 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 1 Jun 2014 17:23:08 +0200 Subject: [PATCH 108/259] Tidying decoding code. --- .../MarchingCubesSurfaceExtractor.h | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index a609326f..78a48aac 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -49,23 +49,33 @@ namespace PolyVox DataType data; }; - // Hopefully the compiler will implement the 'Return value optimization' here, but - // performance critical code will most likely decode the vertices in a shader anyway. + Vector3DFloat decode(const Vector3DUint16& position) + { + Vector3DFloat result(position.getX(), position.getY(), position.getZ()); + result *= (1.0f / 256.0f); // Division is compile-time constant + return result; + } + + Vector3DFloat decode(const uint16_t normal) + { + uint16_t x = (normal >> 10) & 0x1F; + uint16_t y = (normal >> 5) & 0x1F; + uint16_t z = (normal) & 0x1F; + + Vector3DFloat result(x, y, z); + result *= (1.0f / 15.5f); // Division is compile-time constant + result -= Vector3DFloat(1.0f, 1.0f, 1.0f); + + return result; + } + template Vertex decode(const MarchingCubesVertex& marchingCubesVertex) { Vertex result; - result.position = Vector3DFloat(marchingCubesVertex.position.getX(), marchingCubesVertex.position.getY(), marchingCubesVertex.position.getZ()); - result.position *= (1.0 / 256.0); - - uint16_t encodedX = (marchingCubesVertex.normal >> 10) & 0x1F; - uint16_t encodedY = (marchingCubesVertex.normal >> 5) & 0x1F; - uint16_t encodedZ = (marchingCubesVertex.normal) & 0x1F; - result.normal = Vector3DFloat(encodedX, encodedY, encodedZ); - result.normal /= 15.5f; - result.normal -= Vector3DFloat(1.0f, 1.0f, 1.0f); - - result.data = marchingCubesVertex.data; + result.position = decode(marchingCubesVertex.position); + result.normal = decode(marchingCubesVertex.normal); + result.data = marchingCubesVertex.data; // Data is not encoded return result; } From b259b60de29f2f9ba456a10c10fa8bd0ad0636f8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 1 Jun 2014 17:35:00 +0200 Subject: [PATCH 109/259] Tidying/commenting. --- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 2 ++ .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index efd001e4..489942c5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -47,6 +47,8 @@ namespace PolyVox Vector3DUint8 position; uint8_t normal; + + // User data DataType data; }; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 78a48aac..7b39828e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -44,11 +44,19 @@ namespace PolyVox { typedef _DataType DataType; + // Each component of the position is stored using 8.8 fixed-point encoding. Vector3DUint16 position; + + // Each component of the normal is encoded using 5 bits of this variable. + // The 16 bits are -xxxxxyyyyyzzzzz (note the left-most bit is currently + // unused). Some extra shifting and scaling is required to make it signed. uint16_t normal; + + // User data DataType data; }; + /// Decodes a position from a MarchingCubesVertex Vector3DFloat decode(const Vector3DUint16& position) { Vector3DFloat result(position.getX(), position.getY(), position.getZ()); @@ -56,19 +64,27 @@ namespace PolyVox return result; } + /// Decodes a normal from a MarchingCubesVertex Vector3DFloat decode(const uint16_t normal) { + // Get normal components in the range 0 to 31 uint16_t x = (normal >> 10) & 0x1F; uint16_t y = (normal >> 5) & 0x1F; uint16_t z = (normal) & 0x1F; + // Build the resulting vector Vector3DFloat result(x, y, z); + + // Convert to range 0.0 to 2.0 result *= (1.0f / 15.5f); // Division is compile-time constant + + // Convert to range -1.0 to 1.0 result -= Vector3DFloat(1.0f, 1.0f, 1.0f); return result; } + /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. template Vertex decode(const MarchingCubesVertex& marchingCubesVertex) { From 80d9feb5eab692162c7deeae53a044d8a43859aa Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 1 Jun 2014 21:54:31 +0200 Subject: [PATCH 110/259] Made functions inline as they are defined in headers. --- .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 7b39828e..6e115319 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -57,7 +57,7 @@ namespace PolyVox }; /// Decodes a position from a MarchingCubesVertex - Vector3DFloat decode(const Vector3DUint16& position) + inline Vector3DFloat decode(const Vector3DUint16& position) { Vector3DFloat result(position.getX(), position.getY(), position.getZ()); result *= (1.0f / 256.0f); // Division is compile-time constant @@ -65,7 +65,7 @@ namespace PolyVox } /// Decodes a normal from a MarchingCubesVertex - Vector3DFloat decode(const uint16_t normal) + inline Vector3DFloat decode(const uint16_t normal) { // Get normal components in the range 0 to 31 uint16_t x = (normal >> 10) & 0x1F; From 4fa2400ef27d67e62a18623e42e1500c7a27d1df Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 08:25:18 +0200 Subject: [PATCH 111/259] Comments and tidying. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 489942c5..6c3b7898 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -45,23 +45,33 @@ namespace PolyVox { typedef _DataType DataType; + // Each component of the position is stored as a single unsigned byte. + // The true position is found by offseting each component by 0.5f. Vector3DUint8 position; - uint8_t normal; + + // Currently unused and just serves as passing + uint8_t unused; // User data DataType data; }; - // Hopefully the compiler will implement the 'Return value optimization' here, but - // performance critical code will most likely decode the vertices in a shader anyway. + /// Decodes a position from a CubicVertex + inline Vector3DFloat decode(const Vector3DUint8& position) + { + Vector3DFloat result(position.getX(), position.getY(), position.getZ()); + result -= 0.5f; // Apply the required offset + return result; + } + + /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. template Vertex decode(const CubicVertex& cubicVertex) { Vertex result; - Vector3DUint8 temp = cubicVertex.position; // For some reason we can't cast Vector3DUint8 to Vector3DFloat - investigate why. - result.position = Vector3DFloat(temp.getX(), temp.getY(), temp.getZ()) - Vector3DFloat(0.5, 0.5, 0.5); - //result.normal = cubicVertex.normal; - result.data = cubicVertex.data; + result.position = decode(cubicVertex.position); + result.normal.setElements(0.0f, 0.0f, 0.0f); // Currently not calculated + result.data = cubicVertex.data; // Data is not encoded return result; } From d7d1d99ca9c7fe091685aab7031d8cb6c28e1539 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 08:45:25 +0200 Subject: [PATCH 112/259] Renamed members to differentiate between encoded and decoded values. --- examples/DecodeOnGPU/main.cpp | 4 ++-- .../PolyVoxCore/CubicSurfaceExtractor.h | 11 ++++------ .../PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- .../MarchingCubesSurfaceExtractor.h | 20 +++++++++---------- .../MarchingCubesSurfaceExtractor.inl | 12 +++++------ 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index f286efc2..54e83970 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -92,14 +92,14 @@ OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVe // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribIPointer(0, 3, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribIPointer(0, 3, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedPosition))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribIPointer(1, 1, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, normal))); + glVertexAttribIPointer(1, 1, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedNormal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 6c3b7898..3d819a36 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -47,19 +47,16 @@ namespace PolyVox // Each component of the position is stored as a single unsigned byte. // The true position is found by offseting each component by 0.5f. - Vector3DUint8 position; - - // Currently unused and just serves as passing - uint8_t unused; + Vector3DUint8 encodedPosition; // User data DataType data; }; /// Decodes a position from a CubicVertex - inline Vector3DFloat decode(const Vector3DUint8& position) + inline Vector3DFloat decode(const Vector3DUint8& encodedPosition) { - Vector3DFloat result(position.getX(), position.getY(), position.getZ()); + Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); result -= 0.5f; // Apply the required offset return result; } @@ -69,7 +66,7 @@ namespace PolyVox Vertex decode(const CubicVertex& cubicVertex) { Vertex result; - result.position = decode(cubicVertex.position); + result.position = decode(cubicVertex.encodedPosition); result.normal.setElements(0.0f, 0.0f, 0.0f); // Currently not calculated result.data = cubicVertex.data; // Data is not encoded return result; diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 7fe9286b..4c3e47cc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -221,7 +221,7 @@ namespace PolyVox { //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. CubicVertex cubicVertex; - cubicVertex.position.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); + cubicVertex.encodedPosition.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); cubicVertex.data = uMaterialIn; rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); rEntry.uMaterial = uMaterialIn; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 6e115319..1740ea20 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -45,32 +45,32 @@ namespace PolyVox typedef _DataType DataType; // Each component of the position is stored using 8.8 fixed-point encoding. - Vector3DUint16 position; + Vector3DUint16 encodedPosition; // Each component of the normal is encoded using 5 bits of this variable. // The 16 bits are -xxxxxyyyyyzzzzz (note the left-most bit is currently // unused). Some extra shifting and scaling is required to make it signed. - uint16_t normal; + uint16_t encodedNormal; // User data DataType data; }; /// Decodes a position from a MarchingCubesVertex - inline Vector3DFloat decode(const Vector3DUint16& position) + inline Vector3DFloat decode(const Vector3DUint16& encodedPosition) { - Vector3DFloat result(position.getX(), position.getY(), position.getZ()); + Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); result *= (1.0f / 256.0f); // Division is compile-time constant return result; } /// Decodes a normal from a MarchingCubesVertex - inline Vector3DFloat decode(const uint16_t normal) + inline Vector3DFloat decode(const uint16_t encodedNormal) { // Get normal components in the range 0 to 31 - uint16_t x = (normal >> 10) & 0x1F; - uint16_t y = (normal >> 5) & 0x1F; - uint16_t z = (normal) & 0x1F; + uint16_t x = (encodedNormal >> 10) & 0x1F; + uint16_t y = (encodedNormal >> 5) & 0x1F; + uint16_t z = (encodedNormal) & 0x1F; // Build the resulting vector Vector3DFloat result(x, y, z); @@ -89,8 +89,8 @@ namespace PolyVox Vertex decode(const MarchingCubesVertex& marchingCubesVertex) { Vertex result; - result.position = decode(marchingCubesVertex.position); - result.normal = decode(marchingCubesVertex.normal); + result.position = decode(marchingCubesVertex.encodedPosition); + result.normal = decode(marchingCubesVertex.encodedNormal); result.data = marchingCubesVertex.data; // Data is not encoded return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 9514e22e..0f506763 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -470,8 +470,8 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = encodedNormal; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodedNormal; surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -513,8 +513,8 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = encodedNormal; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodedNormal; surfaceVertex.data = uMaterial; uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -555,8 +555,8 @@ namespace PolyVox const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); MarchingCubesVertex surfaceVertex; - surfaceVertex.position = v3dScaledPosition; - surfaceVertex.normal = encodedNormal; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodedNormal; surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); From 82f9d6ad6f1ef701f464be1362f4a140a7574a38 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 08:57:30 +0200 Subject: [PATCH 113/259] Renamed VertexTypes.h to Vertex.h. --- library/PolyVoxCore/CMakeLists.txt | 7 +- .../PolyVoxCore/CubicSurfaceExtractor.h | 2 +- .../MarchingCubesSurfaceExtractor.h | 2 +- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 2 +- .../PolyVoxCore/{VertexTypes.h => Vertex.h} | 102 +++++++++--------- library/PolyVoxCore/source/VertexTypes.cpp | 1 - 6 files changed, 57 insertions(+), 59 deletions(-) rename library/PolyVoxCore/include/PolyVoxCore/{VertexTypes.h => Vertex.h} (91%) delete mode 100644 library/PolyVoxCore/source/VertexTypes.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 3fbb260b..db5caaa8 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -27,7 +27,6 @@ SET(CORE_SRC_FILES source/ArraySizes.cpp source/AStarPathfinder.cpp source/Region.cpp - source/VertexTypes.cpp ) #Projects headers files @@ -66,6 +65,8 @@ SET(CORE_INC_FILES include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl include/PolyVoxCore/Material.h include/PolyVoxCore/MaterialDensityPair.h + include/PolyVoxCore/Mesh.h + include/PolyVoxCore/Mesh.inl include/PolyVoxCore/MinizBlockCompressor.h include/PolyVoxCore/MinizBlockCompressor.inl include/PolyVoxCore/Pager.h @@ -84,13 +85,11 @@ SET(CORE_INC_FILES include/PolyVoxCore/SimpleVolume.inl include/PolyVoxCore/SimpleVolumeBlock.inl include/PolyVoxCore/SimpleVolumeSampler.inl - include/PolyVoxCore/Mesh.h - include/PolyVoxCore/Mesh.inl include/PolyVoxCore/UncompressedBlock.h include/PolyVoxCore/UncompressedBlock.inl include/PolyVoxCore/Vector.h include/PolyVoxCore/Vector.inl - include/PolyVoxCore/VertexTypes.h + include/PolyVoxCore/Vertex.h include/PolyVoxCore/VolumeResampler.h include/PolyVoxCore/VolumeResampler.inl include/PolyVoxCore/VoxelFilters.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 3d819a36..c2ba3481 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -32,7 +32,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/DefaultIsQuadNeeded.h" #include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/VertexTypes.h" +#include "PolyVoxCore/Vertex.h" namespace PolyVox { diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 1740ea20..4b96b432 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -31,7 +31,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/DefaultMarchingCubesController.h" -#include "PolyVoxCore/VertexTypes.h" +#include "PolyVoxCore/Vertex.h" namespace PolyVox { diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index f0ce39ea..0499b9f1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" #include "PolyVoxCore/Region.h" -#include "PolyVoxCore/VertexTypes.h" //Should probably do away with this on in the future... +#include "PolyVoxCore/Vertex.h" //Should probably do away with this on in the future... #include #include diff --git a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h b/library/PolyVoxCore/include/PolyVoxCore/Vertex.h similarity index 91% rename from library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h rename to library/PolyVoxCore/include/PolyVoxCore/Vertex.h index 964ff88d..1eb6f429 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VertexTypes.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Vertex.h @@ -1,51 +1,51 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_SurfaceVertex_H__ -#define __PolyVox_SurfaceVertex_H__ - -#include "Impl/TypeDef.h" - -#include "PolyVoxCore/Vector.h" - -#include -#include - -namespace PolyVox -{ - #ifdef SWIG - struct Vertex -#else - template - struct POLYVOX_API Vertex -#endif - { - typedef _DataType DataType; - - Vector3DFloat position; - Vector3DFloat normal; - DataType data; - }; -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Vertex_H__ +#define __PolyVox_Vertex_H__ + +#include "Impl/TypeDef.h" + +#include "PolyVoxCore/Vector.h" + +#include +#include + +namespace PolyVox +{ + #ifdef SWIG + struct Vertex +#else + template + struct POLYVOX_API Vertex +#endif + { + typedef _DataType DataType; + + Vector3DFloat position; + Vector3DFloat normal; + DataType data; + }; +} + +#endif // __PolyVox_Vertex_H__ diff --git a/library/PolyVoxCore/source/VertexTypes.cpp b/library/PolyVoxCore/source/VertexTypes.cpp deleted file mode 100644 index 8b137891..00000000 --- a/library/PolyVoxCore/source/VertexTypes.cpp +++ /dev/null @@ -1 +0,0 @@ - From 0bff22fbf599556786a021245b5d72c317c08fba Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 09:08:07 +0200 Subject: [PATCH 114/259] Purged old/dead code from Mesh class. --- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 21 +- .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 262 +----------------- 2 files changed, 2 insertions(+), 281 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 0499b9f1..657d7e1a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -69,37 +69,18 @@ namespace PolyVox void clear(void); bool isEmpty(void) const; - void scaleVertices(float amount); - void translateVertices(const Vector3DFloat& amount); - - //THESE FUNCTIONS TO BE REMOVED IN THE FUTURE. OR AT LEAST MOVED OUT OF THIS CLASS INTO FREE FUNCTIONS. - //THEY ARE CAUSING PROBLEMS WITH THE SWIG BINDINGS. THE FUNCTIONS REGARDING NORMALS MAKE NO SENSE WHEN - //A VERTEX MIGHT NOT HAVE NORMALS. THE EXTRACT SUBSET FUNCTION SHOULD MAYBE BE APPLICATION CODE, AT ANY - //RATE THE STD::SET CAUSES PROBLEMS WITH SWIG. IF YOU UNCOMMENT ANY OF THESE FUNCTIONS, PLEASE POST ON - //THE FORUM SO WE CAN KNOW THE FUNCTIONALITY IS STILL NEEDED IN SOME FORM. - //void sumNearbyNormals(bool bNormaliseResult = true); - //std::shared_ptr< Mesh > extractSubset(std::set setMaterials); - //void generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices = false); - int noOfDegenerateTris(void); void removeDegenerateTris(void); void removeUnusedVertices(void); Region m_Region; - - int32_t m_iTimeStamp; - - int32_t m_iNoOfLod0Tris; public: std::vector m_vecTriangleIndices; std::vector m_vecVertices; std::vector m_vecLodRecords; - }; - - template - std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials); + }; template Mesh< Vertex< typename MeshType::VertexType::DataType > > decode(const MeshType& mesh) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index 44fc5320..a886defa 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -26,7 +26,6 @@ namespace PolyVox template Mesh::Mesh() { - m_iTimeStamp = -1; } template @@ -143,173 +142,7 @@ namespace PolyVox { return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); } - - //////////////////////////////////////////////////////////////////////////////// - /// This function can help improve the visual appearance of a surface patch by - /// smoothing normals with other nearby normals. It iterates over each triangle - /// in the surface patch and determines the sum of its corners normals. For any - /// given vertex, these sums are in turn summed for any triangles which use the - /// vertex. Usually, the resulting normals should be renormalised afterwards. - /// Note: This function can cause lighting discontinuities accross region boundaries. - //////////////////////////////////////////////////////////////////////////////// - /*template - void Mesh::sumNearbyNormals(bool bNormaliseResult) - { - if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return; - } - - std::vector summedNormals(m_vecVertices.size()); - - //Initialise all normals to zero. Should be ok as the vector should store all elements contiguously. - memset(&summedNormals[0], 0, summedNormals.size() * sizeof(Vector3DFloat)); - - for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) - { - PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; - Vector3DFloat& v0New = summedNormals[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; - Vector3DFloat& v1New = summedNormals[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; - Vector3DFloat& v2New = summedNormals[*iterIndex]; - iterIndex++; - - Vector3DFloat sumOfNormals = v0.getNormal() + v1.getNormal() + v2.getNormal(); - - v0New += sumOfNormals; - v1New += sumOfNormals; - v2New += sumOfNormals; - } - - for(uint32_t uIndex = 0; uIndex < summedNormals.size(); uIndex++) - { - if(bNormaliseResult) - { - summedNormals[uIndex].normalise(); - } - m_vecVertices[uIndex].setNormal(summedNormals[uIndex]); - } - }*/ - - /*template - void Mesh::generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices) - { - Vector3DFloat offset = static_cast(m_Region.getLowerCorner()); - - //Initially zero the normals - for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) - { - if(m_Region.containsPoint(iterVertex->getPosition() + offset, 0.001)) - { - iterVertex->setNormal(Vector3DFloat(0.0f,0.0f,0.0f)); - } - } - - for(vector::iterator iterIndex = m_vecTriangleIndices.begin(); iterIndex != m_vecTriangleIndices.end();) - { - PositionMaterialNormal& v0 = m_vecVertices[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v1 = m_vecVertices[*iterIndex]; - iterIndex++; - PositionMaterialNormal& v2 = m_vecVertices[*iterIndex]; - iterIndex++; - - Vector3DFloat triangleNormal = (v1.getPosition()-v0.getPosition()).cross(v2.getPosition()-v0.getPosition()); - - if(m_Region.containsPoint(v0.getPosition() + offset, 0.001)) - { - v0.setNormal(v0.getNormal() + triangleNormal); - } - if(m_Region.containsPoint(v1.getPosition() + offset, 0.001)) - { - v1.setNormal(v1.getNormal() + triangleNormal); - } - if(m_Region.containsPoint(v2.getPosition() + offset, 0.001)) - { - v2.setNormal(v2.getNormal() + triangleNormal); - } - } - - if(bNormalise) - { - for(vector::iterator iterVertex = m_vecVertices.begin(); iterVertex != m_vecVertices.end(); iterVertex++) - { - Vector3DFloat normal = iterVertex->getNormal(); - normal.normalise(); - iterVertex->setNormal(normal); - } - } - }*/ - - /*template - std::shared_ptr< Mesh > Mesh::extractSubset(std::set setMaterials) - { - std::shared_ptr< Mesh > result(new Mesh); - - if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return result; - } - - assert(m_vecLodRecords.size() == 1); - if(m_vecLodRecords.size() != 1) - { - //If we have done progressive LOD then it's too late to split into subsets. - return result; - } - - std::vector indexMap(m_vecVertices.size()); - std::fill(indexMap.begin(), indexMap.end(), -1); - - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt += 3) - { - - PositionMaterialNormal& v0 = m_vecVertices[m_vecTriangleIndices[triCt]]; - PositionMaterialNormal& v1 = m_vecVertices[m_vecTriangleIndices[triCt + 1]]; - PositionMaterialNormal& v2 = m_vecVertices[m_vecTriangleIndices[triCt + 2]]; - - if( - (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v2.getMaterial()) != setMaterials.end())) - { - uint32_t i0; - if(indexMap[m_vecTriangleIndices[triCt]] == -1) - { - indexMap[m_vecTriangleIndices[triCt]] = result->addVertex(v0); - } - i0 = indexMap[m_vecTriangleIndices[triCt]]; - - uint32_t i1; - if(indexMap[m_vecTriangleIndices[triCt+1]] == -1) - { - indexMap[m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); - } - i1 = indexMap[m_vecTriangleIndices[triCt+1]]; - - uint32_t i2; - if(indexMap[m_vecTriangleIndices[triCt+2]] == -1) - { - indexMap[m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); - } - i2 = indexMap[m_vecTriangleIndices[triCt+2]]; - - result->addTriangle(i0,i1,i2); - } - } - - result->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = result->getNoOfIndices(); - result->m_vecLodRecords.push_back(lodRecord); - - return result; - }*/ - + template int Mesh::noOfDegenerateTris(void) { @@ -392,97 +225,4 @@ namespace PolyVox m_vecTriangleIndices[triCt] = newPos[m_vecTriangleIndices[triCt]]; } } - - //Currently a free function - think where this needs to go. - template - std::shared_ptr< Mesh > extractSubset(Mesh& inputMesh, std::set setMaterials) - { - std::shared_ptr< Mesh > result(new Mesh); - - result->m_Region = inputMesh.m_Region; - - if(inputMesh.m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... - { - return result; - } - - POLYVOX_ASSERT(inputMesh.m_vecLodRecords.size() == 1, "Number of LOD records must equal one."); - if(inputMesh.m_vecLodRecords.size() != 1) - { - //If we have done progressive LOD then it's too late to split into subsets. - return result; - } - - std::vector indexMap(inputMesh.m_vecVertices.size()); - std::fill(indexMap.begin(), indexMap.end(), -1); - - for(uint32_t triCt = 0; triCt < inputMesh.m_vecTriangleIndices.size(); triCt += 3) - { - - VertexType& v0 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt]]; - VertexType& v1 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 1]]; - VertexType& v2 = inputMesh.m_vecVertices[inputMesh.m_vecTriangleIndices[triCt + 2]]; - - if( - (setMaterials.find(v0.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v1.getMaterial()) != setMaterials.end()) || - (setMaterials.find(v2.getMaterial()) != setMaterials.end())) - { - uint32_t i0; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt]] = result->addVertex(v0); - } - i0 = indexMap[inputMesh.m_vecTriangleIndices[triCt]]; - - uint32_t i1; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt+1]] = result->addVertex(v1); - } - i1 = indexMap[inputMesh.m_vecTriangleIndices[triCt+1]]; - - uint32_t i2; - if(indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] == -1) - { - indexMap[inputMesh.m_vecTriangleIndices[triCt+2]] = result->addVertex(v2); - } - i2 = indexMap[inputMesh.m_vecTriangleIndices[triCt+2]]; - - result->addTriangle(i0,i1,i2); - } - } - - result->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = result->getNoOfIndices(); - result->m_vecLodRecords.push_back(lodRecord); - - return result; - } - - template - void Mesh::scaleVertices(float amount) - { - for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) - { - //TODO: Should rethink accessors here to provide faster access - Vector3DFloat position = m_vecVertices[ct].getPosition(); - position *= amount; - m_vecVertices[ct].setPosition(position); - } - } - - template - void Mesh::translateVertices(const Vector3DFloat& amount) - { - for(uint32_t ct = 0; ct < m_vecVertices.size(); ct++) - { - //TODO: Should rethink accessors here to provide faster access - Vector3DFloat position = m_vecVertices[ct].getPosition(); - position += amount; - m_vecVertices[ct].setPosition(position); - } - } } From 9fd52e34946a360822f092b3ac05f80e528b280d Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 09:40:28 +0200 Subject: [PATCH 115/259] Removing more old stuff from the Mesh class. --- .../PolyVoxCore/CubicSurfaceExtractor.inl | 4 +- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 31 ++---- .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 104 ------------------ 3 files changed, 14 insertions(+), 125 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 4c3e47cc..63d021e2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -190,8 +190,8 @@ namespace PolyVox for(typename std::list::iterator quadIter = listQuads.begin(); quadIter != iterEnd; quadIter++) { Quad& quad = *quadIter; - m_meshCurrent->addTriangleCubic(quad.vertices[0], quad.vertices[1],quad.vertices[2]); - m_meshCurrent->addTriangleCubic(quad.vertices[0], quad.vertices[2],quad.vertices[3]); + m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[1],quad.vertices[2]); + m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[2],quad.vertices[3]); } } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 657d7e1a..408c1ddc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -52,28 +52,21 @@ namespace PolyVox typedef _VertexType VertexType; - Mesh(); - ~Mesh(); + Mesh(); + ~Mesh(); - const std::vector& getIndices(void) const; - uint32_t getNoOfIndices(void) const; - uint32_t getNoOfNonUniformTrianges(void) const; - uint32_t getNoOfUniformTrianges(void) const; - uint32_t getNoOfVertices(void) const; - std::vector& getRawVertexData(void); //FIXME - this should be removed - const std::vector& getVertices(void) const; + const std::vector& getIndices(void) const; + uint32_t getNoOfIndices(void) const; + uint32_t getNoOfVertices(void) const; + const std::vector& getVertices(void) const; - void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); - void addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2); - uint32_t addVertex(const VertexType& vertex); - void clear(void); - bool isEmpty(void) const; + void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); + uint32_t addVertex(const VertexType& vertex); + void clear(void); + bool isEmpty(void) const; + void removeUnusedVertices(void); - int noOfDegenerateTris(void); - void removeDegenerateTris(void); - void removeUnusedVertices(void); - - Region m_Region; + Region m_Region; public: std::vector m_vecTriangleIndices; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index a886defa..2f62c051 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -43,39 +43,6 @@ namespace PolyVox uint32_t Mesh::getNoOfIndices(void) const { return m_vecTriangleIndices.size(); - } - - template - uint32_t Mesh::getNoOfNonUniformTrianges(void) const - { - uint32_t result = 0; - for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) - { - if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) - && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) - { - } - else - { - result++; - } - } - return result; - } - - template - uint32_t Mesh::getNoOfUniformTrianges(void) const - { - uint32_t result = 0; - for(uint32_t i = 0; i < m_vecTriangleIndices.size() - 2; i += 3) - { - if((m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+1]].getMaterial()) - && (m_vecVertices[m_vecTriangleIndices[i]].getMaterial() == m_vecVertices[m_vecTriangleIndices[i+2]].getMaterial())) - { - result++; - } - } - return result; } template @@ -84,12 +51,6 @@ namespace PolyVox return m_vecVertices.size(); } - template - std::vector& Mesh::getRawVertexData(void) - { - return m_vecVertices; - } - template const std::vector& Mesh::getVertices(void) const { @@ -109,19 +70,6 @@ namespace PolyVox m_vecTriangleIndices.push_back(index2); } - template - void Mesh::addTriangleCubic(uint32_t index0, uint32_t index1, uint32_t index2) - { - //Make sure the specified indices correspond to valid vertices. - POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); - POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); - - m_vecTriangleIndices.push_back(index0); - m_vecTriangleIndices.push_back(index1); - m_vecTriangleIndices.push_back(index2); - } - template uint32_t Mesh::addVertex(const VertexType& vertex) { @@ -134,7 +82,6 @@ namespace PolyVox { m_vecVertices.clear(); m_vecTriangleIndices.clear(); - m_vecLodRecords.clear(); } template @@ -142,57 +89,6 @@ namespace PolyVox { return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); } - - template - int Mesh::noOfDegenerateTris(void) - { - int count = 0; - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) - { - int v0 = m_vecTriangleIndices[triCt]; - triCt++; - int v1 = m_vecTriangleIndices[triCt]; - triCt++; - int v2 = m_vecTriangleIndices[triCt]; - triCt++; - - if((v0 == v1) || (v1 == v2) || (v2 == v0)) - { - count++; - } - } - return count; - } - - template - void Mesh::removeDegenerateTris(void) - { - int noOfNonDegenerate = 0; - int targetCt = 0; - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size();) - { - int v0 = m_vecTriangleIndices[triCt]; - triCt++; - int v1 = m_vecTriangleIndices[triCt]; - triCt++; - int v2 = m_vecTriangleIndices[triCt]; - triCt++; - - if((v0 != v1) && (v1 != v2) & (v2 != v0)) - { - m_vecTriangleIndices[targetCt] = v0; - targetCt++; - m_vecTriangleIndices[targetCt] = v1; - targetCt++; - m_vecTriangleIndices[targetCt] = v2; - targetCt++; - - noOfNonDegenerate++; - } - } - - m_vecTriangleIndices.resize(noOfNonDegenerate * 3); - } template void Mesh::removeUnusedVertices(void) From 31e5a6e34693b72342754ed364e0077761e12abe Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 2 Jun 2014 17:30:41 +0200 Subject: [PATCH 116/259] Replaced 'm_region' with 'm_offset' and demonstrated its use. --- examples/OpenGL/main.cpp | 5 +++-- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- .../PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 2 +- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 7 +++++-- library/PolyVoxCore/include/PolyVoxCore/Mesh.inl | 14 +++++++++++++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index a95d66e5..12d1068f 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -130,8 +130,9 @@ int main(int argc, char *argv[]) // The returned mesh needs to be decoded to be appropriate for GPU rendering. auto decodedMesh = decode(mesh); - //Pass the surface to the OpenGL window - openGLWidget.addMesh(decodedMesh, Vector3DInt32(x, y, z)); + // Pass the surface to the OpenGL window. Note that we are also passing an offset in this multi-mesh example. This is because + // the surface extractors return a mesh with 'local space' positions to reduce storage requirements and precision problems. + openGLWidget.addMesh(decodedMesh, decodedMesh.getOffset()); meshCounter++; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 63d021e2..d05a7c57 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -196,7 +196,7 @@ namespace PolyVox } } - m_meshCurrent->m_Region = m_regSizeInVoxels; + m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); m_meshCurrent->removeUnusedVertices(); m_meshCurrent->m_vecLodRecords.clear(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 0f506763..382dc85a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -122,7 +122,7 @@ namespace PolyVox m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); } - m_meshCurrent->m_Region = m_regSizeInVoxels; + m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); m_meshCurrent->m_vecLodRecords.clear(); LodRecord lodRecord; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 408c1ddc..18537e9e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -59,6 +59,9 @@ namespace PolyVox uint32_t getNoOfIndices(void) const; uint32_t getNoOfVertices(void) const; const std::vector& getVertices(void) const; + const Vector3DInt32& getOffset(void) const; + + void setOffset(const Vector3DInt32& offset); void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); uint32_t addVertex(const VertexType& vertex); @@ -66,7 +69,7 @@ namespace PolyVox bool isEmpty(void) const; void removeUnusedVertices(void); - Region m_Region; + Vector3DInt32 m_offset; public: std::vector m_vecTriangleIndices; @@ -88,7 +91,7 @@ namespace PolyVox result.m_vecTriangleIndices = mesh.m_vecTriangleIndices; - result.m_Region = mesh.m_Region; + result.m_offset = mesh.m_offset; return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index 2f62c051..d2363046 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -55,7 +55,19 @@ namespace PolyVox const std::vector& Mesh::getVertices(void) const { return m_vecVertices; - } + } + + template + const Vector3DInt32& Mesh::getOffset(void) const + { + return m_offset; + } + + template + void Mesh::setOffset(const Vector3DInt32& offset) + { + m_offset = offset; + } template void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) From 9b19ea656bd22f00c5fc7af038ca3380dd795a28 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Tue, 3 Jun 2014 10:37:11 +0100 Subject: [PATCH 117/259] Fix commit on Linux --- examples/common/OpenGLWidget.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index a0150556..1bbbc1e4 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -71,7 +71,7 @@ public: // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(Vertex< DataType >), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PolyVox::Vertex< DataType >), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); @@ -80,20 +80,20 @@ public: // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' GLint size = (std::min)(sizeof(DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(Vertex< DataType >), (GLvoid*)(offsetof(Vertex< DataType >, data))); + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, data))); // We're done uploading and can now unbind. glBindVertexArray(0); From 78d750a0f27730fc1163f6dda1429e6f648b7a03 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 15:50:30 +0200 Subject: [PATCH 118/259] Removed unused 'LodRecord'. --- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 6 ------ .../PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 6 ------ library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 9 --------- 3 files changed, 21 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index d05a7c57..5e00a572 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -199,12 +199,6 @@ namespace PolyVox m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); m_meshCurrent->removeUnusedVertices(); - m_meshCurrent->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); - m_meshCurrent->m_vecLodRecords.push_back(lodRecord); - POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds() << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 382dc85a..19968cd6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -124,12 +124,6 @@ namespace PolyVox m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); - m_meshCurrent->m_vecLodRecords.clear(); - LodRecord lodRecord; - lodRecord.beginIndex = 0; - lodRecord.endIndex = m_meshCurrent->getNoOfIndices(); - m_meshCurrent->m_vecLodRecords.push_back(lodRecord); - POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds() << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 18537e9e..9403c5d8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -38,13 +38,6 @@ freely, subject to the following restrictions: namespace PolyVox { - class LodRecord - { - public: - int beginIndex; - int endIndex; //Let's put it just past the end STL style - }; - template class Mesh { @@ -74,8 +67,6 @@ namespace PolyVox public: std::vector m_vecTriangleIndices; std::vector m_vecVertices; - - std::vector m_vecLodRecords; }; template From 5701e7a6ccf45da262ad11c6723a5b16008111a7 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 15:51:42 +0200 Subject: [PATCH 119/259] It seems we don't need these leading underscores? Perhaps they were required in older versions of Visual Studio? Let's see what GCC/Clang says. --- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 9403c5d8..6b122323 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -38,12 +38,12 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template class Mesh { public: - typedef _VertexType VertexType; + typedef VertexType VertexType; Mesh(); ~Mesh(); From ffdf606ad6e7aa0f3f69235e44104acacb0703ad Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 15:58:07 +0200 Subject: [PATCH 120/259] Added IndexType template parameter to Mesh class. --- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 3 +- .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 52 +++++++++---------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 20 +++---- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 6b122323..45f78930 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -38,12 +38,13 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template class Mesh { public: typedef VertexType VertexType; + typedef IndexType IndexType; Mesh(); ~Mesh(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index d2363046..7a57c748 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -23,54 +23,54 @@ freely, subject to the following restrictions: namespace PolyVox { - template - Mesh::Mesh() + template + Mesh::Mesh() { } - template - Mesh::~Mesh() + template + Mesh::~Mesh() { } - template - const std::vector& Mesh::getIndices(void) const + template + const std::vector& Mesh::getIndices(void) const { return m_vecTriangleIndices; } - template - uint32_t Mesh::getNoOfIndices(void) const + template + uint32_t Mesh::getNoOfIndices(void) const { return m_vecTriangleIndices.size(); } - template - uint32_t Mesh::getNoOfVertices(void) const + template + uint32_t Mesh::getNoOfVertices(void) const { return m_vecVertices.size(); } - template - const std::vector& Mesh::getVertices(void) const + template + const std::vector& Mesh::getVertices(void) const { return m_vecVertices; } - template - const Vector3DInt32& Mesh::getOffset(void) const + template + const Vector3DInt32& Mesh::getOffset(void) const { return m_offset; } - template - void Mesh::setOffset(const Vector3DInt32& offset) + template + void Mesh::setOffset(const Vector3DInt32& offset) { m_offset = offset; } - template - void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) + template + void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) { //Make sure the specified indices correspond to valid vertices. POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); @@ -82,28 +82,28 @@ namespace PolyVox m_vecTriangleIndices.push_back(index2); } - template - uint32_t Mesh::addVertex(const VertexType& vertex) + template + uint32_t Mesh::addVertex(const VertexType& vertex) { m_vecVertices.push_back(vertex); return m_vecVertices.size() - 1; } - template - void Mesh::clear(void) + template + void Mesh::clear(void) { m_vecVertices.clear(); m_vecTriangleIndices.clear(); } - template - bool Mesh::isEmpty(void) const + template + bool Mesh::isEmpty(void) const { return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); } - template - void Mesh::removeUnusedVertices(void) + template + void Mesh::removeUnusedVertices(void) { std::vector isVertexUsed(m_vecVertices.size()); std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 49bd882c..e4555893 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -108,6 +108,11 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class LargeVolume; + //////////////////////////////////////////////////////////////////////////////// + // MarchingCubesSurfaceExtractor + //////////////////////////////////////////////////////////////////////////////// + template class MarchingCubesSurfaceExtractor; + //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex //////////////////////////////////////////////////////////////////////////////// @@ -134,6 +139,11 @@ namespace PolyVox typedef MaterialDensityPair MaterialDensityPair44; typedef MaterialDensityPair MaterialDensityPair88; + //////////////////////////////////////////////////////////////////////////////// + // Mesh + //////////////////////////////////////////////////////////////////////////////// + template class Mesh; + //////////////////////////////////////////////////////////////////////////////// // Pager //////////////////////////////////////////////////////////////////////////////// @@ -154,16 +164,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class SimpleVolume; - //////////////////////////////////////////////////////////////////////////////// - // MarchingCubesSurfaceExtractor - //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; - - //////////////////////////////////////////////////////////////////////////////// - // Mesh - //////////////////////////////////////////////////////////////////////////////// - template class Mesh; - //////////////////////////////////////////////////////////////////////////////// // Vector //////////////////////////////////////////////////////////////////////////////// From 06540d6c970680b327db73b8013fb897a4bd1b09 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 16:52:09 +0200 Subject: [PATCH 121/259] More work to make Mesh be templatized on IndexType. This requires making the SurfaceExtractor classes be templatised on MeshType (at least for now - maybe there is a better approach when working with free functions). This has been partially done for CubicSurfaceExtractor. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 13 +++++----- .../PolyVoxCore/CubicSurfaceExtractor.inl | 24 +++++++++---------- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 16 ++++++------- .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 10 ++++---- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index c2ba3481..71571038 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -113,7 +113,7 @@ namespace PolyVox /// /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - template + template class CubicSurfaceExtractor { struct IndexAndMaterial @@ -150,9 +150,9 @@ namespace PolyVox // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? #if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #else - CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); #endif @@ -172,7 +172,7 @@ namespace PolyVox Region m_regSizeInVoxels; //The surface patch we are currently filling. - Mesh >* m_meshCurrent; + MeshType* m_meshCurrent; //Used to avoid creating duplicate vertices. Array<3, IndexAndMaterial> m_previousSliceVertices; @@ -198,8 +198,9 @@ namespace PolyVox template Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) { - Mesh > result; - CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + typedef Mesh > MeshType; + MeshType result; + CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); extractor.execute(); return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 5e00a572..6ebec5ef 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -32,11 +32,11 @@ namespace PolyVox // happens when we have a 2x2x2 group of voxels, all with different materials and some/all partially transparent. // The vertex position at the center of this group is then going to be used by all eight voxels all with different // materials. - template - const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; + template + const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; - template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + template + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) @@ -53,8 +53,8 @@ namespace PolyVox POLYVOX_THROW_IF(region.getDepthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); } - template - void CubicSurfaceExtractor::execute() + template + void CubicSurfaceExtractor::execute() { Timer timer; m_meshCurrent->clear(); @@ -204,8 +204,8 @@ namespace PolyVox << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); } - template - int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) + template + int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) { for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) { @@ -236,8 +236,8 @@ namespace PolyVox return -1; //Should never happen. } - template - bool CubicSurfaceExtractor::performQuadMerging(std::list& quads) + template + bool CubicSurfaceExtractor::performQuadMerging(std::list& quads) { bool bDidMerge = false; for(typename std::list::iterator outerIter = quads.begin(); outerIter != quads.end(); outerIter++) @@ -266,8 +266,8 @@ namespace PolyVox return bDidMerge; } - template - bool CubicSurfaceExtractor::mergeQuads(Quad& q1, Quad& q2) + template + bool CubicSurfaceExtractor::mergeQuads(Quad& q1, Quad& q2) { //All four vertices of a given quad have the same data, //so just check that the first pair of vertices match. diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 45f78930..34dc50b4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -49,16 +49,16 @@ namespace PolyVox Mesh(); ~Mesh(); - const std::vector& getIndices(void) const; + const std::vector& getIndices(void) const; uint32_t getNoOfIndices(void) const; - uint32_t getNoOfVertices(void) const; + IndexType getNoOfVertices(void) const; const std::vector& getVertices(void) const; const Vector3DInt32& getOffset(void) const; void setOffset(const Vector3DInt32& offset); - void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2); - uint32_t addVertex(const VertexType& vertex); + void addTriangle(IndexType index0, IndexType index1, IndexType index2); + IndexType addVertex(const VertexType& vertex); void clear(void); bool isEmpty(void) const; void removeUnusedVertices(void); @@ -66,17 +66,17 @@ namespace PolyVox Vector3DInt32 m_offset; public: - std::vector m_vecTriangleIndices; + std::vector m_vecTriangleIndices; std::vector m_vecVertices; }; template - Mesh< Vertex< typename MeshType::VertexType::DataType > > decode(const MeshType& mesh) + Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decode(const MeshType& mesh) { - Mesh< Vertex< typename MeshType::VertexType::DataType > > result; + Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > result; result.m_vecVertices.resize(mesh.m_vecVertices.size()); - for(uint32_t ct = 0; ct < mesh.m_vecVertices.size(); ct++) + for(MeshType::IndexType ct = 0; ct < mesh.m_vecVertices.size(); ct++) { result.m_vecVertices[ct] = decode(mesh.m_vecVertices[ct]); } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index 7a57c748..cd93f878 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -34,7 +34,7 @@ namespace PolyVox } template - const std::vector& Mesh::getIndices(void) const + const std::vector& Mesh::getIndices(void) const { return m_vecTriangleIndices; } @@ -46,7 +46,7 @@ namespace PolyVox } template - uint32_t Mesh::getNoOfVertices(void) const + IndexType Mesh::getNoOfVertices(void) const { return m_vecVertices.size(); } @@ -70,7 +70,7 @@ namespace PolyVox } template - void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) + void Mesh::addTriangle(IndexType index0, IndexType index1, IndexType index2) { //Make sure the specified indices correspond to valid vertices. POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); @@ -83,7 +83,7 @@ namespace PolyVox } template - uint32_t Mesh::addVertex(const VertexType& vertex) + IndexType Mesh::addVertex(const VertexType& vertex) { m_vecVertices.push_back(vertex); return m_vecVertices.size() - 1; @@ -116,7 +116,7 @@ namespace PolyVox int noOfUsedVertices = 0; std::vector newPos(m_vecVertices.size()); - for(uint32_t vertCt = 0; vertCt < m_vecVertices.size(); vertCt++) + for(IndexType vertCt = 0; vertCt < m_vecVertices.size(); vertCt++) { if(isVertexUsed[vertCt]) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index e4555893..16151e4c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -76,7 +76,7 @@ namespace PolyVox // CubicSurfaceExtractor //////////////////////////////////////////////////////////////////////////////// template class DefaultIsQuadNeeded; - template > class CubicSurfaceExtractor; + template > class CubicSurfaceExtractor; //////////////////////////////////////////////////////////////////////////////// // CubicVertex From b7be2ff7ab25c5b3ef80ec7e738035b1b27d51c4 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 16:59:09 +0200 Subject: [PATCH 122/259] Added some error handling. --- library/PolyVoxCore/include/PolyVoxCore/Mesh.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index cd93f878..e34f51ff 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -85,6 +85,9 @@ namespace PolyVox template IndexType Mesh::addVertex(const VertexType& vertex) { + // We should not add more vertices than our chosen index type will let us index. + POLYVOX_THROW_IF(m_vecVertices.size() >= std::numeric_limits::max(), std::out_of_range, "Mesh has more vertices that the chosen index type allows."); + m_vecVertices.push_back(vertex); return m_vecVertices.size() - 1; } From 70b04a055ecd7f977b28f3450b4ea46730ed6be1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 21:21:04 +0200 Subject: [PATCH 123/259] Compile fioxes for GCC. Turns out the leading underscore was required, as otherwise GCC complains the typedef is hiding the original. --- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 34dc50b4..e2329dbf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -38,13 +38,13 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template class Mesh { public: - typedef VertexType VertexType; - typedef IndexType IndexType; + typedef _VertexType VertexType; + typedef _IndexType IndexType; Mesh(); ~Mesh(); @@ -76,7 +76,7 @@ namespace PolyVox Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > result; result.m_vecVertices.resize(mesh.m_vecVertices.size()); - for(MeshType::IndexType ct = 0; ct < mesh.m_vecVertices.size(); ct++) + for(typename MeshType::IndexType ct = 0; ct < mesh.m_vecVertices.size(); ct++) { result.m_vecVertices[ct] = decode(mesh.m_vecVertices[ct]); } From b1c03c9f9cb197050321a982f5d691ddad8c65a0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 3 Jun 2014 21:37:22 +0200 Subject: [PATCH 124/259] Fix to mesh declaration. --- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 3 ++- .../include/PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 34dc50b4..ee79ecca 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -26,6 +26,7 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" +#include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxCore/Region.h" #include "PolyVoxCore/Vertex.h" //Should probably do away with this on in the future... @@ -38,7 +39,7 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template class Mesh { public: diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 16151e4c..f72d5d37 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -142,7 +142,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // Mesh //////////////////////////////////////////////////////////////////////////////// - template class Mesh; + template class Mesh; //////////////////////////////////////////////////////////////////////////////// // Pager From 9b84c9d07da2ecf280f5dcb4ffc43e208774e905 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 14 Jun 2014 09:59:01 +0200 Subject: [PATCH 125/259] Fixed compile error --- library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 4d506d74..2239b267 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -21,6 +21,8 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ +#include "PolyVoxCore/Impl/Utility.h" + namespace PolyVox { template From dd5e34bc92411472d639130f7d5d65a8691d1ed4 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 22 Jul 2014 23:48:18 +0200 Subject: [PATCH 126/259] Moved normal encoding logic. --- .../MarchingCubesSurfaceExtractor.h | 14 ++++++++ .../MarchingCubesSurfaceExtractor.inl | 33 ++----------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 4b96b432..e927af7a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -64,6 +64,20 @@ namespace PolyVox return result; } + inline uint16_t encodeNormal(const Vector3DFloat& normal) + { + Vector3DFloat v3dNormal = normal; + v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); + uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); + uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); + uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); + POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); + POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); + uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; + return encodedNormal; + } + /// Decodes a normal from a MarchingCubesVertex inline Vector3DFloat decode(const uint16_t encodedNormal) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 19968cd6..cbbcd9e8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -451,21 +451,12 @@ namespace PolyVox v3dNormal.normalise(); } - v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); - uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); - uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); - uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); - POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); - uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; - // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodedNormal; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -494,21 +485,12 @@ namespace PolyVox v3dNormal.normalise(); } - v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); - uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); - uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); - uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); - POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); - uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; - // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodedNormal; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); surfaceVertex.data = uMaterial; uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); @@ -536,21 +518,12 @@ namespace PolyVox v3dNormal.normalise(); } - v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); - uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); - uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); - uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); - POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); - uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; - // Allow the controller to decide how the material should be derived from the voxels. const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); MarchingCubesVertex surfaceVertex; surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodedNormal; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); From 4a42535f13fda057a77fdc0766b90e9de00b942f Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 23 Jul 2014 23:35:46 +0200 Subject: [PATCH 127/259] Added functions to perform 'octahedral' encoding and decoding of normals. See http://jcgt.org/published/0003/02/01/paper-lowres.pdf --- examples/Basic/main.cpp | 42 +++++++++---- examples/common/example.frag | 38 ++++++------ examples/common/example.vert | 45 ++++++++------ .../MarchingCubesSurfaceExtractor.h | 62 ++++++++++++++++++- 4 files changed, 135 insertions(+), 52 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index a13da717..1f4b210e 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -50,14 +50,34 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) //And compute how far the current position is from the center of the volume float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - uint8_t uVoxelValue = 0; + // We actually want our volume to have high values in the center and low values as we move out, because our + // eath should be a solid sphere surrounded by empty space. If we invert the distance then this is a step in + // the right direction. We still have zero in the center, but lower (negative) values as we move out. + float density = -fDistToCenter; - //If the current voxel is less than 'radius' units from the center then we make it solid. - if(fDistToCenter <= fRadius) - { - //Our new voxel value - uVoxelValue = 255; - } + // By adding the 'planetRadius' we now have a function which starts at 'planetRadius' and still decreases as it + // moves out. The function passes through zero at a distance of 'planetRadius' and then continues do decrease + // as it gets even further out. + density += fRadius; + + // Ideally we would like our final density value to be '255' for voxels inside the planet and '0' for voxels + // outside the planet. At the surface there should be a transition but this should occur not too quickly and + // not too slowly, as both of these will result in a jagged appearance to the mesh. + // + // We probably want the transition to occur over a few voxels, whereas it currently occurs over 255 voxels + // because it was derived from the distance. By scaling the density field we effectivly compress the rate + // at which it changes at the surface. We also make the center much too high and the outside very low, but + // we will clamp these to the corect range later. + // + // Note: You can try commenting out or changing the value on this line to see the effect it has. + density *= 50; + + // Until now we've been defining our density field as if the threshold was at zero, with positive densities + // being solid and negative densities being empty. But actually Cubiquity operates on the range 0 to 255, and + // uses a threashold of 127 to decide where to place the generated surface. Therefore we shift and clamp our + // density value and store it in a byte. + density += 127; + uint8_t uVoxelValue = (uint8_t)(clamp(density, 0.0f, 255.0f)); //Wrte the voxel value into the volume volData.setVoxelAt(x, y, z, uVoxelValue); @@ -74,12 +94,12 @@ int main(int argc, char *argv[]) openGLWidget.show(); //Create an empty volume and then place a sphere in it - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); - createSphereInVolume(volData, 30); + SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(31, 31, 31))); + createSphereInVolume(volData, 15); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); - //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. diff --git a/examples/common/example.frag b/examples/common/example.frag index c9cbf215..56e7d9d6 100644 --- a/examples/common/example.frag +++ b/examples/common/example.frag @@ -1,19 +1,19 @@ -#version 130 - -// Passed in from the vertex shader -in vec4 worldPosition; -in vec4 worldNormal; - -// the color that gets written to the display -out vec4 outputColor; - -void main() -{ - // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback - // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); - - // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. - // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. - outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); -} +#version 130 + +// Passed in from the vertex shader +in vec4 worldPosition; +in vec3 worldNormal; + +// the color that gets written to the display +out vec4 outputColor; + +void main() +{ + // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback + // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. + // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. + outputColor = vec4(abs(worldNormal.xyz), 1.0); +} diff --git a/examples/common/example.vert b/examples/common/example.vert index 94d35f44..86f60296 100644 --- a/examples/common/example.vert +++ b/examples/common/example.vert @@ -1,20 +1,25 @@ -#version 140 - -in vec4 position; // This will be the position of the vertex in model-space - -// The usual matrices are provided -uniform mat4 cameraToClipMatrix; -uniform mat4 worldToCameraMatrix; -uniform mat4 modelToWorldMatrix; - -// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach -// but we use it in this example framework because not all surface extractor generate surface normals. -out vec4 worldPosition; - -void main() -{ - // Standard sequence of OpenGL transformations. - worldPosition = modelToWorldMatrix * position; - vec4 cameraPosition = worldToCameraMatrix * worldPosition; - gl_Position = cameraToClipMatrix * cameraPosition; -} +#version 140 + +in vec4 position; // This will be the position of the vertex in model-space +in vec3 normal; + +// The usual matrices are provided +uniform mat4 cameraToClipMatrix; +uniform mat4 worldToCameraMatrix; +uniform mat4 modelToWorldMatrix; + +// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach +// but we use it in this example framework because not all surface extractor generate surface normals. +out vec4 worldPosition; +out vec3 worldNormal; + +void main() +{ + // Standard sequence of OpenGL transformations. + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + + worldNormal = normal; + + gl_Position = cameraToClipMatrix * cameraPosition; +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index e927af7a..8317b4b4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -50,7 +50,7 @@ namespace PolyVox // Each component of the normal is encoded using 5 bits of this variable. // The 16 bits are -xxxxxyyyyyzzzzz (note the left-most bit is currently // unused). Some extra shifting and scaling is required to make it signed. - uint16_t encodedNormal; + Vector2DFloat encodedNormal; // User data DataType data; @@ -64,7 +64,7 @@ namespace PolyVox return result; } - inline uint16_t encodeNormal(const Vector3DFloat& normal) + /*inline uint16_t encodeNormal(const Vector3DFloat& normal) { Vector3DFloat v3dNormal = normal; v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); @@ -96,6 +96,64 @@ namespace PolyVox result -= Vector3DFloat(1.0f, 1.0f, 1.0f); return result; + }*/ + + // Returns ±1 + float signNotZero(float v) + { + return v >= 0.0 ? +1.0 : -1.0; + } + + Vector2DFloat signNotZero(Vector2DFloat v) + { + return Vector2DFloat((v.getX() >= 0.0) ? +1.0 : -1.0, (v.getY() >= 0.0) ? +1.0 : -1.0); + } + + // Assume normalized input. Output is on [-1, 1] for each component. + Vector2DFloat float32x3_to_oct(Vector3DFloat v) + { + // Project the sphere onto the octahedron, and then onto the xy plane + Vector2DFloat p(v.getX(), v.getY()); + p = p * (1.0f / (abs(v.getX()) + abs(v.getY()) + abs(v.getZ()))); + + float refX = ((1.0f - abs(p.getY())) * signNotZero(p.getX())); + float refY = ((1.0f - abs(p.getX())) * signNotZero(p.getY())); + + Vector2DFloat ref(refX, refY); + + // Reflect the folds of the lower hemisphere over the diagonals + return (v.getZ() <= 0.0) ? ref : p; + } + + Vector3DFloat oct_to_float32x3(Vector2DFloat e) + { + Vector3DFloat v = Vector3DFloat(e.getX(), e.getY(), 1.0 - abs(e.getX()) - abs(e.getY())); + + float refX = ((1.0f - abs(v.getY())) * signNotZero(v.getX())); + float refY = ((1.0f - abs(v.getX())) * signNotZero(v.getY())); + + Vector2DFloat ref(refX, refY); + + if (v.getZ() < 0.0f) + { + //v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy); + v.setX(refX); + v.setY(refY); + } + + v.normalise(); + + return v; + } + + inline Vector2DFloat encodeNormal(const Vector3DFloat& normal) + { + return float32x3_to_oct(normal); + } + + inline Vector3DFloat decode(const Vector2DFloat& encodedNormal) + { + return oct_to_float32x3(encodedNormal); } /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. From 79c62be039d472a254683c70b1c110c53249925b Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 23 Jul 2014 23:50:04 +0200 Subject: [PATCH 128/259] Oct-encoded normal now stored as uint again. --- .../MarchingCubesSurfaceExtractor.h | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 8317b4b4..39ea68c2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -50,7 +50,7 @@ namespace PolyVox // Each component of the normal is encoded using 5 bits of this variable. // The 16 bits are -xxxxxyyyyyzzzzz (note the left-most bit is currently // unused). Some extra shifting and scaling is required to make it signed. - Vector2DFloat encodedNormal; + uint16_t encodedNormal; // User data DataType data; @@ -146,14 +146,32 @@ namespace PolyVox return v; } - inline Vector2DFloat encodeNormal(const Vector3DFloat& normal) + inline uint16_t encodeNormal(const Vector3DFloat& normal) { - return float32x3_to_oct(normal); + Vector2DFloat floatResult = float32x3_to_oct(normal); + + floatResult += Vector2DFloat(1.0f, 1.0f); // To range 0.0f to 2.0f + floatResult *= Vector2DFloat(127.5f, 127.5f); // To range 0.0f to 255.0f + + uint16_t resultX = static_cast(floatResult.getX() + 0.5f); + uint16_t resultY = static_cast(floatResult.getY() + 0.5f); + + resultX &= 0xFF; + resultY &= 0xFF; + + return (resultX << 8) | resultY; } - inline Vector3DFloat decode(const Vector2DFloat& encodedNormal) + inline Vector3DFloat decode(const uint16_t& encodedNormal) { - return oct_to_float32x3(encodedNormal); + uint16_t x = (encodedNormal >> 8) & 0xFF; + uint16_t y = (encodedNormal ) & 0xFF; + Vector2DFloat floatNormal(x, y); + + floatNormal /= Vector2DFloat(127.5f, 127.5f); + floatNormal -= Vector2DFloat(1.0f, 1.0f); + + return oct_to_float32x3(floatNormal); } /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. From 972bc3a4564d08ed00e66ef758d5a1a0d729be78 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 15:13:08 +0200 Subject: [PATCH 129/259] Restructuring some code. --- .../MarchingCubesSurfaceExtractor.h | 105 +++++++++--------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 39ea68c2..f5abaf0a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -64,65 +64,37 @@ namespace PolyVox return result; } - /*inline uint16_t encodeNormal(const Vector3DFloat& normal) - { - Vector3DFloat v3dNormal = normal; - v3dNormal += Vector3DFloat(1.0f, 1.0f, 1.0f); - uint16_t encodedX = static_cast(roundToNearestInteger(v3dNormal.getX() * 15.5f)); - uint16_t encodedY = static_cast(roundToNearestInteger(v3dNormal.getY() * 15.5f)); - uint16_t encodedZ = static_cast(roundToNearestInteger(v3dNormal.getZ() * 15.5f)); - POLYVOX_ASSERT(encodedX < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedY < 32, "Encoded value out of range"); - POLYVOX_ASSERT(encodedZ < 32, "Encoded value out of range"); - uint16_t encodedNormal = (encodedX << 10) | (encodedY << 5) | encodedZ; - return encodedNormal; - } - - /// Decodes a normal from a MarchingCubesVertex - inline Vector3DFloat decode(const uint16_t encodedNormal) - { - // Get normal components in the range 0 to 31 - uint16_t x = (encodedNormal >> 10) & 0x1F; - uint16_t y = (encodedNormal >> 5) & 0x1F; - uint16_t z = (encodedNormal) & 0x1F; - - // Build the resulting vector - Vector3DFloat result(x, y, z); - - // Convert to range 0.0 to 2.0 - result *= (1.0f / 15.5f); // Division is compile-time constant - - // Convert to range -1.0 to 1.0 - result -= Vector3DFloat(1.0f, 1.0f, 1.0f); - - return result; - }*/ - // Returns ±1 float signNotZero(float v) { - return v >= 0.0 ? +1.0 : -1.0; - } - - Vector2DFloat signNotZero(Vector2DFloat v) - { - return Vector2DFloat((v.getX() >= 0.0) ? +1.0 : -1.0, (v.getY() >= 0.0) ? +1.0 : -1.0); + return v >= 0.0f ? +1.0f : -1.0f; } // Assume normalized input. Output is on [-1, 1] for each component. Vector2DFloat float32x3_to_oct(Vector3DFloat v) { - // Project the sphere onto the octahedron, and then onto the xy plane - Vector2DFloat p(v.getX(), v.getY()); - p = p * (1.0f / (abs(v.getX()) + abs(v.getY()) + abs(v.getZ()))); + // Get the input components + float vx = v.getX(); + float vy = v.getY(); + float vz = v.getZ(); - float refX = ((1.0f - abs(p.getY())) * signNotZero(p.getX())); - float refY = ((1.0f - abs(p.getX())) * signNotZero(p.getY())); - - Vector2DFloat ref(refX, refY); + // Project the sphere onto the octahedron, and then onto the xy plane + float px = vx * (1.0f / (abs(vx) + abs(vy) + abs(vz))); + float py = vy * (1.0f / (abs(vx) + abs(vy) + abs(vz))); // Reflect the folds of the lower hemisphere over the diagonals - return (v.getZ() <= 0.0) ? ref : p; + if (vz <= 0.0f) + { + float refx = ((1.0f - abs(py)) * signNotZero(px)); + float refy = ((1.0f - abs(px)) * signNotZero(py)); + px = refx; + py = refy; + } + + Vector2DFloat p(px, py); + + // Reflect the folds of the lower hemisphere over the diagonals + return p; } Vector3DFloat oct_to_float32x3(Vector2DFloat e) @@ -148,17 +120,44 @@ namespace PolyVox inline uint16_t encodeNormal(const Vector3DFloat& normal) { - Vector2DFloat floatResult = float32x3_to_oct(normal); + // The first part of this function is based off the code in Listing 1 of http://jcgt.org/published/0003/02/01/ + // It was rewritten in C++ and is restructued for the CPU rather than the GPU. - floatResult += Vector2DFloat(1.0f, 1.0f); // To range 0.0f to 2.0f - floatResult *= Vector2DFloat(127.5f, 127.5f); // To range 0.0f to 255.0f + // Get the input components + float vx = normal.getX(); + float vy = normal.getY(); + float vz = normal.getZ(); - uint16_t resultX = static_cast(floatResult.getX() + 0.5f); - uint16_t resultY = static_cast(floatResult.getY() + 0.5f); + // Project the sphere onto the octahedron, and then onto the xy plane + float px = vx * (1.0f / (abs(vx) + abs(vy) + abs(vz))); + float py = vy * (1.0f / (abs(vx) + abs(vy) + abs(vz))); + // Reflect the folds of the lower hemisphere over the diagonals. + if (vz <= 0.0f) + { + float refx = ((1.0f - abs(py)) * (px >= 0.0f ? +1.0f : -1.0f)); + float refy = ((1.0f - abs(px)) * (py >= 0.0f ? +1.0f : -1.0f)); + px = refx; + py = refy; + } + + // The next part was not given in the paper. We map our two + // floats into two bytes and store them in a single uint16_t + + // Move from range [-1.0f, 1.0f] to [0.0f, 255.0f] + px = (px + 1.0) * 127.5f; + py = (py + 1.0) * 127.5f; + + // Convert to uints + uint16_t resultX = static_cast(px + 0.5f); + uint16_t resultY = static_cast(py + 0.5f); + + // Make sure only the lower bits are set. Probably + // not necessary but we're just being careful really. resultX &= 0xFF; resultY &= 0xFF; + // Contatenate the bytes and return the result. return (resultX << 8) | resultY; } From 98e722271ee9ca4d159b8ae67f1e21af339b5bc9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 15:40:03 +0200 Subject: [PATCH 130/259] More restructuring code. --- .../MarchingCubesSurfaceExtractor.h | 84 ++++++------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index f5abaf0a..2ef1b103 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -64,60 +64,6 @@ namespace PolyVox return result; } - // Returns ±1 - float signNotZero(float v) - { - return v >= 0.0f ? +1.0f : -1.0f; - } - - // Assume normalized input. Output is on [-1, 1] for each component. - Vector2DFloat float32x3_to_oct(Vector3DFloat v) - { - // Get the input components - float vx = v.getX(); - float vy = v.getY(); - float vz = v.getZ(); - - // Project the sphere onto the octahedron, and then onto the xy plane - float px = vx * (1.0f / (abs(vx) + abs(vy) + abs(vz))); - float py = vy * (1.0f / (abs(vx) + abs(vy) + abs(vz))); - - // Reflect the folds of the lower hemisphere over the diagonals - if (vz <= 0.0f) - { - float refx = ((1.0f - abs(py)) * signNotZero(px)); - float refy = ((1.0f - abs(px)) * signNotZero(py)); - px = refx; - py = refy; - } - - Vector2DFloat p(px, py); - - // Reflect the folds of the lower hemisphere over the diagonals - return p; - } - - Vector3DFloat oct_to_float32x3(Vector2DFloat e) - { - Vector3DFloat v = Vector3DFloat(e.getX(), e.getY(), 1.0 - abs(e.getX()) - abs(e.getY())); - - float refX = ((1.0f - abs(v.getY())) * signNotZero(v.getX())); - float refY = ((1.0f - abs(v.getX())) * signNotZero(v.getY())); - - Vector2DFloat ref(refX, refY); - - if (v.getZ() < 0.0f) - { - //v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy); - v.setX(refX); - v.setY(refY); - } - - v.normalise(); - - return v; - } - inline uint16_t encodeNormal(const Vector3DFloat& normal) { // The first part of this function is based off the code in Listing 1 of http://jcgt.org/published/0003/02/01/ @@ -163,14 +109,32 @@ namespace PolyVox inline Vector3DFloat decode(const uint16_t& encodedNormal) { - uint16_t x = (encodedNormal >> 8) & 0xFF; - uint16_t y = (encodedNormal ) & 0xFF; - Vector2DFloat floatNormal(x, y); + // Extract the two bytes from the uint16_t. + uint16_t ux = (encodedNormal >> 8) & 0xFF; + uint16_t uy = (encodedNormal ) & 0xFF; - floatNormal /= Vector2DFloat(127.5f, 127.5f); - floatNormal -= Vector2DFloat(1.0f, 1.0f); + // Convert to floats in the range [-1.0f, +1.0f]. + float ex = ux / 127.5f - 1.0f; + float ey = uy / 127.5f - 1.0f; - return oct_to_float32x3(floatNormal); + // Reconstruct the origninal vector. This is a C++ implementation + // of Listing 2 of http://jcgt.org/published/0003/02/01/ + float vx = ex; + float vy = ey; + float vz = 1.0f - abs(ex) - abs(ey); + + if (vz < 0.0f) + { + float refX = ((1.0f - abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f)); + float refY = ((1.0f - abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f)); + vx = refX; + vy = refY; + } + + // Normalise and return the result. + Vector3DFloat v(vx, vy, vz); + v.normalise(); + return v; } /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. From bfa14a32dfb4febe0a2d407e09a14712bb4b2bf5 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 16:55:11 +0200 Subject: [PATCH 131/259] Split 'decode()' function into several variants so it's not so heavily overloaded. --- examples/Basic/main.cpp | 2 +- examples/DecodeOnGPU/main.cpp | 2 +- examples/OpenGL/main.cpp | 2 +- examples/Paging/main.cpp | 2 +- examples/SmoothLOD/main.cpp | 4 ++-- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 6 +++--- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 15 +++++++-------- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 4 ++-- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 1f4b210e..0770e269 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. - auto decodedMesh = decode(mesh); + auto decodedMesh = decodeMesh(mesh); //Pass the surface to the OpenGL window openGLWidget.addMesh(decodedMesh); diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 2c0fff6d..7f2d83c8 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. - //auto decodedMesh = decode(mesh); + //auto decodedMesh = decodeMesh(mesh); //Pass the surface to the OpenGL window OpenGLMeshData meshData = buildOpenGLMeshData(mesh); diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 12d1068f..bdf700e0 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) auto mesh = extractMarchingCubesMesh(&volData, regToExtract); // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMesh = decode(mesh); + auto decodedMesh = decodeMesh(mesh); // Pass the surface to the OpenGL window. Note that we are also passing an offset in this multi-mesh example. This is because // the surface extractors return a mesh with 'local space' positions to reduce storage requirements and precision problems. diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index ee2d2d23..58e94b5d 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) auto mesh = extractCubicMesh(&volData, reg2); std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; - auto decodedMesh = decode(mesh); + auto decodedMesh = decodeMesh(mesh); //Pass the surface to the OpenGL window openGLWidget.addMesh(decodedMesh); diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 01c2fdaf..0054c5ce 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -92,12 +92,12 @@ int main(int argc, char *argv[]) //Extract the surface auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMeshLowLOD = decode(meshLowLOD); + auto decodedMeshLowLOD = decodeMesh(meshLowLOD); //Extract the surface auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMeshHighLOD = decode(meshHighLOD); + auto decodedMeshHighLOD = decodeMesh(meshHighLOD); //Pass the surface to the OpenGL window openGLWidget.addMesh(decodedMeshHighLOD, Vector3DInt32(30, 0, 0)); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 71571038..5e059e10 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -54,7 +54,7 @@ namespace PolyVox }; /// Decodes a position from a CubicVertex - inline Vector3DFloat decode(const Vector3DUint8& encodedPosition) + inline Vector3DFloat decodePosition(const Vector3DUint8& encodedPosition) { Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); result -= 0.5f; // Apply the required offset @@ -63,10 +63,10 @@ namespace PolyVox /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. template - Vertex decode(const CubicVertex& cubicVertex) + Vertex decodeVertex(const CubicVertex& cubicVertex) { Vertex result; - result.position = decode(cubicVertex.encodedPosition); + result.position = decodePosition(cubicVertex.encodedPosition); result.normal.setElements(0.0f, 0.0f, 0.0f); // Currently not calculated result.data = cubicVertex.data; // Data is not encoded return result; diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 2ef1b103..18d385f1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -47,9 +47,8 @@ namespace PolyVox // Each component of the position is stored using 8.8 fixed-point encoding. Vector3DUint16 encodedPosition; - // Each component of the normal is encoded using 5 bits of this variable. - // The 16 bits are -xxxxxyyyyyzzzzz (note the left-most bit is currently - // unused). Some extra shifting and scaling is required to make it signed. + // The normal is encoded as a 16-bit unsigned integer using the 'oct16' + // encoding described here: http://jcgt.org/published/0003/02/01/ uint16_t encodedNormal; // User data @@ -57,7 +56,7 @@ namespace PolyVox }; /// Decodes a position from a MarchingCubesVertex - inline Vector3DFloat decode(const Vector3DUint16& encodedPosition) + inline Vector3DFloat decodePosition(const Vector3DUint16& encodedPosition) { Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); result *= (1.0f / 256.0f); // Division is compile-time constant @@ -107,7 +106,7 @@ namespace PolyVox return (resultX << 8) | resultY; } - inline Vector3DFloat decode(const uint16_t& encodedNormal) + inline Vector3DFloat decodeNormal(const uint16_t& encodedNormal) { // Extract the two bytes from the uint16_t. uint16_t ux = (encodedNormal >> 8) & 0xFF; @@ -139,11 +138,11 @@ namespace PolyVox /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. template - Vertex decode(const MarchingCubesVertex& marchingCubesVertex) + Vertex decodeVertex(const MarchingCubesVertex& marchingCubesVertex) { Vertex result; - result.position = decode(marchingCubesVertex.encodedPosition); - result.normal = decode(marchingCubesVertex.encodedNormal); + result.position = decodePosition(marchingCubesVertex.encodedPosition); + result.normal = decodeNormal(marchingCubesVertex.encodedNormal); result.data = marchingCubesVertex.data; // Data is not encoded return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index a1c23b50..64356785 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -72,14 +72,14 @@ namespace PolyVox }; template - Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decode(const MeshType& mesh) + Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodeMesh(const MeshType& mesh) { Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > result; result.m_vecVertices.resize(mesh.m_vecVertices.size()); for(typename MeshType::IndexType ct = 0; ct < mesh.m_vecVertices.size(); ct++) { - result.m_vecVertices[ct] = decode(mesh.m_vecVertices[ct]); + result.m_vecVertices[ct] = decodeVertex(mesh.m_vecVertices[ct]); } result.m_vecTriangleIndices = mesh.m_vecTriangleIndices; From 8326aa86681b6c9d57787f67bdded331b10a1988 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 22:12:02 +0200 Subject: [PATCH 132/259] Updated test (not really a useful fix but should probably think want we want from this test anyway). --- tests/TestSurfaceExtractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 682fa0dc..d7be8937 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -162,7 +162,7 @@ void TestSurfaceExtractor::testExecute() const static uint32_t uExpectedVertices = 4731; const static uint32_t uExpectedIndices = 12810; const static uint32_t uMaterialToCheck = 3000; - const static float fExpectedData = 42.0f; + const static float fExpectedData = 1.0f; const static float fNoMaterial = 1.0f; Mesh > mesh; From 2b7ef5b9664fbeab221ba6c32e7043580d1a596d Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 22:21:53 +0200 Subject: [PATCH 133/259] Reverted some changes which were just for testing the new normal encoding. --- examples/Basic/main.cpp | 42 +++++++++------------------------ examples/common/example.frag | 38 +++++++++++++++--------------- examples/common/example.vert | 45 ++++++++++++++++-------------------- 3 files changed, 50 insertions(+), 75 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 0770e269..b697b189 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -50,34 +50,14 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) //And compute how far the current position is from the center of the volume float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - // We actually want our volume to have high values in the center and low values as we move out, because our - // eath should be a solid sphere surrounded by empty space. If we invert the distance then this is a step in - // the right direction. We still have zero in the center, but lower (negative) values as we move out. - float density = -fDistToCenter; + uint8_t uVoxelValue = 0; - // By adding the 'planetRadius' we now have a function which starts at 'planetRadius' and still decreases as it - // moves out. The function passes through zero at a distance of 'planetRadius' and then continues do decrease - // as it gets even further out. - density += fRadius; - - // Ideally we would like our final density value to be '255' for voxels inside the planet and '0' for voxels - // outside the planet. At the surface there should be a transition but this should occur not too quickly and - // not too slowly, as both of these will result in a jagged appearance to the mesh. - // - // We probably want the transition to occur over a few voxels, whereas it currently occurs over 255 voxels - // because it was derived from the distance. By scaling the density field we effectivly compress the rate - // at which it changes at the surface. We also make the center much too high and the outside very low, but - // we will clamp these to the corect range later. - // - // Note: You can try commenting out or changing the value on this line to see the effect it has. - density *= 50; - - // Until now we've been defining our density field as if the threshold was at zero, with positive densities - // being solid and negative densities being empty. But actually Cubiquity operates on the range 0 to 255, and - // uses a threashold of 127 to decide where to place the generated surface. Therefore we shift and clamp our - // density value and store it in a byte. - density += 127; - uint8_t uVoxelValue = (uint8_t)(clamp(density, 0.0f, 255.0f)); + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new voxel value + uVoxelValue = 255; + } //Wrte the voxel value into the volume volData.setVoxelAt(x, y, z, uVoxelValue); @@ -94,12 +74,12 @@ int main(int argc, char *argv[]) openGLWidget.show(); //Create an empty volume and then place a sphere in it - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(31, 31, 31))); - createSphereInVolume(volData, 15); + SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); - auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); + auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. diff --git a/examples/common/example.frag b/examples/common/example.frag index 56e7d9d6..c9cbf215 100644 --- a/examples/common/example.frag +++ b/examples/common/example.frag @@ -1,19 +1,19 @@ -#version 130 - -// Passed in from the vertex shader -in vec4 worldPosition; -in vec3 worldNormal; - -// the color that gets written to the display -out vec4 outputColor; - -void main() -{ - // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback - // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. - vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); - - // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. - // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. - outputColor = vec4(abs(worldNormal.xyz), 1.0); -} +#version 130 + +// Passed in from the vertex shader +in vec4 worldPosition; +in vec4 worldNormal; + +// the color that gets written to the display +out vec4 outputColor; + +void main() +{ + // Again, for the purposes of these examples we cannot be sure that per-vertex normals are provided. A sensible fallback + // is to use this little trick to compute per-fragment flat-shaded normals from the world positions using derivative operations. + vec3 normal = normalize(cross(dFdy(worldPosition.xyz), dFdx(worldPosition.xyz))); + + // We are just using the normal as the output color, and making it lighter so it looks a bit nicer. + // Obviously a real shader would also do texuring, lighting, or whatever is required for the application. + outputColor = vec4(abs(normal) * 0.5 + vec3(0.5, 0.5, 0.5), 1.0); +} diff --git a/examples/common/example.vert b/examples/common/example.vert index 86f60296..94d35f44 100644 --- a/examples/common/example.vert +++ b/examples/common/example.vert @@ -1,25 +1,20 @@ -#version 140 - -in vec4 position; // This will be the position of the vertex in model-space -in vec3 normal; - -// The usual matrices are provided -uniform mat4 cameraToClipMatrix; -uniform mat4 worldToCameraMatrix; -uniform mat4 modelToWorldMatrix; - -// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach -// but we use it in this example framework because not all surface extractor generate surface normals. -out vec4 worldPosition; -out vec3 worldNormal; - -void main() -{ - // Standard sequence of OpenGL transformations. - worldPosition = modelToWorldMatrix * position; - vec4 cameraPosition = worldToCameraMatrix * worldPosition; - - worldNormal = normal; - - gl_Position = cameraToClipMatrix * cameraPosition; -} +#version 140 + +in vec4 position; // This will be the position of the vertex in model-space + +// The usual matrices are provided +uniform mat4 cameraToClipMatrix; +uniform mat4 worldToCameraMatrix; +uniform mat4 modelToWorldMatrix; + +// This will be used by the fragment shader to calculate flat-shaded normals. This is an unconventional approach +// but we use it in this example framework because not all surface extractor generate surface normals. +out vec4 worldPosition; + +void main() +{ + // Standard sequence of OpenGL transformations. + worldPosition = modelToWorldMatrix * position; + vec4 cameraPosition = worldToCameraMatrix * worldPosition; + gl_Position = cameraToClipMatrix * cameraPosition; +} From 112b277452f090afb649978e264f23204e74d2dc Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 24 Jul 2014 22:38:21 +0200 Subject: [PATCH 134/259] Updated GLSL decoder for new normal packing scheme. --- examples/DecodeOnGPU/decode.vert | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/DecodeOnGPU/decode.vert b/examples/DecodeOnGPU/decode.vert index 5164468a..1ca80d09 100644 --- a/examples/DecodeOnGPU/decode.vert +++ b/examples/DecodeOnGPU/decode.vert @@ -13,17 +13,30 @@ uniform mat4 modelToWorldMatrix; out vec4 worldPosition; out vec4 worldNormal; +// Returns +/- 1 +vec2 signNotZero(vec2 v) +{ + return vec2((v.x >= 0.0) ? +1.0 : -1.0, (v.y >= 0.0) ? +1.0 : -1.0); +} + void main() { vec4 decodedPosition = position; decodedPosition.xyz = decodedPosition.xyz * (1.0 / 256.0); - uint encodedX = (normal >> 10u) & 0x1Fu; - uint encodedY = (normal >> 5u) & 0x1Fu; - uint encodedZ = (normal) & 0x1Fu; - worldNormal.xyz = vec3(encodedX, encodedY, encodedZ); - worldNormal.xyz = worldNormal.xyz / 15.5; - worldNormal.xyz = worldNormal.xyz - vec3(1.0, 1.0, 1.0); + //Get the encoded bytes of the normal + uint encodedX = (normal >> 8u) & 0xFFu; + uint encodedY = (normal) & 0xFFu; + + // Map to range [-1.0, +1.0] + vec2 e = vec2(encodedX, encodedY); + e = e * vec2(1.0 / 127.5, 1.0 / 127.5); + e = e - vec2(1.0, 1.0); + + // Now decode normal using listing 2 of http://jcgt.org/published/0003/02/01/ + vec3 v = vec3(e.xy, 1.0 - abs(e.x) - abs(e.y)); + if (v.z < 0) v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy); + worldNormal.xyz = normalize(v); worldNormal.w = 1.0; // Standard sequence of OpenGL transformations. From 37757da98c06285f6e519c6f0dd3df22b63ea316 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 30 Jul 2014 23:43:26 +0200 Subject: [PATCH 135/259] Qualified use of abs() as it was causing problems on OS X --- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 18d385f1..8f73a6cf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -74,14 +74,14 @@ namespace PolyVox float vz = normal.getZ(); // Project the sphere onto the octahedron, and then onto the xy plane - float px = vx * (1.0f / (abs(vx) + abs(vy) + abs(vz))); - float py = vy * (1.0f / (abs(vx) + abs(vy) + abs(vz))); + float px = vx * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); + float py = vy * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); // Reflect the folds of the lower hemisphere over the diagonals. if (vz <= 0.0f) { - float refx = ((1.0f - abs(py)) * (px >= 0.0f ? +1.0f : -1.0f)); - float refy = ((1.0f - abs(px)) * (py >= 0.0f ? +1.0f : -1.0f)); + float refx = ((1.0f - std::abs(py)) * (px >= 0.0f ? +1.0f : -1.0f)); + float refy = ((1.0f - std::abs(px)) * (py >= 0.0f ? +1.0f : -1.0f)); px = refx; py = refy; } @@ -120,12 +120,12 @@ namespace PolyVox // of Listing 2 of http://jcgt.org/published/0003/02/01/ float vx = ex; float vy = ey; - float vz = 1.0f - abs(ex) - abs(ey); + float vz = 1.0f - std::abs(ex) - std::abs(ey); if (vz < 0.0f) { - float refX = ((1.0f - abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f)); - float refY = ((1.0f - abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f)); + float refX = ((1.0f - std::abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f)); + float refY = ((1.0f - std::abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f)); vx = refX; vy = refY; } From 52dd0189d526350e60fe7db0a5b0cae33f081695 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 7 Aug 2014 23:14:57 +0200 Subject: [PATCH 136/259] Simplified/removed multiple versions of functions, as we're now moving to VS2013 which supports default parameters for template functions. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 24 ++----------------- .../MarchingCubesSurfaceExtractor.h | 23 ++---------------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 3 ++- 3 files changed, 6 insertions(+), 44 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 5e059e10..02fe92c4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -147,14 +147,7 @@ namespace PolyVox }; public: - // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template - // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? -#if defined(_MSC_VER) - CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); -#else CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); -#endif - void execute(); @@ -195,8 +188,8 @@ namespace PolyVox typename VolumeType::VoxelType m_tBorderValue; }; - template - Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + template > + Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) { typedef Mesh > MeshType; MeshType result; @@ -204,19 +197,6 @@ namespace PolyVox extractor.execute(); return result; } - - template - // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template - // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? -#if defined(_MSC_VER) - Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true) -#else - Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) -#endif - { - DefaultIsQuadNeeded isQuadNeeded; - return extractCubicMesh >(volData, region, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); - } } #include "PolyVoxCore/CubicSurfaceExtractor.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 8f73a6cf..c09378eb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -151,13 +151,7 @@ namespace PolyVox class MarchingCubesSurfaceExtractor { public: - // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template - // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? -#if defined(_MSC_VER) - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller()); -#else MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); -#endif void execute(); @@ -324,27 +318,14 @@ namespace PolyVox typename Controller::DensityType m_tThreshold; }; - template< typename VolumeType, typename Controller> - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + template< typename VolumeType, typename Controller = DefaultMarchingCubesController > + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { Mesh > result; MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); extractor.execute(); return result; } - - template< typename VolumeType> - // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template - // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? -#if defined(_MSC_VER) - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) -#else - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) -#endif - { - DefaultMarchingCubesController controller; - return extractMarchingCubesMesh(volData, region, eWrapMode, tBorderValue, controller); - } } #include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index f72d5d37..1069d589 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -142,7 +142,8 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // Mesh //////////////////////////////////////////////////////////////////////////////// - template class Mesh; + typedef uint32_t DefaultIndexType; + template class Mesh; //////////////////////////////////////////////////////////////////////////////// // Pager From c5cf71b161b684e96e760a2ec1a050cdad424bf7 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 7 Aug 2014 23:39:56 +0200 Subject: [PATCH 137/259] Extractors now templatised on index type. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 4 ++-- .../MarchingCubesSurfaceExtractor.h | 10 ++++---- .../MarchingCubesSurfaceExtractor.inl | 24 +++++++++---------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 02fe92c4..69fb80f2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -188,10 +188,10 @@ namespace PolyVox typename VolumeType::VoxelType m_tBorderValue; }; - template > + template, typename IndexType = DefaultIndexType > Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) { - typedef Mesh > MeshType; + typedef Mesh, IndexType > MeshType; MeshType result; CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); extractor.execute(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index c09378eb..b153f721 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -147,11 +147,11 @@ namespace PolyVox return result; } - template< typename VolumeType, typename Controller = DefaultMarchingCubesController > + template< typename VolumeType, typename Controller = DefaultMarchingCubesController, typename IndexType = DefaultIndexType > class MarchingCubesSurfaceExtractor { public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh, IndexType >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); void execute(); @@ -318,11 +318,11 @@ namespace PolyVox typename Controller::DensityType m_tThreshold; }; - template< typename VolumeType, typename Controller = DefaultMarchingCubesController > + template< typename VolumeType, typename Controller = DefaultMarchingCubesController, typename IndexType = DefaultIndexType > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { - Mesh > result; - MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); + Mesh, IndexType > result; + MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); extractor.execute(); return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index cbbcd9e8..44bd544f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -25,8 +25,8 @@ freely, subject to the following restrictions: namespace PolyVox { - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh, IndexType >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -41,8 +41,8 @@ namespace PolyVox m_sampVolume.setWrapMode(eWrapMode, tBorderValue); } - template - void MarchingCubesSurfaceExtractor::execute() + template + void MarchingCubesSurfaceExtractor::execute() { Timer timer; m_meshCurrent->clear(); @@ -129,9 +129,9 @@ namespace PolyVox << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); } - template + template template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) { m_uNoOfOccupiedCells = 0; @@ -195,9 +195,9 @@ namespace PolyVox return m_uNoOfOccupiedCells; } - template + template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) { uint8_t iCubeIndex = 0; @@ -395,8 +395,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) @@ -535,8 +535,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 1069d589..05c2ecea 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -111,7 +111,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // MarchingCubesSurfaceExtractor //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; + template class MarchingCubesSurfaceExtractor; //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex From 94d1b57b81468a66b9585a14a1f2c6cfd1d07e2c Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 9 Aug 2014 09:18:30 +0200 Subject: [PATCH 138/259] Tidying mesh class. --- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 37 ++++++++++++------- .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 24 +++++++++--- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 64356785..22eab2aa 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -50,43 +50,54 @@ namespace PolyVox Mesh(); ~Mesh(); - const std::vector& getIndices(void) const; - uint32_t getNoOfIndices(void) const; IndexType getNoOfVertices(void) const; - const std::vector& getVertices(void) const; + const VertexType& getVertex(IndexType index) const; + const std::vector& getVertices(void) const; //Should probably deprecate + + uint32_t getNoOfIndices(void) const; + IndexType getIndex(uint32_t index) const; + const std::vector& getIndices(void) const; //Should probably deprecate + const Vector3DInt32& getOffset(void) const; + //void setNoOfVertices(IndexType noOfVertices); + //void setVertex() + void setOffset(const Vector3DInt32& offset); - void addTriangle(IndexType index0, IndexType index1, IndexType index2); IndexType addVertex(const VertexType& vertex); + void addTriangle(IndexType index0, IndexType index1, IndexType index2); + void clear(void); bool isEmpty(void) const; void removeUnusedVertices(void); Vector3DInt32 m_offset; - public: + private: std::vector m_vecTriangleIndices; std::vector m_vecVertices; }; template - Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodeMesh(const MeshType& mesh) + Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodeMesh(const MeshType& encodedMesh) { - Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > result; - result.m_vecVertices.resize(mesh.m_vecVertices.size()); + Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodedMesh; - for(typename MeshType::IndexType ct = 0; ct < mesh.m_vecVertices.size(); ct++) + for (auto ct = 0; ct < encodedMesh.getNoOfVertices(); ct++) { - result.m_vecVertices[ct] = decodeVertex(mesh.m_vecVertices[ct]); + decodedMesh.addVertex(decodeVertex(encodedMesh.getVertex(ct))); } - result.m_vecTriangleIndices = mesh.m_vecTriangleIndices; + POLYVOX_ASSERT(encodedMesh.getNoOfIndices() % 3 == 0, "The number of indices must always be a multiple of three."); + for (auto ct = 0; ct < encodedMesh.getNoOfIndices(); ct += 3) + { + decodedMesh.addTriangle(encodedMesh.getIndex(ct), encodedMesh.getIndex(ct + 1), encodedMesh.getIndex(ct + 2)); + } - result.m_offset = mesh.m_offset; + decodedMesh.setOffset(encodedMesh.getOffset()); - return result; + return decodedMesh; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index e34f51ff..afecb00f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -34,9 +34,21 @@ namespace PolyVox } template - const std::vector& Mesh::getIndices(void) const + IndexType Mesh::getNoOfVertices(void) const { - return m_vecTriangleIndices; + return m_vecVertices.size(); + } + + template + const VertexType& Mesh::getVertex(IndexType index) const + { + return m_vecVertices[index]; + } + + template + const std::vector& Mesh::getVertices(void) const + { + return m_vecVertices; } template @@ -46,15 +58,15 @@ namespace PolyVox } template - IndexType Mesh::getNoOfVertices(void) const + IndexType Mesh::getIndex(uint32_t index) const { - return m_vecVertices.size(); + return m_vecTriangleIndices[index]; } template - const std::vector& Mesh::getVertices(void) const + const std::vector& Mesh::getIndices(void) const { - return m_vecVertices; + return m_vecTriangleIndices; } template From 29baac9d6ddea8da312edd5e1c77c87280db53f6 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 9 Aug 2014 09:31:45 +0200 Subject: [PATCH 139/259] Tidying mesh class. --- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 17 ++++------ .../PolyVoxCore/include/PolyVoxCore/Mesh.inl | 34 +++++++++++++------ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 22eab2aa..2143133f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -52,17 +52,15 @@ namespace PolyVox IndexType getNoOfVertices(void) const; const VertexType& getVertex(IndexType index) const; - const std::vector& getVertices(void) const; //Should probably deprecate + const VertexType* getRawVertexData(void) const; + POLYVOX_DEPRECATED const std::vector& getVertices(void) const; uint32_t getNoOfIndices(void) const; IndexType getIndex(uint32_t index) const; - const std::vector& getIndices(void) const; //Should probably deprecate + const IndexType* getRawIndexData(void); + POLYVOX_DEPRECATED const std::vector& getIndices(void) const; const Vector3DInt32& getOffset(void) const; - - //void setNoOfVertices(IndexType noOfVertices); - //void setVertex() - void setOffset(const Vector3DInt32& offset); IndexType addVertex(const VertexType& vertex); @@ -70,13 +68,12 @@ namespace PolyVox void clear(void); bool isEmpty(void) const; - void removeUnusedVertices(void); - - Vector3DInt32 m_offset; + void removeUnusedVertices(void); private: - std::vector m_vecTriangleIndices; + std::vector m_vecIndices; std::vector m_vecVertices; + Vector3DInt32 m_offset; }; template diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index afecb00f..c574687f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -45,6 +45,12 @@ namespace PolyVox return m_vecVertices[index]; } + template + const VertexType* Mesh::getRawVertexData(void) const + { + return &(m_vecVertices[0]); + } + template const std::vector& Mesh::getVertices(void) const { @@ -54,19 +60,25 @@ namespace PolyVox template uint32_t Mesh::getNoOfIndices(void) const { - return m_vecTriangleIndices.size(); + return m_vecIndices.size(); } template IndexType Mesh::getIndex(uint32_t index) const { - return m_vecTriangleIndices[index]; + return m_vecIndices[index]; + } + + template + const IndexType* Mesh::getRawIndexData(void) + { + return &(m_vecIndices[0]); } template const std::vector& Mesh::getIndices(void) const { - return m_vecTriangleIndices; + return m_vecIndices; } template @@ -89,9 +101,9 @@ namespace PolyVox POLYVOX_ASSERT(index1 < m_vecVertices.size(), "Index points at an invalid vertex."); POLYVOX_ASSERT(index2 < m_vecVertices.size(), "Index points at an invalid vertex."); - m_vecTriangleIndices.push_back(index0); - m_vecTriangleIndices.push_back(index1); - m_vecTriangleIndices.push_back(index2); + m_vecIndices.push_back(index0); + m_vecIndices.push_back(index1); + m_vecIndices.push_back(index2); } template @@ -108,7 +120,7 @@ namespace PolyVox void Mesh::clear(void) { m_vecVertices.clear(); - m_vecTriangleIndices.clear(); + m_vecIndices.clear(); } template @@ -123,9 +135,9 @@ namespace PolyVox std::vector isVertexUsed(m_vecVertices.size()); std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) + for(uint32_t triCt = 0; triCt < m_vecIndices.size(); triCt++) { - int v = m_vecTriangleIndices[triCt]; + int v = m_vecIndices[triCt]; isVertexUsed[v] = true; } @@ -143,9 +155,9 @@ namespace PolyVox m_vecVertices.resize(noOfUsedVertices); - for(uint32_t triCt = 0; triCt < m_vecTriangleIndices.size(); triCt++) + for(uint32_t triCt = 0; triCt < m_vecIndices.size(); triCt++) { - m_vecTriangleIndices[triCt] = newPos[m_vecTriangleIndices[triCt]]; + m_vecIndices[triCt] = newPos[m_vecIndices[triCt]]; } } } From eaea74b7f80de5cfc3f925fb911b2918b9d2b29f Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 10 Aug 2014 09:18:27 +0200 Subject: [PATCH 140/259] Templatizing marching cubes extractor on mesh type. --- .../MarchingCubesSurfaceExtractor.h | 14 +++++++---- .../MarchingCubesSurfaceExtractor.inl | 24 +++++++++---------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- tests/TestSurfaceExtractor.cpp | 3 +-- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index b153f721..51f2e485 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -147,11 +147,11 @@ namespace PolyVox return result; } - template< typename VolumeType, typename Controller = DefaultMarchingCubesController, typename IndexType = DefaultIndexType > + template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > class MarchingCubesSurfaceExtractor { public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh, IndexType >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); void execute(); @@ -318,12 +318,18 @@ namespace PolyVox typename Controller::DensityType m_tThreshold; }; + template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > + void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) + { + MarchingCubesSurfaceExtractor extractor(volData, region, result, eWrapMode, tBorderValue, controller); + extractor.execute(); + } + template< typename VolumeType, typename Controller = DefaultMarchingCubesController, typename IndexType = DefaultIndexType > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { Mesh, IndexType > result; - MarchingCubesSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, controller); - extractor.execute(); + extractMarchingCubesMesh(volData, region, &result, eWrapMode, tBorderValue, controller); return result; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 44bd544f..49f8ca0e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -25,8 +25,8 @@ freely, subject to the following restrictions: namespace PolyVox { - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, Mesh, IndexType >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -41,8 +41,8 @@ namespace PolyVox m_sampVolume.setWrapMode(eWrapMode, tBorderValue); } - template - void MarchingCubesSurfaceExtractor::execute() + template + void MarchingCubesSurfaceExtractor::execute() { Timer timer; m_meshCurrent->clear(); @@ -129,9 +129,9 @@ namespace PolyVox << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); } - template + template template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) { m_uNoOfOccupiedCells = 0; @@ -195,9 +195,9 @@ namespace PolyVox return m_uNoOfOccupiedCells; } - template + template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) { uint8_t iCubeIndex = 0; @@ -395,8 +395,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) @@ -535,8 +535,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 05c2ecea..6139bb90 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -111,7 +111,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // MarchingCubesSurfaceExtractor //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; + template class MarchingCubesSurfaceExtractor; //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index d7be8937..081f6cfc 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -153,8 +153,7 @@ void testCustomController(Mesh >& result) } CustomMarchingCubesController controller; - MarchingCubesSurfaceExtractor< SimpleVolume, CustomMarchingCubesController > extractor(&volData, volData.getEnclosingRegion(), &result, WrapModes::Border, 0, controller); - extractor.execute(); + extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), &result, WrapModes::Border, 0, controller); } void TestSurfaceExtractor::testExecute() From 4b3c8a1648df18aa27d6058ea31810b54b906c1f Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Aug 2014 08:46:06 +0200 Subject: [PATCH 141/259] Committing half-finished work on test so that I can work on it from elsewhere. --- .../MarchingCubesSurfaceExtractor.h | 2 ++ tests/TestSurfaceExtractor.cpp | 26 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 51f2e485..c482abdf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -318,6 +318,8 @@ namespace PolyVox typename Controller::DensityType m_tThreshold; }; + // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes + // more sense to use the other variaent of this function where the mesh is a return value rather than a parameter. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 081f6cfc..4a4e95bc 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -100,14 +100,13 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) voxel.setMaterial(valueToWrite); } -// Runs the surface extractor for a given type. template -Mesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? +SimpleVolume* createAndFillVolume(void) { const int32_t uVolumeSideLength = 32; //Create empty volume - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); + SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); for (int32_t z = 0; z < uVolumeSideLength; z++) { @@ -120,15 +119,25 @@ Mesh > testForType(void) //I think we could avoid writeDensityValueToVoxel(x + y + z, voxelValue); //Two different materials in two halves of the volume writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); - volData.setVoxelAt(x, y, z, voxelValue); + volData->setVoxelAt(x, y, z, voxelValue); } } } + return volData; +} + +// Runs the surface extractor for a given type. +template +Mesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? +{ + //Create empty volume + SimpleVolume* volData = createAndFillVolume(); + DefaultMarchingCubesController controller; controller.setThreshold(50); - auto result = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); + auto result = extractMarchingCubesMesh(volData, volData->getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); return result; } @@ -223,6 +232,13 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].data, fExpectedData);*/ + + auto uintVol = createAndFillVolume(); + auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); + QCOMPARE(uintMesh.getNoOfVertices(), uExpectedVertices); + QCOMPARE(uintMesh.getNoOfIndices(), uExpectedIndices); + //QCOMPARE(uintMesh.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); + std::cout << uintMesh.getVertices()[uMaterialToCheck].data << std::endl; } QTEST_MAIN(TestSurfaceExtractor) From 11845c1d316a30089174b08a360b945e911e2649 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Aug 2014 15:53:25 +0200 Subject: [PATCH 142/259] Work on tests. --- tests/TestSurfaceExtractor.cpp | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 4a4e95bc..398e720d 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -100,7 +100,7 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) voxel.setMaterial(valueToWrite); } -template +/*template SimpleVolume* createAndFillVolume(void) { const int32_t uVolumeSideLength = 32; @@ -125,19 +125,37 @@ SimpleVolume* createAndFillVolume(void) } return volData; -} +}*/ // Runs the surface extractor for a given type. template Mesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? { + const int32_t uVolumeSideLength = 32; + //Create empty volume - SimpleVolume* volData = createAndFillVolume(); + SimpleVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); + + for (int32_t z = 0; z < uVolumeSideLength; z++) + { + for (int32_t y = 0; y < uVolumeSideLength; y++) + { + for (int32_t x = 0; x < uVolumeSideLength; x++) + { + VoxelType voxelValue; + //Create a density field which changes throughout the volume. + writeDensityValueToVoxel(x + y + z, voxelValue); + //Two different materials in two halves of the volume + writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); + volData.setVoxelAt(x, y, z, voxelValue); + } + } + } DefaultMarchingCubesController controller; controller.setThreshold(50); - auto result = extractMarchingCubesMesh(volData, volData->getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); + auto result = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); return result; } @@ -233,12 +251,12 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].data, fExpectedData);*/ - auto uintVol = createAndFillVolume(); + /*auto uintVol = createAndFillVolume(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); QCOMPARE(uintMesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(uintMesh.getNoOfIndices(), uExpectedIndices); + QCOMPARE(uintMesh.getNoOfIndices(), uExpectedIndices);*/ //QCOMPARE(uintMesh.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - std::cout << uintMesh.getVertices()[uMaterialToCheck].data << std::endl; + //std::cout << uintMesh.getVertices()[uMaterialToCheck].data << std::endl; } QTEST_MAIN(TestSurfaceExtractor) From 64ba3f20f84986321d3701d3201ab05c06487acd Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Aug 2014 16:20:11 +0200 Subject: [PATCH 143/259] Work on extractor tests. --- tests/TestSurfaceExtractor.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 398e720d..c8a88e83 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -100,32 +100,30 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) voxel.setMaterial(valueToWrite); } -/*template +template SimpleVolume* createAndFillVolume(void) { - const int32_t uVolumeSideLength = 32; + const int32_t uVolumeSideLength = 64; //Create empty volume SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); + // Fill for (int32_t z = 0; z < uVolumeSideLength; z++) { for (int32_t y = 0; y < uVolumeSideLength; y++) { for (int32_t x = 0; x < uVolumeSideLength; x++) { - VoxelType voxelValue; - //Create a density field which changes throughout the volume. - writeDensityValueToVoxel(x + y + z, voxelValue); - //Two different materials in two halves of the volume - writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); - volData->setVoxelAt(x, y, z, voxelValue); + // Create a density field which changes throughout the volume. It's + // zero in the lower corner and increasing as the coordinates increase. + volData->setVoxelAt(x, y, z, x + y + z); } } } return volData; -}*/ +} // Runs the surface extractor for a given type. template @@ -251,12 +249,18 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].data, fExpectedData);*/ - /*auto uintVol = createAndFillVolume(); + auto uintVol = createAndFillVolume(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); - QCOMPARE(uintMesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(uintMesh.getNoOfIndices(), uExpectedIndices);*/ - //QCOMPARE(uintMesh.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - //std::cout << uintMesh.getVertices()[uMaterialToCheck].data << std::endl; + QCOMPARE(uintMesh.getNoOfVertices(), 12096u); // Verifies size of mesh + QCOMPARE(uintMesh.getNoOfIndices(), 35157u); // Verifies size of mesh + QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit index buffer + + auto intVol = createAndFillVolume(); + CustomMarchingCubesController intCustomController; + auto intMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), intCustomController); + QCOMPARE(intMesh.getNoOfVertices(), 16113u); // Verifies size of mesh + QCOMPARE(intMesh.getNoOfIndices(), 22053u); // Verifies size of mesh + QCOMPARE(intMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit index buffer } QTEST_MAIN(TestSurfaceExtractor) From e2f43ebc5d8583e351f09908a511539cc22f70ee Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Aug 2014 23:46:01 +0200 Subject: [PATCH 144/259] More work on tests and surface extraction functions. --- .../MarchingCubesSurfaceExtractor.h | 8 ++++---- .../MarchingCubesSurfaceExtractor.inl | 3 ++- tests/TestSurfaceExtractor.cpp | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index c482abdf..3ecf78fb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -151,7 +151,7 @@ namespace PolyVox class MarchingCubesSurfaceExtractor { public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller(), MeshType* result = nullptr); void execute(); @@ -321,9 +321,9 @@ namespace PolyVox // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes // more sense to use the other variaent of this function where the mesh is a return value rather than a parameter. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > - void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) + void extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller(), MeshType* result = nullptr) { - MarchingCubesSurfaceExtractor extractor(volData, region, result, eWrapMode, tBorderValue, controller); + MarchingCubesSurfaceExtractor extractor(volData, region, eWrapMode, tBorderValue, controller, result); extractor.execute(); } @@ -331,7 +331,7 @@ namespace PolyVox Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { Mesh, IndexType > result; - extractMarchingCubesMesh(volData, region, &result, eWrapMode, tBorderValue, controller); + extractMarchingCubesMesh(volData, region, eWrapMode, tBorderValue, controller, &result); return result; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 49f8ca0e..bc212cdc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller) + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller, MeshType* result = nullptr) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -34,6 +34,7 @@ namespace PolyVox ,m_controller(controller) ,m_tThreshold(m_controller.getThreshold()) { + POLYVOX_THROW_IF(m_meshCurrent == nullptr, std::invalid_argument, "Provided mesh cannot be null"); //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); m_regSizeInCells = m_regSizeInVoxels; m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index c8a88e83..d15e8fed 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -178,7 +178,7 @@ void testCustomController(Mesh >& result) } CustomMarchingCubesController controller; - extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), &result, WrapModes::Border, 0, controller); + extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, 0, controller, &result); } void TestSurfaceExtractor::testExecute() @@ -255,12 +255,18 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(uintMesh.getNoOfIndices(), 35157u); // Verifies size of mesh QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit index buffer + auto floatVol = createAndFillVolume(); + CustomMarchingCubesController floatCustomController; + auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), WrapModes::Border, float(0), floatCustomController); + QCOMPARE(floatMesh.getNoOfVertices(), 16113u); // Verifies size of mesh + QCOMPARE(floatMesh.getNoOfIndices(), 22053u); // Verifies size of mesh + QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit index buffer + auto intVol = createAndFillVolume(); - CustomMarchingCubesController intCustomController; - auto intMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), intCustomController); - QCOMPARE(intMesh.getNoOfVertices(), 16113u); // Verifies size of mesh - QCOMPARE(intMesh.getNoOfIndices(), 22053u); // Verifies size of mesh - QCOMPARE(intMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit index buffer + auto intMesh = extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), DefaultMarchingCubesController()); + QCOMPARE(intMesh.getNoOfVertices(), 11718u); // Verifies size of mesh + QCOMPARE(intMesh.getNoOfIndices(), 34041u); // Verifies size of mesh + QCOMPARE(intMesh.getIndex(100), uint32_t(29)); // Verifies that we have 32-bit index buffer } QTEST_MAIN(TestSurfaceExtractor) From ccc9a3c158ab45f9c70942db7a057e71dab84935 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 12 Aug 2014 15:53:30 +0200 Subject: [PATCH 145/259] More work on surface extraction tests. --- .../MarchingCubesSurfaceExtractor.h | 10 ++++----- .../PolyVoxCore/include/PolyVoxCore/Mesh.h | 4 ++-- tests/TestSurfaceExtractor.cpp | 21 ++++++++++--------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 3ecf78fb..3c370d5a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -90,8 +90,8 @@ namespace PolyVox // floats into two bytes and store them in a single uint16_t // Move from range [-1.0f, 1.0f] to [0.0f, 255.0f] - px = (px + 1.0) * 127.5f; - py = (py + 1.0) * 127.5f; + px = (px + 1.0f) * 127.5f; + py = (py + 1.0f) * 127.5f; // Convert to uints uint16_t resultX = static_cast(px + 0.5f); @@ -300,7 +300,7 @@ namespace PolyVox uint32_t m_uNoOfOccupiedCells; //The surface patch we are currently filling. - Mesh >* m_meshCurrent; + MeshType* m_meshCurrent; //Information about the region we are currently processing Region m_regSizeInVoxels; @@ -327,10 +327,10 @@ namespace PolyVox extractor.execute(); } - template< typename VolumeType, typename Controller = DefaultMarchingCubesController, typename IndexType = DefaultIndexType > + template< typename VolumeType, typename Controller = DefaultMarchingCubesController > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) { - Mesh, IndexType > result; + Mesh, DefaultIndexType > result; extractMarchingCubesMesh(volData, region, eWrapMode, tBorderValue, controller, &result); return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 2143133f..802b0656 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -81,13 +81,13 @@ namespace PolyVox { Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodedMesh; - for (auto ct = 0; ct < encodedMesh.getNoOfVertices(); ct++) + for (MeshType::IndexType ct = 0; ct < encodedMesh.getNoOfVertices(); ct++) { decodedMesh.addVertex(decodeVertex(encodedMesh.getVertex(ct))); } POLYVOX_ASSERT(encodedMesh.getNoOfIndices() % 3 == 0, "The number of indices must always be a multiple of three."); - for (auto ct = 0; ct < encodedMesh.getNoOfIndices(); ct += 3) + for (uint32_t ct = 0; ct < encodedMesh.getNoOfIndices(); ct += 3) { decodedMesh.addTriangle(encodedMesh.getIndex(ct), encodedMesh.getIndex(ct + 1), encodedMesh.getIndex(ct + 2)); } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index d15e8fed..0c494d93 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -251,22 +251,23 @@ void TestSurfaceExtractor::testExecute() auto uintVol = createAndFillVolume(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); - QCOMPARE(uintMesh.getNoOfVertices(), 12096u); // Verifies size of mesh - QCOMPARE(uintMesh.getNoOfIndices(), 35157u); // Verifies size of mesh - QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit index buffer + QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices auto floatVol = createAndFillVolume(); CustomMarchingCubesController floatCustomController; auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), WrapModes::Border, float(0), floatCustomController); - QCOMPARE(floatMesh.getNoOfVertices(), 16113u); // Verifies size of mesh - QCOMPARE(floatMesh.getNoOfIndices(), 22053u); // Verifies size of mesh - QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit index buffer + QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices auto intVol = createAndFillVolume(); - auto intMesh = extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), DefaultMarchingCubesController()); - QCOMPARE(intMesh.getNoOfVertices(), 11718u); // Verifies size of mesh - QCOMPARE(intMesh.getNoOfIndices(), 34041u); // Verifies size of mesh - QCOMPARE(intMesh.getIndex(100), uint32_t(29)); // Verifies that we have 32-bit index buffer + Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; + extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), DefaultMarchingCubesController(), &intMesh); + QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices + QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh + QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices } QTEST_MAIN(TestSurfaceExtractor) From 0b5e7071aeb27816f9466c72d3c434c1a47c510b Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 12 Aug 2014 15:57:52 +0200 Subject: [PATCH 146/259] Added double test. --- tests/TestSurfaceExtractor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 0c494d93..e80f6b78 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -268,6 +268,14 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices + + auto doubleVol = createAndFillVolume(); + CustomMarchingCubesController doubleCustomController; + Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; + extractMarchingCubesMesh(doubleVol, doubleVol->getEnclosingRegion(), WrapModes::Border, double(0), doubleCustomController, &doubleMesh); + QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices } QTEST_MAIN(TestSurfaceExtractor) From ed4bdf08c47a2e12c0ecbaaa0b66e1ebe30a00f9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 12 Aug 2014 16:09:56 +0200 Subject: [PATCH 147/259] Added extraction test for MaterialDensityPair. --- tests/TestSurfaceExtractor.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index e80f6b78..db9ac0b2 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -117,7 +117,10 @@ SimpleVolume* createAndFillVolume(void) { // Create a density field which changes throughout the volume. It's // zero in the lower corner and increasing as the coordinates increase. - volData->setVoxelAt(x, y, z, x + y + z); + VoxelType voxelValue; + writeDensityValueToVoxel(x + y + z, voxelValue); + writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); + volData->setVoxelAt(x, y, z, voxelValue); } } } @@ -276,6 +279,13 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices + + auto materialVol = createAndFillVolume(); + auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); + QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); } QTEST_MAIN(TestSurfaceExtractor) From d4118a20528af40299d6f3b3a4e9605f548aad50 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 12 Aug 2014 16:53:47 +0200 Subject: [PATCH 148/259] More work on tests. --- .../MarchingCubesSurfaceExtractor.h | 7 + tests/TestSurfaceExtractor.cpp | 149 +++--------------- 2 files changed, 26 insertions(+), 130 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 3c370d5a..3d8cba5b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -318,6 +318,13 @@ namespace PolyVox typename Controller::DensityType m_tThreshold; }; + // This version of the function performs the extraction into a user-provided mesh rather than allocating a mesh automatically. + // There are a few reasons why this might be useful to more advanced users: + // + // 1. It leaves the user in control of memory allocation and would allow them to implement e.g. a mesh pooling system. + // 2. The user-provided mesh could have a different index type (e.g. 16-bit indices) to reduce memory usage. + // 3. The user could provide a custom mesh class, e.g a thin wrapper around an openGL VBO to allow direct writing into this structure. + // // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes // more sense to use the other variaent of this function where the mesh is a return value rather than a parameter. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index db9ac0b2..9a5acb21 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -52,12 +52,12 @@ public: float convertToMaterial(float /*voxel*/) { - return 1; + return 1.0f; } float blendMaterials(float /*a*/, float /*b*/, float /*weight*/) { - return 1; + return 1.0f; } float getThreshold(void) @@ -75,12 +75,6 @@ void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) voxel = valueToWrite; } -template<> -void writeDensityValueToVoxel(int valueToWrite, Density8& voxel) -{ - voxel.setDensity(valueToWrite); -} - template<> void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) { @@ -128,150 +122,43 @@ SimpleVolume* createAndFillVolume(void) return volData; } -// Runs the surface extractor for a given type. -template -Mesh > testForType(void) //I think we could avoid specifying this return type by using auto/decltype? -{ - const int32_t uVolumeSideLength = 32; - - //Create empty volume - SimpleVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); - - for (int32_t z = 0; z < uVolumeSideLength; z++) - { - for (int32_t y = 0; y < uVolumeSideLength; y++) - { - for (int32_t x = 0; x < uVolumeSideLength; x++) - { - VoxelType voxelValue; - //Create a density field which changes throughout the volume. - writeDensityValueToVoxel(x + y + z, voxelValue); - //Two different materials in two halves of the volume - writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); - volData.setVoxelAt(x, y, z, voxelValue); - } - } - } - - DefaultMarchingCubesController controller; - controller.setThreshold(50); - - auto result = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, VoxelType(), controller); - - return result; -} - -void testCustomController(Mesh >& result) -{ - const int32_t uVolumeSideLength = 32; - - //Create empty volume - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); - - for (int32_t z = 0; z < uVolumeSideLength; z++) - { - for (int32_t y = 0; y < uVolumeSideLength; y++) - { - for (int32_t x = 0; x < uVolumeSideLength; x++) - { - float voxelValue = x + y + z; - volData.setVoxelAt(x, y, z, voxelValue); - } - } - } - - CustomMarchingCubesController controller; - extractMarchingCubesMesh(&volData, volData.getEnclosingRegion(), WrapModes::Border, 0, controller, &result); -} - void TestSurfaceExtractor::testExecute() { - const static uint32_t uExpectedVertices = 4731; - const static uint32_t uExpectedIndices = 12810; - const static uint32_t uMaterialToCheck = 3000; - const static float fExpectedData = 1.0f; - const static float fNoMaterial = 1.0f; - - Mesh > mesh; - //Run the test for various voxel types. - QBENCHMARK { - mesh = testForType(); - } - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh1 = testForType(); - QCOMPARE(mesh1.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh1.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh1.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh2 = testForType(); - QCOMPARE(mesh2.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh2.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh2.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh3 = testForType(); - QCOMPARE(mesh3.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh3.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh3.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh4 = testForType(); - QCOMPARE(mesh4.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh4.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh4.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh5 = testForType(); - QCOMPARE(mesh5.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh5.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh5.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh6 = testForType(); - QCOMPARE(mesh6.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh6.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh6.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh7 = testForType(); - QCOMPARE(mesh7.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh7.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh7.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh8 = testForType(); - QCOMPARE(mesh8.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh8.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh8.getVertices()[uMaterialToCheck].data, static_cast(fExpectedData)); - - auto mesh9 = testForType(); - QCOMPARE(mesh9.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh9.getNoOfIndices(), uExpectedIndices); - //QCOMPARE(mesh9.getVertices()[uMaterialToCheck].data, fExpectedMaterial); - - //Test whether the CustomSurfaceExtractor works. - /*testCustomController(floatMesh); - QCOMPARE(floatMesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(floatMesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(floatMesh.getVertices()[uMaterialToCheck].data, fExpectedData);*/ + // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers + // and user-provided meshes to make sure these various combinations work as expected. + // + // It is also noted that the number of indices and vertices is varying quite significantly based on the voxel type. This seems unexpected, but could + // be explained if some overflow is occuring when writing data into the volume, causing volumes of different voxel types to have different distributions. + // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. + // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. auto uintVol = createAndFillVolume(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type + // This test makes use of a custom controller auto floatVol = createAndFillVolume(); CustomMarchingCubesController floatCustomController; auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), WrapModes::Border, float(0), floatCustomController); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type + // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us + // use a default for the second-to-last parameter but noot use a default for the last parameter. auto intVol = createAndFillVolume(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), DefaultMarchingCubesController(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices + QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type + // This test makes use of a user-provided mesh and also a custom controller. auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; @@ -279,13 +166,15 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type + // This test ensures the extractor works on a non-primitive voxel type. auto materialVol = createAndFillVolume(); auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices - QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); + QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex } QTEST_MAIN(TestSurfaceExtractor) From f1ed0c1be20bfcb5be7a232eaa99351e9b1fc321 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 13 Aug 2014 15:59:13 +0200 Subject: [PATCH 149/259] Examples now support both 16 and 32 bit indices. --- examples/common/OpenGLWidget.cpp | 2 +- examples/common/OpenGLWidget.h | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 439264bf..44747f2b 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -161,7 +161,7 @@ void OpenGLWidget::paintGL() // Bind the vertex array for the current mesh glBindVertexArray(meshData.vertexArrayObject); // Draw the mesh - glDrawElements(GL_TRIANGLES, meshData.noOfIndices, GL_UNSIGNED_INT, 0); + glDrawElements(GL_TRIANGLES, meshData.noOfIndices, meshData.indexType, 0); // Unbind the vertex array. glBindVertexArray(0); } diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 1bbbc1e4..fb9a7459 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -36,6 +36,7 @@ distribution. struct OpenGLMeshData { GLuint noOfIndices; + GLenum indexType; GLuint indexBuffer; GLuint vertexBuffer; GLuint vertexArrayObject; @@ -53,8 +54,8 @@ public: OpenGLWidget(QWidget *parent); // Convert a PolyVox mesh to OpenGL index/vertex buffers. Inlined because it's templatised. - template - void addMesh(const PolyVox::Mesh< PolyVox::Vertex< DataType > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) + template + void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) { // Convienient access to the vertices and indices const auto& vecIndices = surfaceMesh.getIndices(); @@ -71,29 +72,29 @@ public: // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PolyVox::Vertex< DataType >), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(MeshType::IndexType), vecIndices.data(), GL_STATIC_DRAW); // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(PolyVox::Vertex< DataType >), (GLvoid*)(offsetof(PolyVox::Vertex< DataType >, data))); + GLint size = (std::min)(sizeof(MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, data))); // We're done uploading and can now unbind. glBindVertexArray(0); @@ -103,6 +104,9 @@ public: meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); meshData.scale = scale; + // Set 16 or 32-bit index buffer size. + meshData.indexType = sizeof(MeshType::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; + // Now add the mesh to the list of meshes to render. addMeshData(meshData); } From 93fdd36f8fa3560d50ec8381a8aa16f8419895b4 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 14 Aug 2014 15:57:10 +0200 Subject: [PATCH 150/259] Work on interface to 'extractMarchingCubesMesh' and tests. --- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 13 +++++++------ .../PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 2 +- tests/TestSurfaceExtractor.cpp | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 3d8cba5b..7a5ddccd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -147,11 +147,11 @@ namespace PolyVox return result; } - template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > + template< typename VolumeType, typename MeshType, typename Controller> class MarchingCubesSurfaceExtractor { public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller(), MeshType* result = nullptr); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, Controller controller, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()); void execute(); @@ -328,17 +328,18 @@ namespace PolyVox // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes // more sense to use the other variaent of this function where the mesh is a return value rather than a parameter. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > - void extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller(), MeshType* result = nullptr) + void extractMarchingCubesCustomMesh(VolumeType* volData, Region region, MeshType* result, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { - MarchingCubesSurfaceExtractor extractor(volData, region, eWrapMode, tBorderValue, controller, result); + result->getNoOfVertices(); + MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); extractor.execute(); } template< typename VolumeType, typename Controller = DefaultMarchingCubesController > - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { Mesh, DefaultIndexType > result; - extractMarchingCubesMesh(volData, region, eWrapMode, tBorderValue, controller, &result); + extractMarchingCubesCustomMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index bc212cdc..bf24116e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, Controller controller, MeshType* result = nullptr) + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, Controller controller, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 9a5acb21..8ab93f35 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -142,7 +142,7 @@ void TestSurfaceExtractor::testExecute() // This test makes use of a custom controller auto floatVol = createAndFillVolume(); CustomMarchingCubesController floatCustomController; - auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), WrapModes::Border, float(0), floatCustomController); + auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController, WrapModes::Border, float(0)); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices @@ -152,7 +152,7 @@ void TestSurfaceExtractor::testExecute() // use a default for the second-to-last parameter but noot use a default for the last parameter. auto intVol = createAndFillVolume(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; - extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), WrapModes::Border, int8_t(0), DefaultMarchingCubesController(), &intMesh); + extractMarchingCubesCustomMesh(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices @@ -162,7 +162,7 @@ void TestSurfaceExtractor::testExecute() auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; - extractMarchingCubesMesh(doubleVol, doubleVol->getEnclosingRegion(), WrapModes::Border, double(0), doubleCustomController, &doubleMesh); + extractMarchingCubesCustomMesh(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController, WrapModes::Border, double(0)); QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices From aa4591d206035e6312169dc55f0ff9d4c3ef4768 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 14 Aug 2014 16:34:29 +0200 Subject: [PATCH 151/259] Added comments. --- .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 7a5ddccd..5e820c5c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -326,15 +326,19 @@ namespace PolyVox // 3. The user could provide a custom mesh class, e.g a thin wrapper around an openGL VBO to allow direct writing into this structure. // // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes - // more sense to use the other variaent of this function where the mesh is a return value rather than a parameter. + // more sense to use the other variant of this function where the mesh is a return value rather than a parameter. + // + // Note: This function is called 'extractMarchingCubesCustomMesh' rather than 'extractMarchingCubesMesh' to avoid ambiguity when only three parameters + // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, + // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > void extractMarchingCubesCustomMesh(VolumeType* volData, Region region, MeshType* result, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { - result->getNoOfVertices(); MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); extractor.execute(); } + // This version of the function is easier to use - it automatically creates and returns a mesh of the appropriate type so the user doesn't have to worry about it. template< typename VolumeType, typename Controller = DefaultMarchingCubesController > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { From 0ccc268b1618af41738c43e1b0349fafd50181d2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 16 Aug 2014 09:55:08 +0200 Subject: [PATCH 152/259] Avoided ambiguous functions through the (possibly too clever) use of SFINAE. --- .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 9 ++++++--- tests/TestSurfaceExtractor.cpp | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 5e820c5c..4db8218c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -331,19 +331,22 @@ namespace PolyVox // Note: This function is called 'extractMarchingCubesCustomMesh' rather than 'extractMarchingCubesMesh' to avoid ambiguity when only three parameters // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. + // + // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > - void extractMarchingCubesCustomMesh(VolumeType* volData, Region region, MeshType* result, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename MeshType::VertexType doNotUseThisParameter = typename MeshType::VertexType()) { MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); extractor.execute(); } // This version of the function is easier to use - it automatically creates and returns a mesh of the appropriate type so the user doesn't have to worry about it. + // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. template< typename VolumeType, typename Controller = DefaultMarchingCubesController > - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename Controller::DensityType doNotUseThisParameter = typename Controller::DensityType()) { Mesh, DefaultIndexType > result; - extractMarchingCubesCustomMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); + extractMarchingCubesMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 8ab93f35..6c665372 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -142,7 +142,7 @@ void TestSurfaceExtractor::testExecute() // This test makes use of a custom controller auto floatVol = createAndFillVolume(); CustomMarchingCubesController floatCustomController; - auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController, WrapModes::Border, float(0)); + auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices @@ -152,7 +152,7 @@ void TestSurfaceExtractor::testExecute() // use a default for the second-to-last parameter but noot use a default for the last parameter. auto intVol = createAndFillVolume(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; - extractMarchingCubesCustomMesh(intVol, intVol->getEnclosingRegion(), &intMesh); + extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices @@ -162,7 +162,7 @@ void TestSurfaceExtractor::testExecute() auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; - extractMarchingCubesCustomMesh(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController, WrapModes::Border, double(0)); + extractMarchingCubesMesh(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices From 6c30f34089d20a95ef6513160bda5b41063bce2c Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 16 Aug 2014 16:24:52 +0200 Subject: [PATCH 153/259] Renamed 'Controller' to 'ControllerType' when used as a template parameter. --- .../MarchingCubesSurfaceExtractor.h | 18 +++++++------- .../MarchingCubesSurfaceExtractor.inl | 24 +++++++++---------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 4db8218c..61909a41 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -147,11 +147,11 @@ namespace PolyVox return result; } - template< typename VolumeType, typename MeshType, typename Controller> + template< typename VolumeType, typename MeshType, typename ControllerType> class MarchingCubesSurfaceExtractor { public: - MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, Controller controller, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()); + MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()); void execute(); @@ -312,10 +312,10 @@ namespace PolyVox Region m_regSliceCurrent; //Used to convert arbitrary voxel types in densities and materials. - Controller m_controller; + ControllerType m_controller; //Our threshold value - typename Controller::DensityType m_tThreshold; + typename ControllerType::DensityType m_tThreshold; }; // This version of the function performs the extraction into a user-provided mesh rather than allocating a mesh automatically. @@ -333,17 +333,17 @@ namespace PolyVox // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. // // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. - template< typename VolumeType, typename MeshType, typename Controller = DefaultMarchingCubesController > - void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename MeshType::VertexType doNotUseThisParameter = typename MeshType::VertexType()) + template< typename VolumeType, typename MeshType, typename ControllerType = DefaultMarchingCubesController > + void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename MeshType::VertexType doNotUseThisParameter = typename MeshType::VertexType()) { - MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); + MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); extractor.execute(); } // This version of the function is easier to use - it automatically creates and returns a mesh of the appropriate type so the user doesn't have to worry about it. // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. - template< typename VolumeType, typename Controller = DefaultMarchingCubesController > - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, Controller controller = Controller(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename Controller::DensityType doNotUseThisParameter = typename Controller::DensityType()) + template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename ControllerType::DensityType doNotUseThisParameter = typename ControllerType::DensityType()) { Mesh, DefaultIndexType > result; extractMarchingCubesMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index bf24116e..fd226560 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -25,8 +25,8 @@ freely, subject to the following restrictions: namespace PolyVox { - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, Controller controller, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue) + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue) :m_volData(volData) ,m_sampVolume(volData) ,m_meshCurrent(result) @@ -42,8 +42,8 @@ namespace PolyVox m_sampVolume.setWrapMode(eWrapMode, tBorderValue); } - template - void MarchingCubesSurfaceExtractor::execute() + template + void MarchingCubesSurfaceExtractor::execute() { Timer timer; m_meshCurrent->clear(); @@ -130,9 +130,9 @@ namespace PolyVox << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); } - template + template template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) { m_uNoOfOccupiedCells = 0; @@ -196,9 +196,9 @@ namespace PolyVox return m_uNoOfOccupiedCells; } - template + template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) { uint8_t iCubeIndex = 0; @@ -396,8 +396,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) @@ -536,8 +536,8 @@ namespace PolyVox } } - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 6139bb90..0b401a98 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -111,7 +111,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // MarchingCubesSurfaceExtractor //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; + template class MarchingCubesSurfaceExtractor; //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex From 1f5c0743643df8526f4d0b5a9eed103f052d6185 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 16 Aug 2014 16:38:32 +0200 Subject: [PATCH 154/259] Bringing extractCubicMesh into line with extractMarchingCubesMesh. --- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 15 ++++++++++----- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 69fb80f2..4996d79d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -188,13 +188,18 @@ namespace PolyVox typename VolumeType::VoxelType m_tBorderValue; }; - template, typename IndexType = DefaultIndexType > + template > + void extractCubicMesh(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) + { + CubicSurfaceExtractor extractor(volData, region, result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + extractor.execute(); + } + + template > Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) { - typedef Mesh, IndexType > MeshType; - MeshType result; - CubicSurfaceExtractor extractor(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); - extractor.execute(); + Mesh< CubicVertex > result; + extractCubicMesh(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); return result; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 61909a41..3439e003 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -345,7 +345,7 @@ namespace PolyVox template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename ControllerType::DensityType doNotUseThisParameter = typename ControllerType::DensityType()) { - Mesh, DefaultIndexType > result; + Mesh > result; extractMarchingCubesMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } From 5c30aa20f90db3d7b75ffc3c1c5798c4059293c3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 17 Aug 2014 15:45:23 +0200 Subject: [PATCH 155/259] Working on new tests for extractCubicSurface(). --- tests/TestCubicSurfaceExtractor.cpp | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 8476b7f8..77fffbb1 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -121,6 +121,43 @@ uint32_t testForType(void) return uTotalVertices + uTotalIndices; } +// Runs the surface extractor for a given type. +template +SimpleVolume* createAndFillVolumeWithNoise(VoxelType maxVoxelValue) +{ + const int32_t uVolumeSideLength = 64; + + //Create empty volume + SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), 32); + + srand(12345); + + //Fill the volume with data + for (int32_t z = 0; z < uVolumeSideLength; z++) + { + for (int32_t y = 0; y < uVolumeSideLength; y++) + { + for (int32_t x = 0; x < uVolumeSideLength; x++) + { + if (maxVoxelValue == 0) + { + // This test case is currently only dealing with unsigned voxel, so if + // the max requested voxel value is zero then every voxel should be zero + volData->setVoxelAt(x, y, z, VoxelType(0)); + } + else + { + // Otherwise we write random voxel values between zero and the requested maximum + int voxelValue = rand() % (maxVoxelValue + 1); + volData->setVoxelAt(x, y, z, static_cast(voxelValue)); + } + } + } + } + + return volData; +} + void TestCubicSurfaceExtractor::testExecute() { /*const static uint32_t uExpectedVertices = 6624; @@ -184,6 +221,12 @@ void TestCubicSurfaceExtractor::testExecute() result = testForType(); } QCOMPARE(result, uExpectedSumOfVerticesAndIndices); + + auto volData = createAndFillVolumeWithNoise(2); + auto mesh = extractCubicMesh(volData, volData->getEnclosingRegion()); + QCOMPARE(mesh.getNoOfVertices(), uint32_t(451651)); + QCOMPARE(mesh.getNoOfIndices(), uint32_t(1715934)); + } QTEST_MAIN(TestCubicSurfaceExtractor) From ba6685289de8a14373995599099269a93c8f59c2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 17 Aug 2014 23:43:59 +0200 Subject: [PATCH 156/259] Work on cubic extractor interface. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 10 ++-- .../PolyVoxCore/CubicSurfaceExtractor.inl | 2 +- tests/TestCubicSurfaceExtractor.cpp | 60 +++++++++++++++---- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 4996d79d..586f85d3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -147,7 +147,7 @@ namespace PolyVox }; public: - CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()); + CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true); void execute(); @@ -189,17 +189,17 @@ namespace PolyVox }; template > - void extractCubicMesh(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) + void extractCubicProvidedMesh(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { - CubicSurfaceExtractor extractor(volData, region, result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + CubicSurfaceExtractor extractor(volData, region, result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); extractor.execute(); } template > - Mesh > extractCubicMesh(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded()) + Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { Mesh< CubicVertex > result; - extractCubicMesh(volData, region, &result, eWrapMode, tBorderValue, bMergeQuads, isQuadNeeded); + extractCubicProvidedMesh(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); return result; } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index 6ebec5ef..edf8ea7a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -36,7 +36,7 @@ namespace PolyVox const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded) + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads) :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 77fffbb1..9f8027bf 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -33,6 +33,26 @@ freely, subject to the following restrictions: using namespace PolyVox; +template +class CustomIsQuadNeeded +{ +public: + typedef _VoxelType VoxelType; + + bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) + { + if ((back > 0) && (front == 0)) + { + materialToUse = static_cast(back); + return true; + } + else + { + return false; + } + } +}; + // These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. // They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part @@ -123,12 +143,12 @@ uint32_t testForType(void) // Runs the surface extractor for a given type. template -SimpleVolume* createAndFillVolumeWithNoise(VoxelType maxVoxelValue) +SimpleVolume* createAndFillVolumeWithNoise(VoxelType minValue, VoxelType maxValue) { - const int32_t uVolumeSideLength = 64; + const int32_t uVolumeSideLength = 32; //Create empty volume - SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), 32); + SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), 16); srand(12345); @@ -139,16 +159,15 @@ SimpleVolume* createAndFillVolumeWithNoise(VoxelType maxVoxelValue) { for (int32_t x = 0; x < uVolumeSideLength; x++) { - if (maxVoxelValue == 0) + if (minValue == maxValue) { - // This test case is currently only dealing with unsigned voxel, so if - // the max requested voxel value is zero then every voxel should be zero - volData->setVoxelAt(x, y, z, VoxelType(0)); + // In this case we are filling the whole volume with a single value. + volData->setVoxelAt(x, y, z, minValue); } else { // Otherwise we write random voxel values between zero and the requested maximum - int voxelValue = rand() % (maxVoxelValue + 1); + int voxelValue = (rand() % (maxValue - minValue + 1)) + minValue; volData->setVoxelAt(x, y, z, static_cast(voxelValue)); } } @@ -222,10 +241,27 @@ void TestCubicSurfaceExtractor::testExecute() } QCOMPARE(result, uExpectedSumOfVerticesAndIndices); - auto volData = createAndFillVolumeWithNoise(2); - auto mesh = extractCubicMesh(volData, volData->getEnclosingRegion()); - QCOMPARE(mesh.getNoOfVertices(), uint32_t(451651)); - QCOMPARE(mesh.getNoOfIndices(), uint32_t(1715934)); + auto uint8Vol = createAndFillVolumeWithNoise(0, 2); + auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); + QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687)); + QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234)); + + auto int8Vol = createAndFillVolumeWithNoise(0, 2); + auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), DefaultIsQuadNeeded()); + QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(57687)); + QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(216234)); + + auto uint32Vol = createAndFillVolumeWithNoise(0, 2); + Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; + extractCubicProvidedMesh(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); + QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); + QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); + + auto int32Vol = createAndFillVolumeWithNoise(0, 2); + Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; + extractCubicProvidedMesh(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, DefaultIsQuadNeeded()); + QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(57687)); + QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(216234)); } From 3c82652f46be56f4a52b9d0d8c3cf7a6c7b1a370 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 15:38:18 +0200 Subject: [PATCH 157/259] Removed the use of clever SFINAE tricks to resolve ambiguous functions. It was proving complex with the cubic surface extractor, so we remove it from the marching cubes version as well. For now, we just rename the ambiguous functions differently to avoid the ambiguity but could come back to this in the future. --- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 10 +++------- tests/TestSurfaceExtractor.cpp | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 3439e003..5faab2f3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -331,22 +331,18 @@ namespace PolyVox // Note: This function is called 'extractMarchingCubesCustomMesh' rather than 'extractMarchingCubesMesh' to avoid ambiguity when only three parameters // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. - // - // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. template< typename VolumeType, typename MeshType, typename ControllerType = DefaultMarchingCubesController > - void extractMarchingCubesMesh(VolumeType* volData, Region region, MeshType* result, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename MeshType::VertexType doNotUseThisParameter = typename MeshType::VertexType()) + void extractMarchingCubesMeshCustom(VolumeType* volData, Region region, MeshType* result, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { MarchingCubesSurfaceExtractor extractor(volData, region, result, controller, eWrapMode, tBorderValue); extractor.execute(); } - // This version of the function is easier to use - it automatically creates and returns a mesh of the appropriate type so the user doesn't have to worry about it. - // Note: the last parameter is a dummy, which is used to avoid ambiguities between which version of the function to call by using SFINAE. template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), typename ControllerType::DensityType doNotUseThisParameter = typename ControllerType::DensityType()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { Mesh > result; - extractMarchingCubesMesh, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); + extractMarchingCubesMeshCustom, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 6c665372..7c0e6ddb 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -152,7 +152,7 @@ void TestSurfaceExtractor::testExecute() // use a default for the second-to-last parameter but noot use a default for the last parameter. auto intVol = createAndFillVolume(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; - extractMarchingCubesMesh(intVol, intVol->getEnclosingRegion(), &intMesh); + extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices @@ -162,7 +162,7 @@ void TestSurfaceExtractor::testExecute() auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; - extractMarchingCubesMesh(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); + extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices From be47aec7f76e6a0446ce358faa7d066ba9f05ca6 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 15:47:00 +0200 Subject: [PATCH 158/259] Work on cubic extractor tests. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 4 ++-- tests/TestCubicSurfaceExtractor.cpp | 22 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 586f85d3..45035247 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -189,7 +189,7 @@ namespace PolyVox }; template > - void extractCubicProvidedMesh(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + void extractCubicMeshCustom(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { CubicSurfaceExtractor extractor(volData, region, result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); extractor.execute(); @@ -199,7 +199,7 @@ namespace PolyVox Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { Mesh< CubicVertex > result; - extractCubicProvidedMesh(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); + extractCubicMeshCustom(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); return result; } } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 9f8027bf..cbff3e62 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -41,7 +41,9 @@ public: bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) { - if ((back > 0) && (front == 0)) + // Not a useful test - it just does something different + // to the DefaultIsQuadNeeded so we can check it compiles. + if ((back > 1) && (front <= 1)) { materialToUse = static_cast(back); return true; @@ -241,27 +243,31 @@ void TestCubicSurfaceExtractor::testExecute() } QCOMPARE(result, uExpectedSumOfVerticesAndIndices); + // Test with default mesh and contoller types. auto uint8Vol = createAndFillVolumeWithNoise(0, 2); auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687)); QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234)); + // Test with default mesh type but user-provided controller. auto int8Vol = createAndFillVolumeWithNoise(0, 2); - auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), DefaultIsQuadNeeded()); - QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(57687)); - QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(216234)); + auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded()); + QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29027)); + QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178356)); + // Test with default controller but user-provided mesh. auto uint32Vol = createAndFillVolumeWithNoise(0, 2); Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; - extractCubicProvidedMesh(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); + extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); + // Test with both mesh and controller being provided by the user. auto int32Vol = createAndFillVolumeWithNoise(0, 2); Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; - extractCubicProvidedMesh(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, DefaultIsQuadNeeded()); - QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(57687)); - QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(216234)); + extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); + QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); + QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178356)); } From 5e7c4fbc1229672d968b5b204d1e187a39658d86 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:01:31 +0200 Subject: [PATCH 159/259] Added handy type aliases for meshes. --- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 8 ++++++-- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 10 +++++++--- tests/TestCubicSurfaceExtractor.cpp | 4 ++-- tests/TestSurfaceExtractor.cpp | 7 +++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 45035247..b24ff159 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -53,6 +53,10 @@ namespace PolyVox DataType data; }; + // Convienient shorthand for declaring a mesh of 'cubic' vertices + template + using CubicMesh = Mesh< CubicVertex, IndexType >; + /// Decodes a position from a CubicVertex inline Vector3DFloat decodePosition(const Vector3DUint8& encodedPosition) { @@ -196,9 +200,9 @@ namespace PolyVox } template > - Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + CubicMesh extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { - Mesh< CubicVertex > result; + CubicMesh result; extractCubicMeshCustom(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 5faab2f3..9f722098 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -55,6 +55,10 @@ namespace PolyVox DataType data; }; + // Convienient shorthand for declaring a mesh of marching cubes vertices + template + using MarchingCubesMesh = Mesh< MarchingCubesVertex, IndexType >; + /// Decodes a position from a MarchingCubesVertex inline Vector3DFloat decodePosition(const Vector3DUint16& encodedPosition) { @@ -339,10 +343,10 @@ namespace PolyVox } template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > - Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + MarchingCubesMesh extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { - Mesh > result; - extractMarchingCubesMeshCustom, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); + MarchingCubesMesh result; + extractMarchingCubesMeshCustom(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index cbff3e62..4bafb89c 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -257,14 +257,14 @@ void TestCubicSurfaceExtractor::testExecute() // Test with default controller but user-provided mesh. auto uint32Vol = createAndFillVolumeWithNoise(0, 2); - Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; + CubicMesh< uint32_t, uint16_t > uint32Mesh; extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); // Test with both mesh and controller being provided by the user. auto int32Vol = createAndFillVolumeWithNoise(0, 2); - Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; + CubicMesh< int32_t, uint16_t > int32Mesh; extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178356)); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 7c0e6ddb..8434be94 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -148,10 +148,9 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type - // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us - // use a default for the second-to-last parameter but noot use a default for the last parameter. + // This test makes use of a user provided mesh, while stil using the default controller. auto intVol = createAndFillVolume(); - Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; + MarchingCubesMesh< int8_t, uint16_t > intMesh; extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh @@ -161,7 +160,7 @@ void TestSurfaceExtractor::testExecute() // This test makes use of a user-provided mesh and also a custom controller. auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; - Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; + MarchingCubesMesh< double, uint16_t > doubleMesh; extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh From 502b21c3bd8ef958288e37776b27ce1c6d703e3b Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:13:59 +0200 Subject: [PATCH 160/259] Moved comments around. --- .../PolyVoxCore/CubicSurfaceExtractor.h | 98 +++++++++++-------- .../MarchingCubesSurfaceExtractor.h | 3 +- 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index b24ff159..ee100097 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -75,48 +75,8 @@ namespace PolyVox result.data = cubicVertex.data; // Data is not encoded return result; } - - /// The CubicSurfaceExtractor creates a mesh in which each voxel appears to be rendered as a cube - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Introduction - /// ------------ - /// Games such as Minecraft and Voxatron have a unique graphical style in which each voxel in the world appears to be rendered as a single cube. Actually rendering a cube for each voxel would be very expensive, but in practice the only faces which need to be drawn are those which lie on the boundary between solid and empty voxels. The CubicSurfaceExtractor can be used to create such a mesh from PolyVox volume data. As an example, images from Minecraft and Voxatron are shown below: - /// - /// \image html MinecraftAndVoxatron.jpg - /// - /// Before we get into the specifics of the CubicSurfaceExtractor, it is useful to understand the principles which apply to *all* PolyVox surface extractors and which are described in the Surface Extraction document (ADD LINK). From here on, it is assumed that you are familier with PolyVox regions and how they are used to limit surface extraction to a particular part of the volume. The principles of allowing dynamic terrain are also common to all surface extractors and are described here (ADD LINK). - /// - /// Basic Operation - /// --------------- - /// At its core, the CubicSurfaceExtractor works by by looking at pairs of adjacent voxels and determining whether a quad should be placed between then. The most simple situation to imagine is a binary volume where every voxel is either solid or empty. In this case a quad should be generated whenever a solid voxel is next to an empty voxel as this represents part of the surface of the solid object. There is no need to generate a quad between two solid voxels (this quad would never be seen as it is inside the object) and there is no need to generate a quad between two empty voxels (there is no object here). PolyVox allows the principle to be extended far beyond such simple binary volumes but they provide a useful starting point for understanding how the algorithm works. - /// - /// As an example, lets consider the part of a volume shown below. We are going to explain the principles in only two dimensions as this makes it much simpler to illustrate, so you will need to mentally extend the process into the third dimension. Hopefully you will find this intuitive. The diagram below shows a small part of a larger volume (as indicated by the voxel coordinates on the axes) which contains only solid and empty voxels represented by solid and hollow circles respectively. The region on which we are running the surface extractor is marked in pink, and for the purpose of this example it corresponds to the whole of the diagram. - /// - /// \image html CubicSurfaceExtractor1.png - /// - /// The output of the surface extractor is the mesh marked in red. As you can see, this forms a closed object which corrsponds to the shape of the underlying voxel data. We won't describe the rendering of such meshes here - for details of this please see (SOME LINK HERE). - /// - /// Working with Regions - /// -------------------- - /// So far the behaviour is easy to understand, but let's look at what happens when the extraction is limited to a particular region of the volume. The figure below shows the same data set as the previous figure, but the extraction region (still marked in pink) has been limited to 13 to 16 in x and 47 to 51 in y: - /// - /// \image html CubicSurfaceExtractor2.png - /// - /// As you can see, the extractor continues to generate a number of quads as indicated by the solid red lines. However, you can also see that the shape is no longer closed. This is because the solid voxels actually extend outside the region which is being processed, and so the extractor does not encounter a boundary between solid and empty voxels. Although this may initially appear problematic, the hole in the mesh does not actually matter because it will be hidden by the mesh corresponding to the region adjacent to it (see next diagram). - /// - /// More interestingly, the diagram also contains a couple of dotted red lines lying on the bottom and right hand side of the extracted region. These are present to illustrate a common point of confusion, which is that *no quads are generated at this position even though it is a boundary between solid and empty voxels*. This is indeed somewhat counter intuitive but there is a rational reasaoning behind it. - /// If you consider the dashed line on the righthand side of the extracted region, then it is clear that this lies on a boundary between solid and empty voxels and so we do need to create quads here. But what is not so clear is whether these quads should be assigned to the mesh which corresponds to the region in pink, or whether they should be assigned to the region to the right of it which is marked in blue in the diagram below: - /// - /// \image html CubicSurfaceExtractor3.png - /// - /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent block from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). - /// - /// **Note:** *This behaviour has changed recently (September 2012). Earlier versions of PolyVox tried to be smart about this problem by looking beyond the region which was being processed, but this complicated the code and didn't work very well. Ultimatly we decided to simply stick with the convention outlined above.* - /// - /// One of the practical implications of this is that when you modify a voxel *you may have to re-extract the mesh for regions other than region which actually contains the voxel you modified.* This happens when the voxel lies on the upper x,y or z face of a region. Assuming that you have some management code which can mark a region as needing re-extraction when a voxel changes, you should probably extend this to mark the regions of neighbouring voxels as invalid (this will have no effect when the voxel is well within a region, but will mark the neighbouring region as needing an update if the voxel lies on a region face). - /// - /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /// Do not use this class directly. Use the 'extractCubicSurface' function instead (see examples). template class CubicSurfaceExtractor { @@ -192,6 +152,19 @@ namespace PolyVox typename VolumeType::VoxelType m_tBorderValue; }; + // This version of the function performs the extraction into a user-provided mesh rather than allocating a mesh automatically. + // There are a few reasons why this might be useful to more advanced users: + // + // 1. It leaves the user in control of memory allocation and would allow them to implement e.g. a mesh pooling system. + // 2. The user-provided mesh could have a different index type (e.g. 16-bit indices) to reduce memory usage. + // 3. The user could provide a custom mesh class, e.g a thin wrapper around an openGL VBO to allow direct writing into this structure. + // + // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes + // more sense to use the other variant of this function where the mesh is a return value rather than a parameter. + // + // Note: This function is called 'extractCubicMeshCustom' rather than 'extractCubicMesh' to avoid ambiguity when only three parameters + // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, + // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. template > void extractCubicMeshCustom(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { @@ -199,6 +172,47 @@ namespace PolyVox extractor.execute(); } + /// The CubicSurfaceExtractor creates a mesh in which each voxel appears to be rendered as a cube + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Introduction + /// ------------ + /// Games such as Minecraft and Voxatron have a unique graphical style in which each voxel in the world appears to be rendered as a single cube. Actually rendering a cube for each voxel would be very expensive, but in practice the only faces which need to be drawn are those which lie on the boundary between solid and empty voxels. The CubicSurfaceExtractor can be used to create such a mesh from PolyVox volume data. As an example, images from Minecraft and Voxatron are shown below: + /// + /// \image html MinecraftAndVoxatron.jpg + /// + /// Before we get into the specifics of the CubicSurfaceExtractor, it is useful to understand the principles which apply to *all* PolyVox surface extractors and which are described in the Surface Extraction document (ADD LINK). From here on, it is assumed that you are familier with PolyVox regions and how they are used to limit surface extraction to a particular part of the volume. The principles of allowing dynamic terrain are also common to all surface extractors and are described here (ADD LINK). + /// + /// Basic Operation + /// --------------- + /// At its core, the CubicSurfaceExtractor works by by looking at pairs of adjacent voxels and determining whether a quad should be placed between then. The most simple situation to imagine is a binary volume where every voxel is either solid or empty. In this case a quad should be generated whenever a solid voxel is next to an empty voxel as this represents part of the surface of the solid object. There is no need to generate a quad between two solid voxels (this quad would never be seen as it is inside the object) and there is no need to generate a quad between two empty voxels (there is no object here). PolyVox allows the principle to be extended far beyond such simple binary volumes but they provide a useful starting point for understanding how the algorithm works. + /// + /// As an example, lets consider the part of a volume shown below. We are going to explain the principles in only two dimensions as this makes it much simpler to illustrate, so you will need to mentally extend the process into the third dimension. Hopefully you will find this intuitive. The diagram below shows a small part of a larger volume (as indicated by the voxel coordinates on the axes) which contains only solid and empty voxels represented by solid and hollow circles respectively. The region on which we are running the surface extractor is marked in pink, and for the purpose of this example it corresponds to the whole of the diagram. + /// + /// \image html CubicSurfaceExtractor1.png + /// + /// The output of the surface extractor is the mesh marked in red. As you can see, this forms a closed object which corrsponds to the shape of the underlying voxel data. We won't describe the rendering of such meshes here - for details of this please see (SOME LINK HERE). + /// + /// Working with Regions + /// -------------------- + /// So far the behaviour is easy to understand, but let's look at what happens when the extraction is limited to a particular region of the volume. The figure below shows the same data set as the previous figure, but the extraction region (still marked in pink) has been limited to 13 to 16 in x and 47 to 51 in y: + /// + /// \image html CubicSurfaceExtractor2.png + /// + /// As you can see, the extractor continues to generate a number of quads as indicated by the solid red lines. However, you can also see that the shape is no longer closed. This is because the solid voxels actually extend outside the region which is being processed, and so the extractor does not encounter a boundary between solid and empty voxels. Although this may initially appear problematic, the hole in the mesh does not actually matter because it will be hidden by the mesh corresponding to the region adjacent to it (see next diagram). + /// + /// More interestingly, the diagram also contains a couple of dotted red lines lying on the bottom and right hand side of the extracted region. These are present to illustrate a common point of confusion, which is that *no quads are generated at this position even though it is a boundary between solid and empty voxels*. This is indeed somewhat counter intuitive but there is a rational reasaoning behind it. + /// If you consider the dashed line on the righthand side of the extracted region, then it is clear that this lies on a boundary between solid and empty voxels and so we do need to create quads here. But what is not so clear is whether these quads should be assigned to the mesh which corresponds to the region in pink, or whether they should be assigned to the region to the right of it which is marked in blue in the diagram below: + /// + /// \image html CubicSurfaceExtractor3.png + /// + /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent block from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). + /// + /// **Note:** *This behaviour has changed recently (September 2012). Earlier versions of PolyVox tried to be smart about this problem by looking beyond the region which was being processed, but this complicated the code and didn't work very well. Ultimatly we decided to simply stick with the convention outlined above.* + /// + /// One of the practical implications of this is that when you modify a voxel *you may have to re-extract the mesh for regions other than region which actually contains the voxel you modified.* This happens when the voxel lies on the upper x,y or z face of a region. Assuming that you have some management code which can mark a region as needing re-extraction when a voxel changes, you should probably extend this to mark the regions of neighbouring voxels as invalid (this will have no effect when the voxel is well within a region, but will mark the neighbouring region as needing an update if the voxel lies on a region face). + /// + /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template > CubicMesh extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 9f722098..0612a33f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -151,6 +151,7 @@ namespace PolyVox return result; } + /// Do not use this class directly. Use the 'extractMarchingCubesSurface' function instead (see examples). template< typename VolumeType, typename MeshType, typename ControllerType> class MarchingCubesSurfaceExtractor { @@ -332,7 +333,7 @@ namespace PolyVox // We don't provide a default MeshType here. If the user doesn't want to provide a MeshType then it probably makes // more sense to use the other variant of this function where the mesh is a return value rather than a parameter. // - // Note: This function is called 'extractMarchingCubesCustomMesh' rather than 'extractMarchingCubesMesh' to avoid ambiguity when only three parameters + // Note: This function is called 'extractMarchingCubesMeshCustom' rather than 'extractMarchingCubesMesh' to avoid ambiguity when only three parameters // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. template< typename VolumeType, typename MeshType, typename ControllerType = DefaultMarchingCubesController > From 0863d820685a5f110761e77da00d617517782592 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:20:43 +0200 Subject: [PATCH 161/259] Added check to alert the user if their version of Visual Studio is too old. --- library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 1069a791..f9ac641e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -24,6 +24,10 @@ freely, subject to the following restrictions: #ifndef __PolyVox_TypeDef_H__ #define __PolyVox_TypeDef_H__ +#if defined(_MSC_VER) && (_MSC_VER < 1800) +#error "Your version of Visual Studio is too old to build PolyVox. You need at least version Visual Stusio 2013" +#endif + //Definitions needed to make library functions accessable // See http://gcc.gnu.org/wiki/Visibility for more info. #if defined _WIN32 || defined __CYGWIN__ From 4b3b940b910d4e37d4698cf577d1417ed1164a0a Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:29:08 +0200 Subject: [PATCH 162/259] Removed old testing code. --- tests/TestCubicSurfaceExtractor.cpp | 157 ++-------------------------- 1 file changed, 8 insertions(+), 149 deletions(-) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 4bafb89c..c8283af4 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -55,94 +55,6 @@ public: } }; - -// These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. -// They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part -// of PolyVox, but they might be useful to other tests so we cold move them into a 'Tests.h' or something in the future. -template -void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) -{ - voxel = valueToWrite; -} - -template<> -void writeDensityValueToVoxel(int valueToWrite, Density8& voxel) -{ - voxel.setDensity(valueToWrite); -} - -template<> -void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setDensity(valueToWrite); -} - -template -void writeMaterialValueToVoxel(int valueToWrite, VoxelType& voxel) -{ - //Most types don't have a material - return; -} - -template<> -void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setMaterial(valueToWrite); -} - -// Runs the surface extractor for a given type. -template -uint32_t testForType(void) -{ - const int32_t uVolumeSideLength = 256; - - //Create empty volume - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1)), 128); - - //Fill the volume with data - for (int32_t z = 0; z < uVolumeSideLength; z++) - { - for (int32_t y = 0; y < uVolumeSideLength; y++) - { - for (int32_t x = 0; x < uVolumeSideLength; x++) - { - if(x + y + z > uVolumeSideLength) - { - VoxelType voxelValue; - writeDensityValueToVoxel(100, voxelValue); - writeMaterialValueToVoxel(42, voxelValue); - volData.setVoxelAt(x, y, z, voxelValue); - } - } - } - } - - uint32_t uTotalVertices = 0; - uint32_t uTotalIndices = 0; - - //Run the surface extractor a number of times over differnt regions of the volume. - const int32_t uRegionSideLength = 64; - for (int32_t z = 0; z < uVolumeSideLength; z += uRegionSideLength) - { - for (int32_t y = 0; y < uVolumeSideLength; y += uRegionSideLength) - { - for (int32_t x = 0; x < uVolumeSideLength; x += uRegionSideLength) - { - Region regionToExtract(x, y, z, x + uRegionSideLength - 1, y + uRegionSideLength - 1, z + uRegionSideLength - 1); - - auto result = extractCubicMesh(&volData, regionToExtract); - - uTotalVertices += result.getNoOfVertices(); - uTotalIndices += result.getNoOfIndices(); - } - } - } - - // Just some value which is representative of the work we've done. It doesn't - // matter what it is, just that it should be the same every time we run the test. - return uTotalVertices + uTotalIndices; -} - // Runs the surface extractor for a given type. template SimpleVolume* createAndFillVolumeWithNoise(VoxelType minValue, VoxelType maxValue) @@ -181,67 +93,7 @@ SimpleVolume* createAndFillVolumeWithNoise(VoxelType minValue, VoxelT void TestCubicSurfaceExtractor::testExecute() { - /*const static uint32_t uExpectedVertices = 6624; - const static uint32_t uExpectedIndices = 9936; - const static uint32_t uMaterialToCheck = 3000; - const static float fExpectedMaterial = 42.0f; - const static uint32_t uIndexToCheck = 2000; - const static uint32_t uExpectedIndex = 1334; - - Mesh mesh;*/ - - /*testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial); - - testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial);*/ - - /*testForType(mesh); - QCOMPARE(mesh.getNoOfVertices(), uExpectedVertices); - QCOMPARE(mesh.getNoOfIndices(), uExpectedIndices); - QCOMPARE(mesh.getVertices()[uMaterialToCheck].getMaterial(), fNoMaterial);*/ - - const static uint32_t uExpectedSumOfVerticesAndIndices = 704668; - //const static uint32_t uExpectedSumOfVerticesAndIndices = 2792332; - uint32_t result = 0; - QBENCHMARK { - result = testForType(); - } - QCOMPARE(result, uExpectedSumOfVerticesAndIndices); + // Behavioural tests // Test with default mesh and contoller types. auto uint8Vol = createAndFillVolumeWithNoise(0, 2); @@ -269,6 +121,13 @@ void TestCubicSurfaceExtractor::testExecute() QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178356)); + // Performance tests + + auto emptyVol = createAndFillVolumeWithNoise(0, 0); + CubicMesh< uint32_t, uint16_t > emptyMesh; + QBENCHMARK{ extractCubicMeshCustom(emptyVol, emptyVol->getEnclosingRegion(), &emptyMesh); } + QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); + } QTEST_MAIN(TestCubicSurfaceExtractor) From ec9b06ef0f8460208dbf5b565f320319c77f95c3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:40:36 +0200 Subject: [PATCH 163/259] Work on cubic surface extractor tests. --- tests/TestCubicSurfaceExtractor.cpp | 38 ++++++++++++++++------------- tests/TestCubicSurfaceExtractor.h | 4 ++- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index c8283af4..6acd3222 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -57,21 +57,19 @@ public: // Runs the surface extractor for a given type. template -SimpleVolume* createAndFillVolumeWithNoise(VoxelType minValue, VoxelType maxValue) +SimpleVolume* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, VoxelType minValue, VoxelType maxValue) { - const int32_t uVolumeSideLength = 32; - //Create empty volume - SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), 16); + SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), 32); srand(12345); //Fill the volume with data - for (int32_t z = 0; z < uVolumeSideLength; z++) + for (int32_t z = 0; z < iVolumeSideLength; z++) { - for (int32_t y = 0; y < uVolumeSideLength; y++) + for (int32_t y = 0; y < iVolumeSideLength; y++) { - for (int32_t x = 0; x < uVolumeSideLength; x++) + for (int32_t x = 0; x < iVolumeSideLength; x++) { if (minValue == maxValue) { @@ -91,43 +89,49 @@ SimpleVolume* createAndFillVolumeWithNoise(VoxelType minValue, VoxelT return volData; } -void TestCubicSurfaceExtractor::testExecute() +void TestCubicSurfaceExtractor::testBehaviour() { - // Behavioural tests - // Test with default mesh and contoller types. - auto uint8Vol = createAndFillVolumeWithNoise(0, 2); + auto uint8Vol = createAndFillVolumeWithNoise(32, 0, 2); auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687)); QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234)); // Test with default mesh type but user-provided controller. - auto int8Vol = createAndFillVolumeWithNoise(0, 2); + auto int8Vol = createAndFillVolumeWithNoise(32, 0, 2); auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded()); QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29027)); QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178356)); // Test with default controller but user-provided mesh. - auto uint32Vol = createAndFillVolumeWithNoise(0, 2); + auto uint32Vol = createAndFillVolumeWithNoise(32, 0, 2); CubicMesh< uint32_t, uint16_t > uint32Mesh; extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); // Test with both mesh and controller being provided by the user. - auto int32Vol = createAndFillVolumeWithNoise(0, 2); + auto int32Vol = createAndFillVolumeWithNoise(32, 0, 2); CubicMesh< int32_t, uint16_t > int32Mesh; extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178356)); +} - // Performance tests - - auto emptyVol = createAndFillVolumeWithNoise(0, 0); +void TestCubicSurfaceExtractor::testEmptyVolumePerformance() +{ + auto emptyVol = createAndFillVolumeWithNoise(32, 0, 0); CubicMesh< uint32_t, uint16_t > emptyMesh; QBENCHMARK{ extractCubicMeshCustom(emptyVol, emptyVol->getEnclosingRegion(), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); +} +void TestCubicSurfaceExtractor::testNoiseVolumePerformance() +{ + auto noiseVol = createAndFillVolumeWithNoise(32, 0, 1); + CubicMesh< uint32_t, uint16_t > noiseMesh; + QBENCHMARK{ extractCubicMeshCustom(noiseVol, noiseVol->getEnclosingRegion(), &noiseMesh); } + QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(28429)); } QTEST_MAIN(TestCubicSurfaceExtractor) diff --git a/tests/TestCubicSurfaceExtractor.h b/tests/TestCubicSurfaceExtractor.h index 1ea815d8..15e0da5f 100644 --- a/tests/TestCubicSurfaceExtractor.h +++ b/tests/TestCubicSurfaceExtractor.h @@ -31,7 +31,9 @@ class TestCubicSurfaceExtractor: public QObject Q_OBJECT private slots: - void testExecute(); + void testBehaviour(); + void testEmptyVolumePerformance(); + void testNoiseVolumePerformance(); }; #endif From c0added385021d1a2f31f45372fee04a73d27fe2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 16:48:32 +0200 Subject: [PATCH 164/259] Work on cubic extractor tests. --- tests/TestCubicSurfaceExtractor.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 6acd3222..33d477e7 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -26,6 +26,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Density.h" #include "PolyVoxCore/Material.h" #include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" #include "PolyVoxCore/CubicSurfaceExtractor.h" @@ -56,11 +57,11 @@ public: }; // Runs the surface extractor for a given type. -template -SimpleVolume* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, VoxelType minValue, VoxelType maxValue) +template +VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename VolumeType::VoxelType minValue, typename VolumeType::VoxelType maxValue) { //Create empty volume - SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), 32); + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); srand(12345); @@ -80,7 +81,7 @@ SimpleVolume* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, { // Otherwise we write random voxel values between zero and the requested maximum int voxelValue = (rand() % (maxValue - minValue + 1)) + minValue; - volData->setVoxelAt(x, y, z, static_cast(voxelValue)); + volData->setVoxelAt(x, y, z, static_cast(voxelValue)); } } } @@ -92,26 +93,26 @@ SimpleVolume* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, void TestCubicSurfaceExtractor::testBehaviour() { // Test with default mesh and contoller types. - auto uint8Vol = createAndFillVolumeWithNoise(32, 0, 2); + auto uint8Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687)); QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234)); // Test with default mesh type but user-provided controller. - auto int8Vol = createAndFillVolumeWithNoise(32, 0, 2); + auto int8Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded()); QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29027)); QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178356)); // Test with default controller but user-provided mesh. - auto uint32Vol = createAndFillVolumeWithNoise(32, 0, 2); + auto uint32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); CubicMesh< uint32_t, uint16_t > uint32Mesh; extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); // Test with both mesh and controller being provided by the user. - auto int32Vol = createAndFillVolumeWithNoise(32, 0, 2); + auto int32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); CubicMesh< int32_t, uint16_t > int32Mesh; extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); @@ -120,7 +121,7 @@ void TestCubicSurfaceExtractor::testBehaviour() void TestCubicSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise(32, 0, 0); + auto emptyVol = createAndFillVolumeWithNoise< RawVolume >(32, 0, 0); CubicMesh< uint32_t, uint16_t > emptyMesh; QBENCHMARK{ extractCubicMeshCustom(emptyVol, emptyVol->getEnclosingRegion(), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); @@ -128,7 +129,7 @@ void TestCubicSurfaceExtractor::testEmptyVolumePerformance() void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise(32, 0, 1); + auto noiseVol = createAndFillVolumeWithNoise< RawVolume >(32, 0, 1); CubicMesh< uint32_t, uint16_t > noiseMesh; QBENCHMARK{ extractCubicMeshCustom(noiseVol, noiseVol->getEnclosingRegion(), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(28429)); From e2051ed71314368a7f3e141dd565f3dd42b2a9c2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 21:25:29 +0200 Subject: [PATCH 165/259] Tweaks to cubic surface tests. --- tests/TestCubicSurfaceExtractor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 33d477e7..ccc47a22 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -121,18 +121,18 @@ void TestCubicSurfaceExtractor::testBehaviour() void TestCubicSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise< RawVolume >(32, 0, 0); + auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 0); CubicMesh< uint32_t, uint16_t > emptyMesh; - QBENCHMARK{ extractCubicMeshCustom(emptyVol, emptyVol->getEnclosingRegion(), &emptyMesh); } + QBENCHMARK{ extractCubicMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); } void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise< RawVolume >(32, 0, 1); + auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 2); CubicMesh< uint32_t, uint16_t > noiseMesh; - QBENCHMARK{ extractCubicMeshCustom(noiseVol, noiseVol->getEnclosingRegion(), &noiseMesh); } - QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(28429)); + QBENCHMARK{ extractCubicMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } + QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(57729)); } QTEST_MAIN(TestCubicSurfaceExtractor) From c75b0d58ce96e310ca10435d251cc4ed2a657ff0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 22:06:44 +0200 Subject: [PATCH 166/259] Fixed incorrect threshold calculation for floats. --- .../PolyVoxCore/DefaultMarchingCubesController.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 6a7aaa22..2d1b6144 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -75,8 +75,15 @@ namespace PolyVox * if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. */ DefaultMarchingCubesController(void) - :m_tThreshold(((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2) - { + { + if (std::is_signed()) + { + m_tThreshold = DensityType(0); + } + else + { + m_tThreshold = (((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2); + } } /** From 72f696652a32d4a016f8aba092e8a05d569368d2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 18 Aug 2014 22:10:35 +0200 Subject: [PATCH 167/259] Added marching cubes performance tests. --- tests/TestCubicSurfaceExtractor.cpp | 1 + tests/TestSurfaceExtractor.cpp | 52 ++++++++++++++++++++++++++++- tests/TestSurfaceExtractor.h | 4 ++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index ccc47a22..fe4da9e1 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -63,6 +63,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol //Create empty volume VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); + // Seed generator for consistency between runs. srand(12345); //Fill the volume with data diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 8434be94..f1005ae5 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -122,7 +122,41 @@ SimpleVolume* createAndFillVolume(void) return volData; } -void TestSurfaceExtractor::testExecute() +// From http://stackoverflow.com/a/5289624 +float randomFloat(float a, float b) +{ + float random = ((float)rand()) / (float)RAND_MAX; + float diff = b - a; + float r = random * diff; + return a + r; +} + +template +VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) +{ + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); + + // Seed generator for consistency between runs. + srand(12345); + + // Fill + for (int32_t z = 0; z < iVolumeSideLength; z++) + { + for (int32_t y = 0; y < iVolumeSideLength; y++) + { + for (int32_t x = 0; x < iVolumeSideLength; x++) + { + float voxelValue = randomFloat(minValue, maxValue); + volData->setVoxelAt(x, y, z, voxelValue); + } + } + } + + return volData; +} + +void TestSurfaceExtractor::testBehaviour() { // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers // and user-provided meshes to make sure these various combinations work as expected. @@ -176,4 +210,20 @@ void TestSurfaceExtractor::testExecute() QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex } +void TestSurfaceExtractor::testEmptyVolumePerformance() +{ + auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -2.0f, -1.0f); + MarchingCubesMesh< float, uint16_t > emptyMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } + QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); +} + +void TestSurfaceExtractor::testNoiseVolumePerformance() +{ + auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -1.0f, 1.0f); + MarchingCubesMesh< float, uint16_t > noiseMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } + QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); +} + QTEST_MAIN(TestSurfaceExtractor) diff --git a/tests/TestSurfaceExtractor.h b/tests/TestSurfaceExtractor.h index 367d798e..20e5ee45 100644 --- a/tests/TestSurfaceExtractor.h +++ b/tests/TestSurfaceExtractor.h @@ -31,7 +31,9 @@ class TestSurfaceExtractor: public QObject Q_OBJECT private slots: - void testExecute(); + void testBehaviour(); + void testEmptyVolumePerformance(); + void testNoiseVolumePerformance(); }; #endif From 349009c67eec8047461ba5f3e8d3c469d65b76ae Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 19 Aug 2014 21:02:06 +0200 Subject: [PATCH 168/259] Removed template aliases as they push GCC version up to 4.7, and we don't really *need* them. --- .../include/PolyVoxCore/CubicSurfaceExtractor.h | 9 +++++---- .../PolyVoxCore/MarchingCubesSurfaceExtractor.h | 11 ++++++----- tests/TestCubicSurfaceExtractor.cpp | 8 ++++---- tests/TestSurfaceExtractor.cpp | 11 ++++++----- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index ee100097..409ed096 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -54,8 +54,9 @@ namespace PolyVox }; // Convienient shorthand for declaring a mesh of 'cubic' vertices - template - using CubicMesh = Mesh< CubicVertex, IndexType >; + // Currently disabled because it requires GCC 4.7 + //template + //using CubicMesh = Mesh< CubicVertex, IndexType >; /// Decodes a position from a CubicVertex inline Vector3DFloat decodePosition(const Vector3DUint8& encodedPosition) @@ -214,9 +215,9 @@ namespace PolyVox /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template > - CubicMesh extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) { - CubicMesh result; + Mesh< CubicVertex > result; extractCubicMeshCustom(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); return result; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 0612a33f..cf42800e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -56,8 +56,9 @@ namespace PolyVox }; // Convienient shorthand for declaring a mesh of marching cubes vertices - template - using MarchingCubesMesh = Mesh< MarchingCubesVertex, IndexType >; + // Currently disabled because it requires GCC 4.7 + //template + //using MarchingCubesMesh = Mesh< MarchingCubesVertex, IndexType >; /// Decodes a position from a MarchingCubesVertex inline Vector3DFloat decodePosition(const Vector3DUint16& encodedPosition) @@ -344,10 +345,10 @@ namespace PolyVox } template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > - MarchingCubesMesh extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) + Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) { - MarchingCubesMesh result; - extractMarchingCubesMeshCustom(volData, region, &result, controller, eWrapMode, tBorderValue); + Mesh > result; + extractMarchingCubesMeshCustom, DefaultIndexType > >(volData, region, &result, controller, eWrapMode, tBorderValue); return result; } } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index fe4da9e1..ac7ac1b3 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -107,14 +107,14 @@ void TestCubicSurfaceExtractor::testBehaviour() // Test with default controller but user-provided mesh. auto uint32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); - CubicMesh< uint32_t, uint16_t > uint32Mesh; + Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); // Test with both mesh and controller being provided by the user. auto int32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); - CubicMesh< int32_t, uint16_t > int32Mesh; + Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178356)); @@ -123,7 +123,7 @@ void TestCubicSurfaceExtractor::testBehaviour() void TestCubicSurfaceExtractor::testEmptyVolumePerformance() { auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 0); - CubicMesh< uint32_t, uint16_t > emptyMesh; + Mesh< CubicVertex< uint32_t >, uint16_t > emptyMesh; QBENCHMARK{ extractCubicMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); } @@ -131,7 +131,7 @@ void TestCubicSurfaceExtractor::testEmptyVolumePerformance() void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 2); - CubicMesh< uint32_t, uint16_t > noiseMesh; + Mesh< CubicVertex< uint32_t >, uint16_t > noiseMesh; QBENCHMARK{ extractCubicMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(57729)); } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index f1005ae5..95ebb299 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -182,9 +182,10 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type - // This test makes use of a user provided mesh, while stil using the default controller. + // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us + // use a default for the second-to-last parameter but noot use a default for the last parameter. auto intVol = createAndFillVolume(); - MarchingCubesMesh< int8_t, uint16_t > intMesh; + Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh @@ -194,7 +195,7 @@ void TestSurfaceExtractor::testBehaviour() // This test makes use of a user-provided mesh and also a custom controller. auto doubleVol = createAndFillVolume(); CustomMarchingCubesController doubleCustomController; - MarchingCubesMesh< double, uint16_t > doubleMesh; + Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh @@ -213,7 +214,7 @@ void TestSurfaceExtractor::testBehaviour() void TestSurfaceExtractor::testEmptyVolumePerformance() { auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -2.0f, -1.0f); - MarchingCubesMesh< float, uint16_t > emptyMesh; + Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); } @@ -221,7 +222,7 @@ void TestSurfaceExtractor::testEmptyVolumePerformance() void TestSurfaceExtractor::testNoiseVolumePerformance() { auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -1.0f, 1.0f); - MarchingCubesMesh< float, uint16_t > noiseMesh; + Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); } From 9b88e975995ad86f772f27264c76c4d393573627 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 19 Aug 2014 21:02:52 +0200 Subject: [PATCH 169/259] Linux/GCC fix. --- library/PolyVoxCore/include/PolyVoxCore/Mesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 802b0656..4c1b3582 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -81,7 +81,7 @@ namespace PolyVox { Mesh< Vertex< typename MeshType::VertexType::DataType >, typename MeshType::IndexType > decodedMesh; - for (MeshType::IndexType ct = 0; ct < encodedMesh.getNoOfVertices(); ct++) + for (typename MeshType::IndexType ct = 0; ct < encodedMesh.getNoOfVertices(); ct++) { decodedMesh.addVertex(decodeVertex(encodedMesh.getVertex(ct))); } From 17ee7982d56dc641f9131654dbfb42c5d7fc760d Mon Sep 17 00:00:00 2001 From: DavidWilliams Date: Tue, 19 Aug 2014 21:30:37 +0200 Subject: [PATCH 170/259] Added typename for GCC. --- examples/common/OpenGLWidget.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index fb9a7459..5ceb28ae 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -72,29 +72,29 @@ public: // The GL_ARRAY_BUFFER will contain the list of vertex positions glGenBuffers(1, &(meshData.vertexBuffer)); glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(typename MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); // and GL_ELEMENT_ARRAY_BUFFER will contain the indices glGenBuffers(1, &(meshData.indexBuffer)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(MeshType::IndexType), vecIndices.data(), GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(typename MeshType::IndexType), vecIndices.data(), GL_STATIC_DRAW); // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the // shader. This is mostly just to simplify this example code - in a real application you will know whether your // chosen surface extractor generates normals and can skip uploading them if not. glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal))); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, normal))); // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, data))); + GLint size = (std::min)(sizeof(typename MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, data))); // We're done uploading and can now unbind. glBindVertexArray(0); @@ -105,7 +105,7 @@ public: meshData.scale = scale; // Set 16 or 32-bit index buffer size. - meshData.indexType = sizeof(MeshType::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; + meshData.indexType = sizeof(typename MeshType::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; // Now add the mesh to the list of meshes to render. addMeshData(meshData); From 33c5fe752634709b6d94c5265df653ae1c201750 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 19 Aug 2014 21:36:08 +0200 Subject: [PATCH 171/259] More cubic surface extractor tests. --- tests/TestCubicSurfaceExtractor.cpp | 42 +++++++++++++++++++++++++++++ tests/TestCubicSurfaceExtractor.h | 1 + 2 files changed, 43 insertions(+) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index ac7ac1b3..906a2e80 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -91,6 +91,40 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol return volData; } +// Runs the surface extractor for a given type. +template +VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength) +{ + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); + + // Seed generator for consistency between runs. + srand(12345); + + //Fill the volume with data + for (int32_t z = 0; z < iVolumeSideLength; z++) + { + for (int32_t y = 0; y < iVolumeSideLength; y++) + { + for (int32_t x = 0; x < iVolumeSideLength; x++) + { + // Should create a checker board pattern stretched along z? This is 'realistic' in the sense + // that it's not empty/random data, and should allow significant decimation to be performed. + if ((x ^ y) & 0x01) + { + volData->setVoxelAt(x, y, z, 0); + } + else + { + volData->setVoxelAt(x, y, z, 1); + } + } + } + } + + return volData; +} + void TestCubicSurfaceExtractor::testBehaviour() { // Test with default mesh and contoller types. @@ -128,6 +162,14 @@ void TestCubicSurfaceExtractor::testEmptyVolumePerformance() QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); } +void TestCubicSurfaceExtractor::testRealisticVolumePerformance() +{ + auto realisticVol = createAndFillVolumeRealistic< SimpleVolume >(128); + Mesh< CubicVertex< uint32_t >, uint16_t > realisticMesh; + QBENCHMARK{ extractCubicMeshCustom(realisticVol, Region(32, 32, 32, 63, 63, 63), &realisticMesh); } + QCOMPARE(realisticMesh.getNoOfVertices(), uint16_t(2176)); +} + void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 2); diff --git a/tests/TestCubicSurfaceExtractor.h b/tests/TestCubicSurfaceExtractor.h index 15e0da5f..31fb1cc4 100644 --- a/tests/TestCubicSurfaceExtractor.h +++ b/tests/TestCubicSurfaceExtractor.h @@ -33,6 +33,7 @@ class TestCubicSurfaceExtractor: public QObject private slots: void testBehaviour(); void testEmptyVolumePerformance(); + void testRealisticVolumePerformance(); void testNoiseVolumePerformance(); }; From 4482538f9e6469fb4733d06734ec3c8360cd7da1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 20 Aug 2014 17:16:45 +0200 Subject: [PATCH 172/259] Added header for testing RawVolume as well as SimpleVolume. --- tests/TestSurfaceExtractor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 95ebb299..496c39ac 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -25,6 +25,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Density.h" #include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" From 458a534bf31f108993dd75029d128aed7b5bd96a Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 20 Aug 2014 17:18:20 +0200 Subject: [PATCH 173/259] Eliminated creation of temporary vector. --- library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index c76601b8..3505528b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -374,10 +374,10 @@ namespace PolyVox template VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const { - const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); - int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); - int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); - int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); + const Region& regValidRegion = this->m_regValidRegion; + int32_t iLocalXPos = uXPos - regValidRegion.getLowerX(); + int32_t iLocalYPos = uYPos - regValidRegion.getLowerY(); + int32_t iLocalZPos = uZPos - regValidRegion.getLowerZ(); return m_pData [ From d0aa7cd60f81bee3abf44f44571900464d7ac96f Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 00:06:20 +0200 Subject: [PATCH 174/259] Replaced usage of our 'Array' class with native C array and got significant performance increase. --- .../MarchingCubesSurfaceExtractor.h | 10 ++++---- .../MarchingCubesSurfaceExtractor.inl | 24 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index cf42800e..17e30b1e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -156,6 +156,8 @@ namespace PolyVox template< typename VolumeType, typename MeshType, typename ControllerType> class MarchingCubesSurfaceExtractor { + private: + const static int BitmaskSize = 128; public: MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()); @@ -164,14 +166,14 @@ namespace PolyVox private: //Compute the cell bitmask for a particular slice in z. template - uint32_t computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask); + uint32_t computeBitmaskForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]); //Compute the cell bitmask for a given cell. template - void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace); + void computeBitmaskForCell(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], uint32_t uXRegSpace, uint32_t uYRegSpace); //Use the cell bitmasks to generate all the vertices needed for that slice - void generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + void generateVerticesForSlice(uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ); @@ -291,7 +293,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// //Use the cell bitmasks to generate all the indices needed for that slice - void generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + void generateIndicesForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index fd226560..39ebdeda 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -52,6 +52,12 @@ namespace PolyVox const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions + // PolyVox has a hardcoded limit on how big the regions it can extract are. This lets us allocate various + // arrays at compile time rather than run time. If you *really* need to you can increase this by changing + // the 'BitmaskSize' constant, but you should be sure you really know what you are doing. + POLYVOX_THROW_IF(uArrayWidth > BitmaskSize, std::invalid_argument, "Requested extraction region is too large"); + POLYVOX_THROW_IF(uArrayHeight > BitmaskSize, std::invalid_argument, "Requested extraction region is too large"); + //For edge indices Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); @@ -60,8 +66,8 @@ namespace PolyVox Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); - Array2DUint8 pPreviousBitmask(arraySizes); - Array2DUint8 pCurrentBitmask(arraySizes); + uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize]; + uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]; //Create a region corresponding to the first slice m_regSlicePrevious = m_regSizeInVoxels; @@ -86,7 +92,8 @@ namespace PolyVox } std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); + //pPreviousBitmask.swap(pCurrentBitmask); + memcpy(pPreviousBitmask, pCurrentBitmask, BitmaskSize * BitmaskSize); m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); @@ -114,7 +121,8 @@ namespace PolyVox } std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); + //pPreviousBitmask.swap(pCurrentBitmask); + memcpy(pPreviousBitmask, pCurrentBitmask, BitmaskSize * BitmaskSize); m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); @@ -132,7 +140,7 @@ namespace PolyVox template template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]) { m_uNoOfOccupiedCells = 0; @@ -198,7 +206,7 @@ namespace PolyVox template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], uint32_t uXRegSpace, uint32_t uYRegSpace) { uint8_t iCubeIndex = 0; @@ -397,7 +405,7 @@ namespace PolyVox } template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) @@ -537,7 +545,7 @@ namespace PolyVox } template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, From d9f328cadb5d605e2c19a9a9894514863da12c23 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 16:57:23 +0200 Subject: [PATCH 175/259] It seems the PolyVox Array class is really slow compared to raw C arrays. I've added a test ready for some experimentation. --- tests/TestArray.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++ tests/TestArray.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index bc3f8644..8dde377a 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -29,6 +29,52 @@ freely, subject to the following restrictions: using namespace PolyVox; +void TestArray::testCArraySpeed() +{ + const int width = 128; + const int height = 128; + + int cArray[width][height]; + + QBENCHMARK + { + int ct = 1; + int expectedTotal = 0; + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + cArray[x][y] = ct; + expectedTotal += cArray[x][y]; + ct++; + } + } + } +} + +void TestArray::testPolyVoxArraySpeed() +{ + const int width = 128; + const int height = 128; + + Array<2, int> polyvoxArray(ArraySizes(width)(height)); + + QBENCHMARK + { + int ct = 1; + int expectedTotal = 0; + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + polyvoxArray[x][y] = ct; + expectedTotal += polyvoxArray[x][y]; + ct++; + } + } + } +} + void TestArray::testReadWrite() { int width = 5; diff --git a/tests/TestArray.h b/tests/TestArray.h index fe935511..2d3e5951 100644 --- a/tests/TestArray.h +++ b/tests/TestArray.h @@ -31,6 +31,8 @@ class TestArray: public QObject Q_OBJECT private slots: + void testCArraySpeed(); + void testPolyVoxArraySpeed(); void testReadWrite(); }; From 46358adfbc7061dd500f6d5e42197c89b709c6a1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 21:31:09 +0200 Subject: [PATCH 176/259] New array class is 50(!) times faster than the old one on raw read-write performance. It's also significantly simply. --- tests/TestArray.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++ tests/TestArray.h | 1 + 2 files changed, 54 insertions(+) diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 8dde377a..bf024061 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -29,6 +29,36 @@ freely, subject to the following restrictions: using namespace PolyVox; +template +class Array2D +{ +public: + + Array2D(uint32_t width, uint32_t height) + :m_uWidth(width) + ,m_uHeight(height) + ,m_pData(0) + { + m_pData = new ElementType[m_uWidth * m_uHeight]; + } + + ~Array2D() + { + delete[] m_pData; + } + + ElementType& operator()(uint32_t x, uint32_t y) + { + return m_pData[y * m_uWidth + x]; + } + +private: + + uint32_t m_uWidth; + uint32_t m_uHeight; + ElementType* m_pData; +}; + void TestArray::testCArraySpeed() { const int width = 128; @@ -75,6 +105,29 @@ void TestArray::testPolyVoxArraySpeed() } } +void TestArray::testPolyVoxArray2DSpeed() +{ + const int width = 128; + const int height = 128; + + Array2D polyvoxArray(width,height); + + QBENCHMARK + { + int ct = 1; + int expectedTotal = 0; + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + polyvoxArray(x,y) = ct; + expectedTotal += polyvoxArray(x,y); + ct++; + } + } + } +} + void TestArray::testReadWrite() { int width = 5; diff --git a/tests/TestArray.h b/tests/TestArray.h index 2d3e5951..bd5425a6 100644 --- a/tests/TestArray.h +++ b/tests/TestArray.h @@ -33,6 +33,7 @@ class TestArray: public QObject private slots: void testCArraySpeed(); void testPolyVoxArraySpeed(); + void testPolyVoxArray2DSpeed(); void testReadWrite(); }; From 20815b608383f1a622b7a1b424420e4626f9665c Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 21:38:19 +0200 Subject: [PATCH 177/259] Moved Array2D to it's own file. --- library/PolyVoxCore/CMakeLists.txt | 1 + .../include/PolyVoxCore/Impl/Array2D.h | 60 +++++++++++++++++++ tests/TestArray.cpp | 32 +--------- 3 files changed, 63 insertions(+), 30 deletions(-) create mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index db5caaa8..ed06c3c6 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -108,6 +108,7 @@ SET(IMPL_SRC_FILES ) SET(IMPL_INC_FILES + include/PolyVoxCore/Impl/Array2D.h include/PolyVoxCore/Impl/ArraySizesImpl.h include/PolyVoxCore/Impl/ArraySizesImpl.inl include/PolyVoxCore/Impl/AStarPathfinderImpl.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h new file mode 100644 index 00000000..635a6328 --- /dev/null +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -0,0 +1,60 @@ +/******************************************************************************* +Copyright (c) 2005-20014 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Array2D_H__ +#define __PolyVox_Array2D_H__ + +namespace PolyVox +{ + template + class Array2D + { + public: + + Array2D(uint32_t width, uint32_t height) + :m_uWidth(width) + , m_uHeight(height) + , m_pData(0) + { + m_pData = new ElementType[m_uWidth * m_uHeight]; + } + + ~Array2D() + { + delete[] m_pData; + } + + ElementType& operator()(uint32_t x, uint32_t y) + { + return m_pData[y * m_uWidth + x]; + } + + private: + + uint32_t m_uWidth; + uint32_t m_uHeight; + ElementType* m_pData; + }; +} + +#endif //__PolyVox_Array2D_H__ \ No newline at end of file diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index bf024061..6d41aa6e 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -25,40 +25,12 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" +#include "PolyVoxCore/Impl/Array2D.h" + #include using namespace PolyVox; -template -class Array2D -{ -public: - - Array2D(uint32_t width, uint32_t height) - :m_uWidth(width) - ,m_uHeight(height) - ,m_pData(0) - { - m_pData = new ElementType[m_uWidth * m_uHeight]; - } - - ~Array2D() - { - delete[] m_pData; - } - - ElementType& operator()(uint32_t x, uint32_t y) - { - return m_pData[y * m_uWidth + x]; - } - -private: - - uint32_t m_uWidth; - uint32_t m_uHeight; - ElementType* m_pData; -}; - void TestArray::testCArraySpeed() { const int width = 128; From 5f8e3df5dfa239b86fc8cc55ab93028ee0a853ea Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 21:38:36 +0200 Subject: [PATCH 178/259] Revert "Replaced usage of our 'Array' class with native C array and got significant performance increase." This reverts commit d0aa7cd60f81bee3abf44f44571900464d7ac96f. --- .../MarchingCubesSurfaceExtractor.h | 10 ++++---- .../MarchingCubesSurfaceExtractor.inl | 24 +++++++------------ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 17e30b1e..cf42800e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -156,8 +156,6 @@ namespace PolyVox template< typename VolumeType, typename MeshType, typename ControllerType> class MarchingCubesSurfaceExtractor { - private: - const static int BitmaskSize = 128; public: MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()); @@ -166,14 +164,14 @@ namespace PolyVox private: //Compute the cell bitmask for a particular slice in z. template - uint32_t computeBitmaskForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]); + uint32_t computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask); //Compute the cell bitmask for a given cell. template - void computeBitmaskForCell(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], uint32_t uXRegSpace, uint32_t uYRegSpace); + void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace); //Use the cell bitmasks to generate all the vertices needed for that slice - void generateVerticesForSlice(uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], + void generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ); @@ -293,7 +291,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// //Use the cell bitmasks to generate all the indices needed for that slice - void generateIndicesForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], + void generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 39ebdeda..fd226560 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -52,12 +52,6 @@ namespace PolyVox const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions - // PolyVox has a hardcoded limit on how big the regions it can extract are. This lets us allocate various - // arrays at compile time rather than run time. If you *really* need to you can increase this by changing - // the 'BitmaskSize' constant, but you should be sure you really know what you are doing. - POLYVOX_THROW_IF(uArrayWidth > BitmaskSize, std::invalid_argument, "Requested extraction region is too large"); - POLYVOX_THROW_IF(uArrayHeight > BitmaskSize, std::invalid_argument, "Requested extraction region is too large"); - //For edge indices Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); @@ -66,8 +60,8 @@ namespace PolyVox Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); - uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize]; - uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]; + Array2DUint8 pPreviousBitmask(arraySizes); + Array2DUint8 pCurrentBitmask(arraySizes); //Create a region corresponding to the first slice m_regSlicePrevious = m_regSizeInVoxels; @@ -92,8 +86,7 @@ namespace PolyVox } std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - //pPreviousBitmask.swap(pCurrentBitmask); - memcpy(pPreviousBitmask, pCurrentBitmask, BitmaskSize * BitmaskSize); + pPreviousBitmask.swap(pCurrentBitmask); m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); @@ -121,8 +114,7 @@ namespace PolyVox } std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - //pPreviousBitmask.swap(pCurrentBitmask); - memcpy(pPreviousBitmask, pCurrentBitmask, BitmaskSize * BitmaskSize); + pPreviousBitmask.swap(pCurrentBitmask); m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); @@ -140,7 +132,7 @@ namespace PolyVox template template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize]) + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) { m_uNoOfOccupiedCells = 0; @@ -206,7 +198,7 @@ namespace PolyVox template template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], uint32_t uXRegSpace, uint32_t uYRegSpace) + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) { uint8_t iCubeIndex = 0; @@ -405,7 +397,7 @@ namespace PolyVox } template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(uint8_t pCurrentBitmask[BitmaskSize][BitmaskSize], + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, Array2DInt32& m_pCurrentVertexIndicesX, Array2DInt32& m_pCurrentVertexIndicesY, Array2DInt32& m_pCurrentVertexIndicesZ) @@ -545,7 +537,7 @@ namespace PolyVox } template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(uint8_t pPreviousBitmask[BitmaskSize][BitmaskSize], + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, const Array2DInt32& m_pPreviousVertexIndicesX, const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, From 83c287727fa8177ee9c3ff6cee357c054783739d Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 23:03:38 +0200 Subject: [PATCH 179/259] Additions to Array2D. --- .../PolyVoxCore/include/PolyVoxCore/Array.h | 4 +- .../include/PolyVoxCore/Impl/Array2D.h | 39 +++++++++++++++++++ .../PolyVoxCore/PolyVoxForwardDeclarations.h | 4 +- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index e8a51b05..ae59524a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -171,7 +171,7 @@ namespace PolyVox typedef Array<1,uint32_t> Array1DUint32; ///A 2D Array of floats. - typedef Array<2,float> Array2DFloat; + /*typedef Array<2,float> Array2DFloat; ///A 2D Array of doubles. typedef Array<2,double> Array2DDouble; ///A 2D Array of signed 8-bit values. @@ -185,7 +185,7 @@ namespace PolyVox ///A 2D Array of signed 32-bit values. typedef Array<2,int32_t> Array2DInt32; ///A 2D Array of unsigned 32-bit values. - typedef Array<2,uint32_t> Array2DUint32; + typedef Array<2,uint32_t> Array2DUint32;*/ ///A 3D Array of floats. typedef Array<3,float> Array3DFloat; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index 635a6328..b6713ae9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -44,17 +44,56 @@ namespace PolyVox delete[] m_pData; } + ElementType operator()(uint32_t x, uint32_t y) const + { + return m_pData[y * m_uWidth + x]; + } + ElementType& operator()(uint32_t x, uint32_t y) { return m_pData[y * m_uWidth + x]; } + ElementType* getRawData() + { + return m_pData; + } + + size_t getNoOfElements() + { + return m_uWidth * m_uHeight; + } + + void swap(Array2D& other) + { + ElementType* temp = other.m_pData; + other.m_pData = m_pData; + m_pData = temp; + } + private: uint32_t m_uWidth; uint32_t m_uHeight; ElementType* m_pData; }; + + ///A 2D Array of floats. + typedef Array2D Array2DFloat; + ///A 2D Array of doubles. + typedef Array2D Array2DDouble; + ///A 2D Array of signed 8-bit values. + typedef Array2D Array2DInt8; + ///A 2D Array of unsigned 8-bit values. + typedef Array2D Array2DUint8; + ///A 2D Array of signed 16-bit values. + typedef Array2D Array2DInt16; + ///A 2D Array of unsigned 16-bit values. + typedef Array2D Array2DUint16; + ///A 2D Array of signed 32-bit values. + typedef Array2D Array2DInt32; + ///A 2D Array of unsigned 32-bit values. + typedef Array2D Array2DUint32; } #endif //__PolyVox_Array2D_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 0b401a98..75ddf905 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -44,14 +44,14 @@ namespace PolyVox typedef Array<1,int32_t> Array1DInt32; typedef Array<1,uint32_t> Array1DUint32; - typedef Array<2,float> Array2DFloat; + /*typedef Array<2,float> Array2DFloat; typedef Array<2,double> Array2DDouble; typedef Array<2,int8_t> Array2DInt8; typedef Array<2,uint8_t> Array2DUint8; typedef Array<2,int16_t> Array2DInt16; typedef Array<2,uint16_t> Array2DUint16; typedef Array<2,int32_t> Array2DInt32; - typedef Array<2,uint32_t> Array2DUint32; + typedef Array<2,uint32_t> Array2DUint32;*/ typedef Array<3,float> Array3DFloat; typedef Array<3,double> Array3DDouble; From 0ff0234ce19c462287d86a6b4a258e3c6a54f571 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 21 Aug 2014 23:04:30 +0200 Subject: [PATCH 180/259] Switched marching cubes extractor to use new Array2D instead of array, and it now more than twice as fast in the best case (empty volume). --- .../MarchingCubesSurfaceExtractor.h | 2 +- .../MarchingCubesSurfaceExtractor.inl | 76 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index cf42800e..62ccbff6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "Impl/MarchingCubesTables.h" #include "Impl/TypeDef.h" -#include "PolyVoxCore/Array.h" +#include "PolyVoxCore/Impl/Array2D.h" #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/DefaultMarchingCubesController.h" diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index fd226560..acd0f77b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -53,15 +53,15 @@ namespace PolyVox const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions //For edge indices - Array2DInt32 m_pPreviousVertexIndicesX(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesY(arraySizes); - Array2DInt32 m_pPreviousVertexIndicesZ(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesX(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesY(arraySizes); - Array2DInt32 m_pCurrentVertexIndicesZ(arraySizes); + Array2DInt32 m_pPreviousVertexIndicesX(uArrayWidth, uArrayHeight); + Array2DInt32 m_pPreviousVertexIndicesY(uArrayWidth, uArrayHeight); + Array2DInt32 m_pPreviousVertexIndicesZ(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesX(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesY(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesZ(uArrayWidth, uArrayHeight); - Array2DUint8 pPreviousBitmask(arraySizes); - Array2DUint8 pCurrentBitmask(arraySizes); + Array2DUint8 pPreviousBitmask(uArrayWidth, uArrayHeight); + Array2DUint8 pCurrentBitmask(uArrayWidth, uArrayHeight); //Create a region corresponding to the first slice m_regSlicePrevious = m_regSizeInVoxels; @@ -220,16 +220,16 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); iPreviousCubeIndexZ >>= 4; //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); iPreviousCubeIndexY &= 192; //192 = 128 + 64 iPreviousCubeIndexY >>= 2; //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); iPreviousCubeIndexX &= 128; iPreviousCubeIndexX >>= 1; @@ -243,11 +243,11 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); iPreviousCubeIndexZ >>= 4; //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); iPreviousCubeIndexY &= 192; //192 = 128 + 64 iPreviousCubeIndexY >>= 2; @@ -265,11 +265,11 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); iPreviousCubeIndexZ >>= 4; //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); iPreviousCubeIndexX &= 160; //160 = 128+32 iPreviousCubeIndexX >>= 1; @@ -286,7 +286,7 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace]; + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); iCubeIndex = iPreviousCubeIndexZ >> 4; if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; @@ -306,12 +306,12 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 iPreviousCubeIndexY >>= 2; //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 iPreviousCubeIndexX >>= 1; @@ -329,7 +329,7 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask[uXRegSpace][uYRegSpace-1]; + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 iPreviousCubeIndexY >>= 2; @@ -352,7 +352,7 @@ namespace PolyVox v111 = m_sampVolume.peekVoxel1px1py1pz(); //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask[uXRegSpace-1][uYRegSpace]; + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 iPreviousCubeIndexX >>= 1; @@ -388,7 +388,7 @@ namespace PolyVox } //Save the bitmask - pCurrentBitmask[uXRegSpace][uYRegSpace] = iCubeIndex; + pCurrentBitmask(uXRegSpace, uYRegSpace) = iCubeIndex; if(edgeTable[iCubeIndex] != 0) { @@ -415,7 +415,7 @@ namespace PolyVox const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pCurrentBitmask[uXRegSpace][uYRegSpace]; + const uint8_t iCubeIndex = pCurrentBitmask(uXRegSpace, uYRegSpace); /* Cube is entirely in/out of the surface */ if (edgeTable[iCubeIndex] == 0) @@ -461,7 +461,7 @@ namespace PolyVox surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesX[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + m_pCurrentVertexIndicesX(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; m_sampVolume.moveNegativeX(); } @@ -495,7 +495,7 @@ namespace PolyVox surfaceVertex.data = uMaterial; uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesY[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + m_pCurrentVertexIndicesY(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; m_sampVolume.moveNegativeY(); } @@ -528,7 +528,7 @@ namespace PolyVox surfaceVertex.data = uMaterial; const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesZ[iXVolSpace - m_regSizeInVoxels.getLowerX()][iYVolSpace - m_regSizeInVoxels.getLowerY()] = uLastVertexIndex; + m_pCurrentVertexIndicesZ(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; m_sampVolume.moveNegativeZ(); } @@ -563,7 +563,7 @@ namespace PolyVox const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pPreviousBitmask[uXRegSpace][uYRegSpace]; + const uint8_t iCubeIndex = pPreviousBitmask(uXRegSpace, uYRegSpace); /* Cube is entirely in/out of the surface */ if (edgeTable[iCubeIndex] == 0) @@ -574,51 +574,51 @@ namespace PolyVox /* Find the vertices where the surface intersects the cube */ if (edgeTable[iCubeIndex] & 1) { - indlist[0] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace]; + indlist[0] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace); } if (edgeTable[iCubeIndex] & 2) { - indlist[1] = m_pPreviousVertexIndicesY[uXRegSpace+1][uYRegSpace]; + indlist[1] = m_pPreviousVertexIndicesY(uXRegSpace + 1, uYRegSpace); } if (edgeTable[iCubeIndex] & 4) { - indlist[2] = m_pPreviousVertexIndicesX[uXRegSpace][uYRegSpace+1]; + indlist[2] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace + 1); } if (edgeTable[iCubeIndex] & 8) { - indlist[3] = m_pPreviousVertexIndicesY[uXRegSpace][uYRegSpace]; + indlist[3] = m_pPreviousVertexIndicesY(uXRegSpace, uYRegSpace); } if (edgeTable[iCubeIndex] & 16) { - indlist[4] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace]; + indlist[4] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace); } if (edgeTable[iCubeIndex] & 32) { - indlist[5] = m_pCurrentVertexIndicesY[uXRegSpace+1][uYRegSpace]; + indlist[5] = m_pCurrentVertexIndicesY(uXRegSpace + 1, uYRegSpace); } if (edgeTable[iCubeIndex] & 64) { - indlist[6] = m_pCurrentVertexIndicesX[uXRegSpace][uYRegSpace+1]; + indlist[6] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace + 1); } if (edgeTable[iCubeIndex] & 128) { - indlist[7] = m_pCurrentVertexIndicesY[uXRegSpace][uYRegSpace]; + indlist[7] = m_pCurrentVertexIndicesY(uXRegSpace, uYRegSpace); } if (edgeTable[iCubeIndex] & 256) { - indlist[8] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace]; + indlist[8] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace); } if (edgeTable[iCubeIndex] & 512) { - indlist[9] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace]; + indlist[9] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace); } if (edgeTable[iCubeIndex] & 1024) { - indlist[10] = m_pPreviousVertexIndicesZ[uXRegSpace+1][uYRegSpace+1]; + indlist[10] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace + 1); } if (edgeTable[iCubeIndex] & 2048) { - indlist[11] = m_pPreviousVertexIndicesZ[uXRegSpace][uYRegSpace+1]; + indlist[11] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace + 1); } for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) From ad73caf36873ff8fb0509f4f8ec81983f489c253 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 22 Aug 2014 15:49:30 +0200 Subject: [PATCH 181/259] Array2D now has private copy constructor and assignment operator to prevent accidental copying. --- library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index b6713ae9..062e61e0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -73,6 +73,10 @@ namespace PolyVox private: + // These are private to avoid accidental copying. + Array2D(const Array2D& rhs); + Array2D& operator=(const Array2D& rhs); + uint32_t m_uWidth; uint32_t m_uHeight; ElementType* m_pData; From 1fb82f40b300cd383011b3eb7b4288bbddc8ac6b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 11:51:45 +0200 Subject: [PATCH 182/259] Switched to C++11-style hiding of copy constructor and assignment operator. --- library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index 062e61e0..3cac675c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -39,6 +39,10 @@ namespace PolyVox m_pData = new ElementType[m_uWidth * m_uHeight]; } + // These are deleted to avoid accidental copying. + Array2D(const Array2D&) = delete; + Array2D& operator=(const Array2D&) = delete; + ~Array2D() { delete[] m_pData; @@ -73,10 +77,6 @@ namespace PolyVox private: - // These are private to avoid accidental copying. - Array2D(const Array2D& rhs); - Array2D& operator=(const Array2D& rhs); - uint32_t m_uWidth; uint32_t m_uHeight; ElementType* m_pData; From 083c65ecd53ad52acab9e8a6665d7938c415bc8d Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 12:03:41 +0200 Subject: [PATCH 183/259] Added asserts. --- library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index 3cac675c..751169c6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -50,11 +50,13 @@ namespace PolyVox ElementType operator()(uint32_t x, uint32_t y) const { + POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range."); return m_pData[y * m_uWidth + x]; } ElementType& operator()(uint32_t x, uint32_t y) { + POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range."); return m_pData[y * m_uWidth + x]; } From 9a1c6784df99a6ccb826b407eb71acb9521bca98 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 12:26:36 +0200 Subject: [PATCH 184/259] Steps towards making new array class be multidimensional. --- .../include/PolyVoxCore/Impl/Array2D.h | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index 751169c6..be383e98 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -26,22 +26,23 @@ distribution. namespace PolyVox { - template + template class Array2D { public: Array2D(uint32_t width, uint32_t height) - :m_uWidth(width) - , m_uHeight(height) - , m_pData(0) + :m_pData(0) { - m_pData = new ElementType[m_uWidth * m_uHeight]; + m_uDimensions[0] = width; + m_uDimensions[1] = height; + + initialize(); } // These are deleted to avoid accidental copying. - Array2D(const Array2D&) = delete; - Array2D& operator=(const Array2D&) = delete; + Array2D(const Array2D&) = delete; + Array2D& operator=(const Array2D&) = delete; ~Array2D() { @@ -50,14 +51,14 @@ namespace PolyVox ElementType operator()(uint32_t x, uint32_t y) const { - POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range."); - return m_pData[y * m_uWidth + x]; + POLYVOX_ASSERT((x < m_uDimensions[0] && y < m_uDimensions[1]), "Array access is out-of-range."); + return m_pData[y * m_uDimensions[0] + x]; } ElementType& operator()(uint32_t x, uint32_t y) { - POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range."); - return m_pData[y * m_uWidth + x]; + POLYVOX_ASSERT((x < m_uDimensions[0] && y < m_uDimensions[1]), "Array access is out-of-range."); + return m_pData[y * m_uDimensions[0] + x]; } ElementType* getRawData() @@ -67,7 +68,7 @@ namespace PolyVox size_t getNoOfElements() { - return m_uWidth * m_uHeight; + return m_uNoOfElements; } void swap(Array2D& other) @@ -79,27 +80,38 @@ namespace PolyVox private: - uint32_t m_uWidth; - uint32_t m_uHeight; + void initialize(void) + { + // Calculate the total number of elements in the array. + m_uNoOfElements = 1; + for (uint32_t i = 0; i < noOfDims; i++) + { + m_uNoOfElements *= m_uDimensions[i]; + } + m_pData = new ElementType[m_uNoOfElements]; + } + + uint32_t m_uDimensions[noOfDims]; + uint32_t m_uNoOfElements; ElementType* m_pData; }; ///A 2D Array of floats. - typedef Array2D Array2DFloat; + typedef Array2D<2, float> Array2DFloat; ///A 2D Array of doubles. - typedef Array2D Array2DDouble; + typedef Array2D<2, double> Array2DDouble; ///A 2D Array of signed 8-bit values. - typedef Array2D Array2DInt8; + typedef Array2D<2, int8_t> Array2DInt8; ///A 2D Array of unsigned 8-bit values. - typedef Array2D Array2DUint8; + typedef Array2D<2, uint8_t> Array2DUint8; ///A 2D Array of signed 16-bit values. - typedef Array2D Array2DInt16; + typedef Array2D<2, int16_t> Array2DInt16; ///A 2D Array of unsigned 16-bit values. - typedef Array2D Array2DUint16; + typedef Array2D<2, uint16_t> Array2DUint16; ///A 2D Array of signed 32-bit values. - typedef Array2D Array2DInt32; + typedef Array2D<2, int32_t> Array2DInt32; ///A 2D Array of unsigned 32-bit values. - typedef Array2D Array2DUint32; + typedef Array2D<2, uint32_t> Array2DUint32; } #endif //__PolyVox_Array2D_H__ \ No newline at end of file From 528873bcd3c100270cb68ba5ddb4a5265913d648 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 21:54:59 +0200 Subject: [PATCH 185/259] Extended 'Array2D class to be multidimensional (will rename it shortly). --- .../PolyVoxCore/include/PolyVoxCore/Array.h | 8 +- .../include/PolyVoxCore/Impl/Array2D.h | 103 +++++++++++++++--- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 8 +- tests/TestArray.cpp | 60 ++++++---- 4 files changed, 131 insertions(+), 48 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index ae59524a..9ee935ba 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -154,7 +154,7 @@ namespace PolyVox //Some handy typedefs ///A 1D Array of floats. - typedef Array<1,float> Array1DFloat; + /*typedef Array<1,float> Array1DFloat; ///A 1D Array of doubles. typedef Array<1,double> Array1DDouble; ///A 1D Array of signed 8-bit values. @@ -168,7 +168,7 @@ namespace PolyVox ///A 1D Array of signed 32-bit values. typedef Array<1,int32_t> Array1DInt32; ///A 1D Array of unsigned 32-bit values. - typedef Array<1,uint32_t> Array1DUint32; + typedef Array<1,uint32_t> Array1DUint32;*/ ///A 2D Array of floats. /*typedef Array<2,float> Array2DFloat; @@ -188,7 +188,7 @@ namespace PolyVox typedef Array<2,uint32_t> Array2DUint32;*/ ///A 3D Array of floats. - typedef Array<3,float> Array3DFloat; + /*typedef Array<3,float> Array3DFloat; ///A 3D Array of doubles. typedef Array<3,double> Array3DDouble; ///A 3D Array of signed 8-bit values. @@ -202,7 +202,7 @@ namespace PolyVox ///A 3D Array of signed 32-bit values. typedef Array<3,int32_t> Array3DInt32; ///A 3D Array of unsigned 32-bit values. - typedef Array<3,uint32_t> Array3DUint32; + typedef Array<3,uint32_t> Array3DUint32;*/ }//namespace PolyVox #include "PolyVoxCore/Array.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h index be383e98..6eaeace4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h @@ -24,6 +24,10 @@ distribution. #ifndef __PolyVox_Array2D_H__ #define __PolyVox_Array2D_H__ +#include + +#include + namespace PolyVox { template @@ -31,51 +35,84 @@ namespace PolyVox { public: - Array2D(uint32_t width, uint32_t height) - :m_pData(0) + Array2D(uint32_t width) + :m_pElements(0) { + static_assert(noOfDims == 1, "This constructor can only be used with a one-dimensional array"); + + m_uDimensions[0] = width; + + initialize(); + } + + Array2D(uint32_t width, uint32_t height) + :m_pElements(0) + { + static_assert(noOfDims == 2, "This constructor can only be used with a two-dimensional array"); + m_uDimensions[0] = width; m_uDimensions[1] = height; initialize(); } + Array2D(uint32_t width, uint32_t height, uint32_t depth) + :m_pElements(0) + { + static_assert(noOfDims == 3, "This constructor can only be used with a three-dimensional array"); + + m_uDimensions[0] = width; + m_uDimensions[1] = height; + m_uDimensions[2] = depth; + + initialize(); + } + // These are deleted to avoid accidental copying. Array2D(const Array2D&) = delete; Array2D& operator=(const Array2D&) = delete; ~Array2D() { - delete[] m_pData; + delete[] m_pElements; } - ElementType operator()(uint32_t x, uint32_t y) const + ElementType& operator()(uint32_t x) const { - POLYVOX_ASSERT((x < m_uDimensions[0] && y < m_uDimensions[1]), "Array access is out-of-range."); - return m_pData[y * m_uDimensions[0] + x]; + static_assert(noOfDims == 1, "This accessor can only be used with a one-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0], "Array access is out-of-range."); + return m_pElements[x]; } - ElementType& operator()(uint32_t x, uint32_t y) + ElementType& operator()(uint32_t x, uint32_t y) const { - POLYVOX_ASSERT((x < m_uDimensions[0] && y < m_uDimensions[1]), "Array access is out-of-range."); - return m_pData[y * m_uDimensions[0] + x]; + static_assert(noOfDims == 2, "This accessor can only be used with a two-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1], "Array access is out-of-range."); + return m_pElements[y * m_uDimensions[0] + x]; + } + + ElementType& operator()(uint32_t x, uint32_t y, uint32_t z) const + { + static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); + return m_pElements[z * m_uDimensions[1] * m_uDimensions[1] + y * m_uDimensions[0] + x]; } ElementType* getRawData() { - return m_pData; + return m_pElements; } - size_t getNoOfElements() + uint32_t getNoOfElements() { return m_uNoOfElements; } void swap(Array2D& other) { - ElementType* temp = other.m_pData; - other.m_pData = m_pData; - m_pData = temp; + ElementType* temp = other.m_pElements; + other.m_pElements = m_pElements; + m_pElements = temp; } private: @@ -88,14 +125,31 @@ namespace PolyVox { m_uNoOfElements *= m_uDimensions[i]; } - m_pData = new ElementType[m_uNoOfElements]; + m_pElements = new ElementType[m_uNoOfElements]; } uint32_t m_uDimensions[noOfDims]; uint32_t m_uNoOfElements; - ElementType* m_pData; + ElementType* m_pElements; }; + ///A 1D Array of floats. + typedef Array2D<1, float> Array1DFloat; + ///A 1D Array of doubles. + typedef Array2D<1, double> Array1DDouble; + ///A 1D Array of signed 8-bit values. + typedef Array2D<1, int8_t> Array1DInt8; + ///A 1D Array of unsigned 8-bit values. + typedef Array2D<1, uint8_t> Array1DUint8; + ///A 1D Array of signed 16-bit values. + typedef Array2D<1, int16_t> Array1DInt16; + ///A 1D Array of unsigned 16-bit values. + typedef Array2D<1, uint16_t> Array1DUint16; + ///A 1D Array of signed 32-bit values. + typedef Array2D<1, int32_t> Array1DInt32; + ///A 1D Array of unsigned 32-bit values. + typedef Array2D<1, uint32_t> Array1DUint32; + ///A 2D Array of floats. typedef Array2D<2, float> Array2DFloat; ///A 2D Array of doubles. @@ -112,6 +166,23 @@ namespace PolyVox typedef Array2D<2, int32_t> Array2DInt32; ///A 2D Array of unsigned 32-bit values. typedef Array2D<2, uint32_t> Array2DUint32; + + ///A 3D Array of floats. + typedef Array2D<3, float> Array3DFloat; + ///A 3D Array of doubles. + typedef Array2D<3, double> Array3DDouble; + ///A 3D Array of signed 8-bit values. + typedef Array2D<3, int8_t> Array3DInt8; + ///A 3D Array of unsigned 8-bit values. + typedef Array2D<3, uint8_t> Array3DUint8; + ///A 3D Array of signed 16-bit values. + typedef Array2D<3, int16_t> Array3DInt16; + ///A 3D Array of unsigned 16-bit values. + typedef Array2D<3, uint16_t> Array3DUint16; + ///A 3D Array of signed 32-bit values. + typedef Array2D<3, int32_t> Array3DInt32; + ///A 3D Array of unsigned 32-bit values. + typedef Array2D<3, uint32_t> Array3DUint32; } #endif //__PolyVox_Array2D_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 75ddf905..4c63906d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -33,7 +33,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// // Array //////////////////////////////////////////////////////////////////////////////// - template class Array; + /*template class Array; typedef Array<1,float> Array1DFloat; typedef Array<1,double> Array1DDouble; @@ -42,7 +42,7 @@ namespace PolyVox typedef Array<1,int16_t> Array1DInt16; typedef Array<1,uint16_t> Array1DUint16; typedef Array<1,int32_t> Array1DInt32; - typedef Array<1,uint32_t> Array1DUint32; + typedef Array<1,uint32_t> Array1DUint32;*/ /*typedef Array<2,float> Array2DFloat; typedef Array<2,double> Array2DDouble; @@ -53,14 +53,14 @@ namespace PolyVox typedef Array<2,int32_t> Array2DInt32; typedef Array<2,uint32_t> Array2DUint32;*/ - typedef Array<3,float> Array3DFloat; + /*typedef Array<3,float> Array3DFloat; typedef Array<3,double> Array3DDouble; typedef Array<3,int8_t> Array3DInt8; typedef Array<3,uint8_t> Array3DUint8; typedef Array<3,int16_t> Array3DInt16; typedef Array<3,uint16_t> Array3DUint16; typedef Array<3,int32_t> Array3DInt32; - typedef Array<3,uint32_t> Array3DUint32; + typedef Array<3,uint32_t> Array3DUint32;*/ //////////////////////////////////////////////////////////////////////////////// // BlockCompressor diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 6d41aa6e..84d4bf14 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -33,22 +33,26 @@ using namespace PolyVox; void TestArray::testCArraySpeed() { - const int width = 128; - const int height = 128; + const int width = 32; + const int height = 32; + const int depth = 32; - int cArray[width][height]; + int cArray[width][height][depth]; QBENCHMARK { int ct = 1; int expectedTotal = 0; - for (int y = 0; y < height; y++) + for (int z = 0; z < depth; z++) { - for (int x = 0; x < width; x++) + for (int y = 0; y < height; y++) { - cArray[x][y] = ct; - expectedTotal += cArray[x][y]; - ct++; + for (int x = 0; x < width; x++) + { + cArray[x][y][z] = ct; + expectedTotal += cArray[x][y][z]; + ct++; + } } } } @@ -56,22 +60,26 @@ void TestArray::testCArraySpeed() void TestArray::testPolyVoxArraySpeed() { - const int width = 128; - const int height = 128; + const int width = 32; + const int height = 32; + const int depth = 32; - Array<2, int> polyvoxArray(ArraySizes(width)(height)); + Array<3, int> polyvoxArray(ArraySizes(width)(height)(depth)); QBENCHMARK { int ct = 1; int expectedTotal = 0; - for (int y = 0; y < height; y++) + for (int z = 0; z < depth; z++) { - for (int x = 0; x < width; x++) + for (int y = 0; y < height; y++) { - polyvoxArray[x][y] = ct; - expectedTotal += polyvoxArray[x][y]; - ct++; + for (int x = 0; x < width; x++) + { + polyvoxArray[x][y][z] = ct; + expectedTotal += polyvoxArray[x][y][z]; + ct++; + } } } } @@ -79,22 +87,26 @@ void TestArray::testPolyVoxArraySpeed() void TestArray::testPolyVoxArray2DSpeed() { - const int width = 128; - const int height = 128; + const int width = 32; + const int height = 32; + const int depth = 32; - Array2D polyvoxArray(width,height); + Array2D<3, int> polyvoxArray(width, height, depth); QBENCHMARK { int ct = 1; int expectedTotal = 0; - for (int y = 0; y < height; y++) + for (int z = 0; z < depth; z++) { - for (int x = 0; x < width; x++) + for (int y = 0; y < height; y++) { - polyvoxArray(x,y) = ct; - expectedTotal += polyvoxArray(x,y); - ct++; + for (int x = 0; x < width; x++) + { + polyvoxArray(x, y, z) = ct; + expectedTotal += polyvoxArray(x, y, z); + ct++; + } } } } From d49db280d549fafef0313c343bf82d76072fe607 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 21:55:44 +0200 Subject: [PATCH 186/259] TestVolumeSubclass now uses Array2D instead of Array. --- tests/TestVolumeSubclass.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 73351113..b8848c11 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -23,7 +23,8 @@ freely, subject to the following restrictions: #include "TestVolumeSubclass.h" -#include "PolyVoxCore/Array.h" +#include "PolyVoxCore/Impl/Array2D.h" + #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/Material.h" @@ -62,8 +63,9 @@ public: /// Constructor for creating a fixed size volume. VolumeSubclass(const Region& regValid) :BaseVolume(regValid) + , mVolumeData(this->getWidth(), this->getHeight(), this->getDepth()) { - mVolumeData.resize(ArraySizes(this->getWidth())(this->getHeight())(this->getDepth())); + //mVolumeData.resize(ArraySizes(this->getWidth())(this->getHeight())(this->getDepth())); } /// Destructor ~VolumeSubclass() {}; @@ -97,7 +99,7 @@ public: POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); } - return mVolumeData[uXPos][uYPos][uZPos]; + return mVolumeData(uXPos, uYPos, uZPos); } case WrapModes::Clamp: { @@ -108,13 +110,13 @@ public: uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - return mVolumeData[uXPos][uYPos][uZPos]; + return mVolumeData(uXPos, uYPos, uZPos); } case WrapModes::Border: { if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) { - return mVolumeData[uXPos][uYPos][uZPos]; + return mVolumeData(uXPos, uYPos, uZPos); } else { @@ -123,7 +125,7 @@ public: } case WrapModes::AssumeValid: { - return mVolumeData[uXPos][uYPos][uZPos]; + return mVolumeData(uXPos, uYPos, uZPos); } default: { @@ -147,7 +149,7 @@ public: { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) { - mVolumeData[uXPos][uYPos][uZPos] = tValue; + mVolumeData(uXPos, uYPos, uZPos) = tValue; return true; } else @@ -165,7 +167,7 @@ public: //void resize(const Region& regValidRegion); private: - Array<3, VoxelType> mVolumeData; + Array2D<3, VoxelType> mVolumeData; }; void TestVolumeSubclass::testExtractSurface() From d06dbdf054a66330df8c745a36dac21bdfe1f5b3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 22:30:50 +0200 Subject: [PATCH 187/259] Bit renaming. Old Array class is gone, and is replaced by the Array2D class which has also been renamed to Array. --- library/PolyVoxCore/CMakeLists.txt | 8 - .../include/PolyVoxCore/AStarPathfinder.h | 2 - .../AmbientOcclusionCalculator.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Array.h | 279 +++++++-------- .../PolyVoxCore/include/PolyVoxCore/Array.inl | 335 ------------------ .../include/PolyVoxCore/ArraySizes.h | 77 ---- .../PolyVoxCore/CubicSurfaceExtractor.inl | 14 +- .../include/PolyVoxCore/Impl/Array2D.h | 188 ---------- .../include/PolyVoxCore/Impl/ArraySizesImpl.h | 63 ---- .../PolyVoxCore/Impl/ArraySizesImpl.inl | 46 --- .../include/PolyVoxCore/Impl/SubArray.h | 90 ----- .../include/PolyVoxCore/Impl/SubArray.inl | 92 ----- .../MarchingCubesSurfaceExtractor.h | 2 +- library/PolyVoxCore/source/ArraySizes.cpp | 57 --- tests/TestAmbientOcclusionGenerator.cpp | 12 +- tests/TestArray.cpp | 41 +-- tests/TestArray.h | 1 - tests/TestVolumeSubclass.cpp | 4 +- 18 files changed, 155 insertions(+), 1158 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Array.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/ArraySizes.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.inl delete mode 100644 library/PolyVoxCore/source/ArraySizes.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index ed06c3c6..2f115630 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -24,7 +24,6 @@ PROJECT(PolyVoxCore) #Projects source files SET(CORE_SRC_FILES - source/ArraySizes.cpp source/AStarPathfinder.cpp source/Region.cpp ) @@ -34,8 +33,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/AmbientOcclusionCalculator.h include/PolyVoxCore/AmbientOcclusionCalculator.inl include/PolyVoxCore/Array.h - include/PolyVoxCore/Array.inl - include/PolyVoxCore/ArraySizes.h include/PolyVoxCore/AStarPathfinder.h include/PolyVoxCore/AStarPathfinder.inl include/PolyVoxCore/BaseVolume.h @@ -108,9 +105,6 @@ SET(IMPL_SRC_FILES ) SET(IMPL_INC_FILES - include/PolyVoxCore/Impl/Array2D.h - include/PolyVoxCore/Impl/ArraySizesImpl.h - include/PolyVoxCore/Impl/ArraySizesImpl.inl include/PolyVoxCore/Impl/AStarPathfinderImpl.h include/PolyVoxCore/Impl/Config.h include/PolyVoxCore/Impl/ErrorHandling.h @@ -119,8 +113,6 @@ SET(IMPL_INC_FILES include/PolyVoxCore/Impl/MinizWrapper.h include/PolyVoxCore/Impl/RandomUnitVectors.h include/PolyVoxCore/Impl/RandomVectors.h - include/PolyVoxCore/Impl/SubArray.h - include/PolyVoxCore/Impl/SubArray.inl include/PolyVoxCore/Impl/Timer.h include/PolyVoxCore/Impl/TypeDef.h include/PolyVoxCore/Impl/Utility.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index 7b86d8bc..88b22374 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -27,8 +27,6 @@ freely, subject to the following restrictions: #include "Impl/AStarPathfinderImpl.h" #include "Impl/TypeDef.h" -#include "PolyVoxCore/Array.h" - #include #include #include //For runtime_error diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl index 82c266f3..c64c6d22 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl @@ -128,7 +128,7 @@ namespace PolyVox POLYVOX_ASSERT((fVisibility >= 0.0f) && (fVisibility <= 1.0f), "Visibility value out of range."); } - (*arrayResult)[z / iRatioZ][y / iRatioY][x / iRatioX] = static_cast(255.0f * fVisibility); + (*arrayResult)(z / iRatioZ, y / iRatioY, x / iRatioX) = static_cast(255.0f * fVisibility); } } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index 9ee935ba..4ec0f616 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -1,5 +1,5 @@ /******************************************************************************* -Copyright (c) 2005-2009 David Williams +Copyright (c) 2005-20014 David Williams This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -9,202 +9,185 @@ Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. - 3. This notice may not be removed or altered from any source - distribution. +3. This notice may not be removed or altered from any source +distribution. *******************************************************************************/ #ifndef __PolyVox_Array_H__ #define __PolyVox_Array_H__ -#include "Impl/SubArray.h" +#include -#include "PolyVoxCore/ArraySizes.h" //Not strictly required, but convienient +#include namespace PolyVox { - ///Provides an efficient implementation of a multidimensional array. - //////////////////////////////////////////////////////////////////////////////// - /// While C++ provides one-dimensional arrays as a language feature, it does not - /// provide a simple and intuitive way of working with multidimensional arrays - /// whose sizes are specified at runtime. Such a construct is very useful within - /// the context of PolyVox, and this Array class provides such functionality - /// implemented via templates and partial specialisation. - /// - /// The following code snippet illustrates the basic usage of the class by writing - /// a different value into each element: - /// - /// \code - /// int width = 5; - /// int height = 10; - /// int depth = 20; - /// - /// //Creates a 3D array of integers with dimensions 5x10x20 - /// Array<3, int> myArray(ArraySizes(width)(height)(depth)); - /// - /// int ct = 1; - /// for(int z = 0; z < depth; z++) - /// { - /// for(int y = 0; y < height; y++) - /// { - /// for(int x = 0; x < width; x++) - /// { - /// myArray[x][y][z] = ct; - /// ct++; - /// } - /// } - /// } - /// \endcode - /// - /// Although the constructor and resize() functions both take the required dimensions - /// as an array of ints, note that the ArraySizes class can be used to build this - /// inline. This is a more convienient way of specifying these dimensions. - /// - /// Note also that this class has a private assignment operator and copy constructor - /// in order to prevent copying. This is because a deep copy is a potentially slow - /// operation and can often be performed inadvertently by functions such as std::swap, - /// while a shallow copy introduces confusion over memory ownership. - //////////////////////////////////////////////////////////////////////////////// template class Array { public: - ///Constructor - Array(); - ///Constructor - Array(const uint32_t (&pDimensions)[noOfDims]); - ///Destructor - ~Array(); - ///Subarray access - SubArray operator[](uint32_t uIndex); - ///Subarray access - const SubArray operator[](uint32_t uIndex) const; + Array(uint32_t width) + :m_pElements(0) + { + static_assert(noOfDims == 1, "This constructor can only be used with a one-dimensional array"); - ///Gets the total number of elements in this array - uint32_t getNoOfElements(void) const; - ///Gets a pointer to the first element of the array - ElementType* getRawData(void) const; + m_uDimensions[0] = width; - ///Resize the array to the specified dimensions - void resize(const uint32_t (&pDimensions)[noOfDims]); - ///Swaps the contents of this array with the one specified - void swap(Array& rhs); - ///Get the size of the Array along the specified dimension - uint32_t getDimension(uint32_t uDimension); + initialize(); + } + + Array(uint32_t width, uint32_t height) + :m_pElements(0) + { + static_assert(noOfDims == 2, "This constructor can only be used with a two-dimensional array"); + + m_uDimensions[0] = width; + m_uDimensions[1] = height; + + initialize(); + } + + Array(uint32_t width, uint32_t height, uint32_t depth) + :m_pElements(0) + { + static_assert(noOfDims == 3, "This constructor can only be used with a three-dimensional array"); + + m_uDimensions[0] = width; + m_uDimensions[1] = height; + m_uDimensions[2] = depth; + + initialize(); + } + + // These are deleted to avoid accidental copying. + Array(const Array&) = delete; + Array& operator=(const Array&) = delete; + + ~Array() + { + delete[] m_pElements; + } + + ElementType& operator()(uint32_t x) const + { + static_assert(noOfDims == 1, "This accessor can only be used with a one-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0], "Array access is out-of-range."); + return m_pElements[x]; + } + + ElementType& operator()(uint32_t x, uint32_t y) const + { + static_assert(noOfDims == 2, "This accessor can only be used with a two-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1], "Array access is out-of-range."); + return m_pElements[y * m_uDimensions[0] + x]; + } + + ElementType& operator()(uint32_t x, uint32_t y, uint32_t z) const + { + static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); + return m_pElements[z * m_uDimensions[1] * m_uDimensions[1] + y * m_uDimensions[0] + x]; + } + + uint32_t getDimension(uint32_t dimension) + { + return m_uDimensions[dimension]; + } + + ElementType* getRawData() + { + return m_pElements; + } + + uint32_t getNoOfElements() + { + return m_uNoOfElements; + } + + void swap(Array& other) + { + ElementType* temp = other.m_pElements; + other.m_pElements = m_pElements; + m_pElements = temp; + } private: - Array(const Array& rhs); - Array& operator=(const Array& rhs); + void initialize(void) + { + // Calculate the total number of elements in the array. + m_uNoOfElements = 1; + for (uint32_t i = 0; i < noOfDims; i++) + { + m_uNoOfElements *= m_uDimensions[i]; + } + m_pElements = new ElementType[m_uNoOfElements]; + } - void deallocate(void); - - uint32_t * m_pDimensions; - uint32_t * m_pOffsets; + uint32_t m_uDimensions[noOfDims]; uint32_t m_uNoOfElements; - ElementType * m_pElements; + ElementType* m_pElements; }; - template - class Array<1, ElementType> - { - public: - Array<1, ElementType>(); - - Array<1, ElementType>(const uint32_t (&pDimensions)[1]); - - ~Array<1, ElementType>(); - - ElementType& operator[] (uint32_t uIndex); - - const ElementType& operator[] (uint32_t uIndex) const; - - uint32_t getNoOfElements(void) const; - - ElementType* getRawData(void) const; - - void resize(const uint32_t (&pDimensions)[1]); - - void swap(Array<1, ElementType>& rhs); - - private: - Array<1, ElementType>(const Array<1, ElementType>& rhs); - - Array<1, ElementType>& operator=(const Array<1, ElementType>& rhs); - - void deallocate(void); - - uint32_t * m_pDimensions; - ElementType * m_pElements; - }; - - template - class Array<0, ElementType> - { - //Zero dimensional array is meaningless. - }; - - //Some handy typedefs ///A 1D Array of floats. - /*typedef Array<1,float> Array1DFloat; + typedef Array<1, float> Array1DFloat; ///A 1D Array of doubles. - typedef Array<1,double> Array1DDouble; + typedef Array<1, double> Array1DDouble; ///A 1D Array of signed 8-bit values. - typedef Array<1,int8_t> Array1DInt8; + typedef Array<1, int8_t> Array1DInt8; ///A 1D Array of unsigned 8-bit values. - typedef Array<1,uint8_t> Array1DUint8; + typedef Array<1, uint8_t> Array1DUint8; ///A 1D Array of signed 16-bit values. - typedef Array<1,int16_t> Array1DInt16; + typedef Array<1, int16_t> Array1DInt16; ///A 1D Array of unsigned 16-bit values. - typedef Array<1,uint16_t> Array1DUint16; + typedef Array<1, uint16_t> Array1DUint16; ///A 1D Array of signed 32-bit values. - typedef Array<1,int32_t> Array1DInt32; + typedef Array<1, int32_t> Array1DInt32; ///A 1D Array of unsigned 32-bit values. - typedef Array<1,uint32_t> Array1DUint32;*/ + typedef Array<1, uint32_t> Array1DUint32; ///A 2D Array of floats. - /*typedef Array<2,float> Array2DFloat; + typedef Array<2, float> Array2DFloat; ///A 2D Array of doubles. - typedef Array<2,double> Array2DDouble; + typedef Array<2, double> Array2DDouble; ///A 2D Array of signed 8-bit values. - typedef Array<2,int8_t> Array2DInt8; + typedef Array<2, int8_t> Array2DInt8; ///A 2D Array of unsigned 8-bit values. - typedef Array<2,uint8_t> Array2DUint8; + typedef Array<2, uint8_t> Array2DUint8; ///A 2D Array of signed 16-bit values. - typedef Array<2,int16_t> Array2DInt16; + typedef Array<2, int16_t> Array2DInt16; ///A 2D Array of unsigned 16-bit values. - typedef Array<2,uint16_t> Array2DUint16; + typedef Array<2, uint16_t> Array2DUint16; ///A 2D Array of signed 32-bit values. - typedef Array<2,int32_t> Array2DInt32; + typedef Array<2, int32_t> Array2DInt32; ///A 2D Array of unsigned 32-bit values. - typedef Array<2,uint32_t> Array2DUint32;*/ + typedef Array<2, uint32_t> Array2DUint32; ///A 3D Array of floats. - /*typedef Array<3,float> Array3DFloat; + typedef Array<3, float> Array3DFloat; ///A 3D Array of doubles. - typedef Array<3,double> Array3DDouble; + typedef Array<3, double> Array3DDouble; ///A 3D Array of signed 8-bit values. - typedef Array<3,int8_t> Array3DInt8; + typedef Array<3, int8_t> Array3DInt8; ///A 3D Array of unsigned 8-bit values. - typedef Array<3,uint8_t> Array3DUint8; + typedef Array<3, uint8_t> Array3DUint8; ///A 3D Array of signed 16-bit values. - typedef Array<3,int16_t> Array3DInt16; + typedef Array<3, int16_t> Array3DInt16; ///A 3D Array of unsigned 16-bit values. - typedef Array<3,uint16_t> Array3DUint16; + typedef Array<3, uint16_t> Array3DUint16; ///A 3D Array of signed 32-bit values. - typedef Array<3,int32_t> Array3DInt32; + typedef Array<3, int32_t> Array3DInt32; ///A 3D Array of unsigned 32-bit values. - typedef Array<3,uint32_t> Array3DUint32;*/ -}//namespace PolyVox + typedef Array<3, uint32_t> Array3DUint32; +} -#include "PolyVoxCore/Array.inl" - -#endif +#endif //__PolyVox_Array_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.inl b/library/PolyVoxCore/include/PolyVoxCore/Array.inl deleted file mode 100644 index 53f428ac..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.inl +++ /dev/null @@ -1,335 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// Creates an empty array with no elements. You will have to call resize() on this - /// array before it can be used. - //////////////////////////////////////////////////////////////////////////////// - template - Array::Array() - :m_pDimensions(0) - ,m_pOffsets(0) - ,m_uNoOfElements(0) - ,m_pElements(0) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Creates an array with the specified dimensions. - /// \param pDimensions The dimensions of the array. You can also use the ArraySizes - /// class to construct this more easily. - /// \sa ArraySizes - //////////////////////////////////////////////////////////////////////////////// - template - Array::Array(const uint32_t (&pDimensions)[noOfDims]) - :m_pDimensions(0) - ,m_pOffsets(0) - ,m_uNoOfElements(0) - ,m_pElements(0) - { - resize(pDimensions); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Destroys the array and releases all owned memory. - //////////////////////////////////////////////////////////////////////////////// - template - Array::~Array() - { - deallocate(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// An N-dimensional array can be conceptually consists of N subarrays each of which - /// has N-1 dimensions. For example, a 3D array conceptually consists of three 2D - /// arrays. This operator is used to access the subarray at the specified index. - /// Crucially, the subarray defines a similar operator allowing them to be chained - /// together to convieniently access a particular element. - /// \param uIndex The zero-based index of the subarray to retrieve. - /// \return The requested SubArray - //////////////////////////////////////////////////////////////////////////////// - template - SubArray Array::operator[](uint32_t uIndex) - { - POLYVOX_THROW_IF(uIndex >= m_pDimensions[0], std::out_of_range, "Array index out of range"); - - return - SubArray(&m_pElements[uIndex*m_pOffsets[0]], - m_pDimensions+1, m_pOffsets+1); - } - - //////////////////////////////////////////////////////////////////////////////// - /// An N-dimensional array can be conceptually consists of N subarrays each of which - /// has N-1 dimensions. For example, a 3D array conceptually consists of three 2D - /// arrays. This operator is used to access the subarray at the specified index. - /// Crucially, the subarray defines a similar operator allowing them to be chained - /// together to convieniently access a particular element. - /// \param uIndex The zero-based index of the subarray to retrieve. - /// \return The requested SubArray - //////////////////////////////////////////////////////////////////////////////// - template - const SubArray Array::operator[](uint32_t uIndex) const - { - POLYVOX_THROW_IF(uIndex >= m_pDimensions[0], std::out_of_range, "Array index out of range"); - - return - SubArray(&m_pElements[uIndex*m_pOffsets[0]], - m_pDimensions+1, m_pOffsets+1); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The number of elements in the array. - /// \sa getRawData() - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t Array::getNoOfElements(void) const - { - return m_uNoOfElements; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Sometimes it is useful to directly manipulate the underlying array without - /// going through this classes interface. Although this does not honour the principle - /// of encapsulation it can be done safely if you are careful and can sometimes be - /// useful. Use getNoOfElements() to determine how far you can safely write. - /// \return A pointer to the first element of the array - /// \sa getNoOfElements() - //////////////////////////////////////////////////////////////////////////////// - template - ElementType* Array::getRawData(void) const - { - return m_pElements; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Please note that the existing contents of the array will be lost. - /// \param pDimensions The new dimensions of the array. You can also use the - /// ArraySizes class to specify this more easily. - /// \sa ArraySizes - //////////////////////////////////////////////////////////////////////////////// - template - void Array::resize(const uint32_t (&pDimensions)[noOfDims]) - { - deallocate(); - - m_pDimensions = new uint32_t[noOfDims]; - m_pOffsets = new uint32_t[noOfDims]; - - // Calculate all the information you need to use the array - m_uNoOfElements = 1; - for (uint32_t i = 0; ii; k--) - { - m_pOffsets[i] *= pDimensions[k]; - } - } - // Allocate new elements, let exception propagate - m_pElements = new ElementType[m_uNoOfElements]; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Because this class does not have a public assignment operator or copy constructor - /// it cannot be used with the STL swap() function. This function provides an efficient - /// implementation of that feature. - /// \param rhs The array to swap this object with. - //////////////////////////////////////////////////////////////////////////////// - template - void Array::swap(Array& rhs) - { - //Implement this function without temporary 'Array' - //objects, as the destructors will free the memory... - uint32_t* m_pTempDimensions = m_pDimensions; - uint32_t* m_pTempOffsets = m_pOffsets; - uint32_t m_uTempNoOfElements = m_uNoOfElements; - ElementType* m_pTempElements = m_pElements; - - m_pDimensions = rhs.m_pDimensions; - m_pOffsets = rhs.m_pOffsets; - m_uNoOfElements = rhs.m_uNoOfElements; - m_pElements = rhs.m_pElements; - - rhs.m_pDimensions = m_pTempDimensions; - rhs.m_pOffsets = m_pTempOffsets; - rhs.m_uNoOfElements = m_uTempNoOfElements; - rhs.m_pElements = m_pTempElements; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uDimension The dimension to get the size of. - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t Array::getDimension(uint32_t uDimension) - { - POLYVOX_THROW_IF(uDimension >= noOfDims, std::out_of_range, "Array dimension out of range"); - - return m_pDimensions[uDimension]; - } - - template - Array::Array(const Array& rhs) - :m_pElements(0) - ,m_pDimensions(0) - ,m_pOffsets(0) - ,m_uNoOfElements(0) - { - //Not implemented - POLYVOX_THROW(not_implemented, "This function is not implemented and should never be called!"); - } - - template - Array& Array::operator=(const Array& rhs) - { - //Not implemented - POLYVOX_THROW(not_implemented, "This function is not implemented and should never be called!"); - - return *this; - } - - template - void Array::deallocate(void) - { - delete[] m_pDimensions; - m_pDimensions = 0; - delete[] m_pOffsets; - m_pOffsets = 0; - delete[] m_pElements; - m_pElements = 0; - - m_uNoOfElements = 0; - } - - //****************************************************************************// - // One dimensional specialisation begins here // - //****************************************************************************// - - template - Array<1, ElementType>::Array() - : m_pElements(0) - ,m_pDimensions(0) - { - } - - template - Array<1, ElementType>::Array(const uint32_t (&pDimensions)[1]) - : m_pElements(0) - ,m_pDimensions(0) - { - resize(pDimensions); - } - - template - Array<1, ElementType>::~Array() - { - deallocate(); - } - - template - ElementType& Array<1, ElementType>::operator[] (uint32_t uIndex) - { - POLYVOX_THROW_IF(uIndex >= m_pDimensions[0], std::out_of_range, "Array index out of range"); - - return m_pElements[uIndex]; - } - - template - const ElementType& Array<1, ElementType>::operator[] (uint32_t uIndex) const - { - POLYVOX_THROW_IF(uIndex >= m_pDimensions[0], std::out_of_range, "Array index out of range"); - - return m_pElements[uIndex]; - } - - template - uint32_t Array<1, ElementType>::getNoOfElements(void) const - { - return m_pDimensions[0]; - } - - template - ElementType* Array<1, ElementType>::getRawData(void) const - { - return m_pElements; - } - - template - void Array<1, ElementType>::resize(const uint32_t (&pDimensions)[1]) - { - deallocate(); - - m_pDimensions = new uint32_t[1]; - m_pDimensions[0] = pDimensions[0]; - - // Allocate new elements, let exception propagate - m_pElements = new ElementType[m_pDimensions[0]]; - } - - template - void Array<1, ElementType>::swap(Array<1, ElementType>& rhs) - { - //Implement this function without temporary 'Array' - //objects, as the destructors will free the memory... - uint32_t* m_pTempDimensions = m_pDimensions; - ElementType* m_pTempElements = m_pElements; - - m_pDimensions = rhs.m_pDimensions; - m_pElements = rhs.m_pElements; - - rhs.m_pDimensions = m_pTempDimensions; - rhs.m_pElements = m_pTempElements; - } - - template - Array<1, ElementType>::Array(const Array<1, ElementType>& rhs) - : m_pElements(0) - ,m_pDimensions(0) - { - //Not implemented - POLYVOX_THROW(not_implemented, "This function is not implemented and should never be called!"); - } - - template - Array<1, ElementType>& Array<1, ElementType>::operator=(const Array<1, ElementType>& rhs) - { - //Not implemented - POLYVOX_THROW(not_implemented, "This function is not implemented and should never be called!"); - - return *this; - } - - template - void Array<1, ElementType>::deallocate(void) - { - delete[] m_pDimensions; - m_pDimensions = 0; - delete[] m_pElements; - m_pElements = 0; - } -}//namespace PolyVox diff --git a/library/PolyVoxCore/include/PolyVoxCore/ArraySizes.h b/library/PolyVoxCore/include/PolyVoxCore/ArraySizes.h deleted file mode 100644 index 93bd6d0c..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/ArraySizes.h +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __PolyVox_ArraySizes_H__ -#define __PolyVox_ArraySizes_H__ - -#include "Impl/ArraySizesImpl.h" -#include "Impl/TypeDef.h" - -namespace PolyVox -{ - ///The ArraySizes class provide a convienient way to specify the dimensions of an Array. - //////////////////////////////////////////////////////////////////////////////// - /// The Array class requires an array of integers to be passed to the constructor - /// to specify the dimensions of the Array to be built. C++ does not allow this to - /// be done in place, and so it typically requires an extra line of code - something - /// like this: - /// - /// \code - /// uint32_t dimensions[3] = {10, 20, 30}; // Array dimensions - /// Array<3,float> array(dimensions); - /// \endcode - /// - /// The ArraySizes class can be constructed in place, and also provides implicit - /// conversion to an array of integers. Hence it is now possible to declare the - /// above Array as follows: - /// - /// \code - /// Array<3,float> array(ArraySizes(10)(20)(30)); - /// \endcode - /// - /// Usage of this class is therefore very simple, although the template code - /// behind it may appear complex. For reference, it is based upon the article here: - /// http://www.drdobbs.com/cpp/184401319/ - //////////////////////////////////////////////////////////////////////////////// - class POLYVOX_API ArraySizes - { - typedef const uint32_t (&UIntArray1)[1]; - - public: - /// Constructor - explicit ArraySizes(uint32_t uSize); - - /// Duplicates this object but with an extra dimension - ArraySizesImpl<2> operator () (uint32_t uSize); - - /// Converts this object to an array of integers - operator UIntArray1 () const; - - private: - // This class is only one dimensional. Higher dimensions - // are implemented via the ArraySizesImpl class. - uint32_t m_pSizes[1]; - }; -}//namespace PolyVox - -#endif //__PolyVox_ArraySizes_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index edf8ea7a..bcf4247d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -43,6 +43,8 @@ namespace PolyVox ,m_bMergeQuads(bMergeQuads) ,m_eWrapMode(eWrapMode) ,m_tBorderValue(tBorderValue) + ,m_previousSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) + ,m_currentSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) { m_funcIsQuadNeededCallback = isQuadNeeded; @@ -59,12 +61,12 @@ namespace PolyVox Timer timer; m_meshCurrent->clear(); - uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2; - uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2; + //uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2; + //uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2; - uint32_t arraySize[3]= {uArrayWidth, uArrayHeight, MaxVerticesPerPosition}; - m_previousSliceVertices.resize(arraySize); - m_currentSliceVertices.resize(arraySize); + //uint32_t arraySize[3]= {uArrayWidth, uArrayHeight, MaxVerticesPerPosition}; + //m_previousSliceVertices.resize(arraySize); + //m_currentSliceVertices.resize(arraySize); memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); @@ -209,7 +211,7 @@ namespace PolyVox { for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) { - IndexAndMaterial& rEntry = existingVertices[uX][uY][ct]; + IndexAndMaterial& rEntry = existingVertices(uX, uY, ct); if(rEntry.iIndex == -1) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h deleted file mode 100644 index 6eaeace4..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Array2D.h +++ /dev/null @@ -1,188 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-20014 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Array2D_H__ -#define __PolyVox_Array2D_H__ - -#include - -#include - -namespace PolyVox -{ - template - class Array2D - { - public: - - Array2D(uint32_t width) - :m_pElements(0) - { - static_assert(noOfDims == 1, "This constructor can only be used with a one-dimensional array"); - - m_uDimensions[0] = width; - - initialize(); - } - - Array2D(uint32_t width, uint32_t height) - :m_pElements(0) - { - static_assert(noOfDims == 2, "This constructor can only be used with a two-dimensional array"); - - m_uDimensions[0] = width; - m_uDimensions[1] = height; - - initialize(); - } - - Array2D(uint32_t width, uint32_t height, uint32_t depth) - :m_pElements(0) - { - static_assert(noOfDims == 3, "This constructor can only be used with a three-dimensional array"); - - m_uDimensions[0] = width; - m_uDimensions[1] = height; - m_uDimensions[2] = depth; - - initialize(); - } - - // These are deleted to avoid accidental copying. - Array2D(const Array2D&) = delete; - Array2D& operator=(const Array2D&) = delete; - - ~Array2D() - { - delete[] m_pElements; - } - - ElementType& operator()(uint32_t x) const - { - static_assert(noOfDims == 1, "This accessor can only be used with a one-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0], "Array access is out-of-range."); - return m_pElements[x]; - } - - ElementType& operator()(uint32_t x, uint32_t y) const - { - static_assert(noOfDims == 2, "This accessor can only be used with a two-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1], "Array access is out-of-range."); - return m_pElements[y * m_uDimensions[0] + x]; - } - - ElementType& operator()(uint32_t x, uint32_t y, uint32_t z) const - { - static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); - return m_pElements[z * m_uDimensions[1] * m_uDimensions[1] + y * m_uDimensions[0] + x]; - } - - ElementType* getRawData() - { - return m_pElements; - } - - uint32_t getNoOfElements() - { - return m_uNoOfElements; - } - - void swap(Array2D& other) - { - ElementType* temp = other.m_pElements; - other.m_pElements = m_pElements; - m_pElements = temp; - } - - private: - - void initialize(void) - { - // Calculate the total number of elements in the array. - m_uNoOfElements = 1; - for (uint32_t i = 0; i < noOfDims; i++) - { - m_uNoOfElements *= m_uDimensions[i]; - } - m_pElements = new ElementType[m_uNoOfElements]; - } - - uint32_t m_uDimensions[noOfDims]; - uint32_t m_uNoOfElements; - ElementType* m_pElements; - }; - - ///A 1D Array of floats. - typedef Array2D<1, float> Array1DFloat; - ///A 1D Array of doubles. - typedef Array2D<1, double> Array1DDouble; - ///A 1D Array of signed 8-bit values. - typedef Array2D<1, int8_t> Array1DInt8; - ///A 1D Array of unsigned 8-bit values. - typedef Array2D<1, uint8_t> Array1DUint8; - ///A 1D Array of signed 16-bit values. - typedef Array2D<1, int16_t> Array1DInt16; - ///A 1D Array of unsigned 16-bit values. - typedef Array2D<1, uint16_t> Array1DUint16; - ///A 1D Array of signed 32-bit values. - typedef Array2D<1, int32_t> Array1DInt32; - ///A 1D Array of unsigned 32-bit values. - typedef Array2D<1, uint32_t> Array1DUint32; - - ///A 2D Array of floats. - typedef Array2D<2, float> Array2DFloat; - ///A 2D Array of doubles. - typedef Array2D<2, double> Array2DDouble; - ///A 2D Array of signed 8-bit values. - typedef Array2D<2, int8_t> Array2DInt8; - ///A 2D Array of unsigned 8-bit values. - typedef Array2D<2, uint8_t> Array2DUint8; - ///A 2D Array of signed 16-bit values. - typedef Array2D<2, int16_t> Array2DInt16; - ///A 2D Array of unsigned 16-bit values. - typedef Array2D<2, uint16_t> Array2DUint16; - ///A 2D Array of signed 32-bit values. - typedef Array2D<2, int32_t> Array2DInt32; - ///A 2D Array of unsigned 32-bit values. - typedef Array2D<2, uint32_t> Array2DUint32; - - ///A 3D Array of floats. - typedef Array2D<3, float> Array3DFloat; - ///A 3D Array of doubles. - typedef Array2D<3, double> Array3DDouble; - ///A 3D Array of signed 8-bit values. - typedef Array2D<3, int8_t> Array3DInt8; - ///A 3D Array of unsigned 8-bit values. - typedef Array2D<3, uint8_t> Array3DUint8; - ///A 3D Array of signed 16-bit values. - typedef Array2D<3, int16_t> Array3DInt16; - ///A 3D Array of unsigned 16-bit values. - typedef Array2D<3, uint16_t> Array3DUint16; - ///A 3D Array of signed 32-bit values. - typedef Array2D<3, int32_t> Array3DInt32; - ///A 3D Array of unsigned 32-bit values. - typedef Array2D<3, uint32_t> Array3DUint32; -} - -#endif //__PolyVox_Array2D_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h deleted file mode 100644 index 3a65c217..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __PolyVox_ArraySizesImpl_H__ -#define __PolyVox_ArraySizesImpl_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - /* - This class provides the implementation details behind ArraySizes. It is actually - quite similar to ArraySizes, but an important difference is that it is templatised - whereas ArraySizes is not. This allows us to use a recursive template pattern without - exposing the use of templates to the user. - - It is based on the following article: http://www.drdobbs.com/cpp/184401319 - */ - template - class ArraySizesImpl - { - typedef const uint32_t (&UIntArrayN)[N]; - - friend class ArraySizes; - friend class ArraySizesImpl; - - public: - ArraySizesImpl operator () (uint32_t uSize); - - operator UIntArrayN () const; - - private: - ArraySizesImpl(const uint32_t (&pSizes)[N-1], uint32_t uSize); - - uint32_t m_pSizes[N]; - }; -}//namespace PolyVox - -#include "PolyVoxCore/Impl/ArraySizesImpl.inl" - -#endif //__PolyVox_ArraySizesImpl_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.inl b/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.inl deleted file mode 100644 index 13836476..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.inl +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#include - -namespace PolyVox -{ - template - ArraySizesImpl ArraySizesImpl::operator () (uint32_t uSize) - { - return ArraySizesImpl(m_pSizes, uSize); - } - - template - ArraySizesImpl::operator UIntArrayN () const - { - return m_pSizes; - } - - template - ArraySizesImpl::ArraySizesImpl(const uint32_t (&pSizes)[N-1], uint32_t uSize) - { - std::copy(&pSizes[0],&pSizes[N-1],m_pSizes); - m_pSizes[N-1]=uSize; - } -}//namespace PolyVox diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h deleted file mode 100644 index 3e70a02c..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_SubArray_H__ -#define __PolyVox_SubArray_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - template class Array; - - /* - This class forms part of the implementation of the Array class. The operator[] - return a SubArray of the next size down, so that multiple []'s can be chained - together. It is a seperate class from Array so that it can have a reduced interface, - and also so that it never takes ownership of the memory to which it points. - - It is based on the following article: http://www.drdobbs.com/cpp/184401319 - */ - template - class SubArray - { - friend class Array; - friend class SubArray; - - public: - SubArray operator [](uint32_t uIndex); - - const SubArray operator [](uint32_t uIndex) const; - - private: - SubArray(ElementType * pElements, uint32_t * pDimensions, uint32_t * pOffsets); - - uint32_t * m_pDimensions; - uint32_t * m_pOffsets; - uint32_t m_uNoOfElements; - ElementType * m_pElements; - }; - - template - class SubArray<1, ElementType> - { - friend class Array<2, ElementType>; - friend class SubArray<2, ElementType>; - - public: - ElementType & operator [] (uint32_t uIndex); - - const ElementType & operator [] (uint32_t uIndex) const; - - private: - SubArray<1, ElementType>(ElementType * pElements, uint32_t * pDimensions, uint32_t * /*pOffsets*/); - - uint32_t * m_pDimensions; - ElementType * m_pElements; - }; - - template - class SubArray<0, ElementType> - { - //Zero dimensional subarray is meaningless. - }; -}//namespace PolyVox - -#include "PolyVoxCore/Impl/SubArray.inl" - -#endif //__PolyVox_SubArray_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.inl b/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.inl deleted file mode 100644 index 81c526c3..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.inl +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -namespace PolyVox -{ - template - SubArray SubArray::operator[](uint32_t uIndex) - { - if(uIndex >= m_pDimensions[0]) - { - POLYVOX_THROW(std::out_of_range, "Array index out of range"); - } - - return - SubArray(&m_pElements[uIndex*m_pOffsets[0]], - m_pDimensions+1, m_pOffsets+1); - } - - template - const SubArray SubArray::operator[](uint32_t uIndex) const - { - if(uIndex >= m_pDimensions[0]) - { - POLYVOX_THROW(std::out_of_range, "Array index out of range"); - } - - return - SubArray(&m_pElements[uIndex*m_pOffsets[0]], - m_pDimensions+1, m_pOffsets+1); - } - - template - SubArray::SubArray(ElementType * pElements, uint32_t * pDimensions, uint32_t * pOffsets) - :m_pDimensions(pDimensions) - ,m_pOffsets(pOffsets) - ,m_uNoOfElements(0) - ,m_pElements(pElements) - { - } - - - template - ElementType& SubArray<1, ElementType>::operator[] (uint32_t uIndex) - { - if(uIndex >= m_pDimensions[0]) - { - POLYVOX_THROW(std::out_of_range, "Array index out of range"); - } - - return m_pElements[uIndex]; - } - - template - const ElementType& SubArray<1, ElementType>::operator[] (uint32_t uIndex) const - { - if(uIndex >= m_pDimensions[0]) - { - POLYVOX_THROW(std::out_of_range, "Array index out of range"); - } - - return m_pElements[uIndex]; - } - - template - SubArray<1, ElementType>::SubArray(ElementType * pElements, uint32_t * pDimensions, uint32_t * /*pOffsets*/) - :m_pDimensions(pDimensions) - ,m_pElements(pElements) - { - } -}//namespace PolyVox diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 62ccbff6..cf42800e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "Impl/MarchingCubesTables.h" #include "Impl/TypeDef.h" -#include "PolyVoxCore/Impl/Array2D.h" +#include "PolyVoxCore/Array.h" #include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/DefaultMarchingCubesController.h" diff --git a/library/PolyVoxCore/source/ArraySizes.cpp b/library/PolyVoxCore/source/ArraySizes.cpp deleted file mode 100644 index 52755a73..00000000 --- a/library/PolyVoxCore/source/ArraySizes.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/ArraySizes.h" - -#include - -namespace PolyVox -{ - /** - \param uSize The size of the first dimension. - */ - ArraySizes::ArraySizes(uint32_t uSize) - { - m_pSizes[0]=uSize; - } - - /** - This class only directly implements one dimensional sizes. Higher numbers - of dimensions are implemented via the ArraySisesImpl class. This function - create an object of the next dimensionality up. - \param uSize The size of the next dimension. - \return A higher dimension version of this class. - */ - ArraySizesImpl<2> ArraySizes::operator () (uint32_t uSize) - { - return ArraySizesImpl<2>(m_pSizes, uSize); - } - - /** - \return The array of integers corresponding to this object. - */ - ArraySizes::operator UIntArray1 () const - { - return m_pSizes; - } -} diff --git a/tests/TestAmbientOcclusionGenerator.cpp b/tests/TestAmbientOcclusionGenerator.cpp index 667acce4..cb077ec2 100644 --- a/tests/TestAmbientOcclusionGenerator.cpp +++ b/tests/TestAmbientOcclusionGenerator.cpp @@ -68,7 +68,7 @@ void TestAmbientOcclusionGenerator::testExecute() //Create an array to store the result. Array can be smaller than the volume by an integer amount. const int32_t g_uArraySideLength = g_uVolumeSideLength / 2; - Array<3, uint8_t> ambientOcclusionResult(ArraySizes(g_uArraySideLength)(g_uArraySideLength)(g_uArraySideLength)); + Array<3, uint8_t> ambientOcclusionResult(g_uArraySideLength, g_uArraySideLength, g_uArraySideLength); // Calculate the ambient occlusion values IsVoxelTransparent isVoxelTransparent; @@ -78,11 +78,11 @@ void TestAmbientOcclusionGenerator::testExecute() //Check the results by sampling along a line though the centre of the volume. Because //of the two walls we added, samples in the middle are darker than those at the edge. - QCOMPARE(static_cast(ambientOcclusionResult[16][ 0][16]), 178); - QCOMPARE(static_cast(ambientOcclusionResult[16][ 8][16]), 109); - QCOMPARE(static_cast(ambientOcclusionResult[16][16][16]), 103); - QCOMPARE(static_cast(ambientOcclusionResult[16][24][16]), 123); - QCOMPARE(static_cast(ambientOcclusionResult[16][31][16]), 173); + QCOMPARE(static_cast(ambientOcclusionResult(16, 0, 16)), 178); + QCOMPARE(static_cast(ambientOcclusionResult(16, 8, 16)), 109); + QCOMPARE(static_cast(ambientOcclusionResult(16, 16, 16)), 103); + QCOMPARE(static_cast(ambientOcclusionResult(16, 24, 16)), 123); + QCOMPARE(static_cast(ambientOcclusionResult(16, 31, 16)), 173); //Just run a quick test to make sure that it compiles when taking a function pointer calculateAmbientOcclusion(&volData, &ambientOcclusionResult, volData.getEnclosingRegion(), 32.0f, 8, &isVoxelTransparentFunction); diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 84d4bf14..359a2abf 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -25,8 +25,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" -#include "PolyVoxCore/Impl/Array2D.h" - #include using namespace PolyVox; @@ -64,34 +62,7 @@ void TestArray::testPolyVoxArraySpeed() const int height = 32; const int depth = 32; - Array<3, int> polyvoxArray(ArraySizes(width)(height)(depth)); - - QBENCHMARK - { - int ct = 1; - int expectedTotal = 0; - for (int z = 0; z < depth; z++) - { - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - polyvoxArray[x][y][z] = ct; - expectedTotal += polyvoxArray[x][y][z]; - ct++; - } - } - } - } -} - -void TestArray::testPolyVoxArray2DSpeed() -{ - const int width = 32; - const int height = 32; - const int depth = 32; - - Array2D<3, int> polyvoxArray(width, height, depth); + Array<3, int> polyvoxArray(width, height, depth); QBENCHMARK { @@ -118,7 +89,7 @@ void TestArray::testReadWrite() int height = 10; int depth = 20; - Array<3, int> myArray(ArraySizes(width)(height)(depth)); + Array<3, int> myArray(width, height, depth); int ct = 1; int expectedTotal = 0; @@ -128,8 +99,8 @@ void TestArray::testReadWrite() { for(int x = 0; x < width; x++) { - myArray[x][y][z] = ct; - expectedTotal += myArray[x][y][z]; + myArray(x, y, z) = ct; + expectedTotal += myArray(x, y, z); ct++; } } @@ -143,8 +114,8 @@ void TestArray::testReadWrite() { for(int x = 0; x < width; x++) { - QCOMPARE(myArray[x][y][z], ct); - total += myArray[x][y][z]; + QCOMPARE(myArray(x, y, z), ct); + total += myArray(x, y, z); ct++; } } diff --git a/tests/TestArray.h b/tests/TestArray.h index bd5425a6..2d3e5951 100644 --- a/tests/TestArray.h +++ b/tests/TestArray.h @@ -33,7 +33,6 @@ class TestArray: public QObject private slots: void testCArraySpeed(); void testPolyVoxArraySpeed(); - void testPolyVoxArray2DSpeed(); void testReadWrite(); }; diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index b8848c11..1db0065e 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "TestVolumeSubclass.h" -#include "PolyVoxCore/Impl/Array2D.h" +#include "PolyVoxCore/Array.h" #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/CubicSurfaceExtractor.h" @@ -167,7 +167,7 @@ public: //void resize(const Region& regValidRegion); private: - Array2D<3, VoxelType> mVolumeData; + Array<3, VoxelType> mVolumeData; }; void TestVolumeSubclass::testExtractSurface() From 089303f02f4a2e9eb829f532093fb7ce3d44f8a1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 24 Aug 2014 23:05:29 +0200 Subject: [PATCH 188/259] Fix for example. --- examples/DecodeOnGPU/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 7f2d83c8..34c86bef 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -115,6 +115,9 @@ OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVe meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); meshData.scale = scale; + // Set 16 or 32-bit index buffer size. + meshData.indexType = sizeof(PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; + return meshData; } From 25860122b06062c562980eedcf35a172c1120c5c Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 25 Aug 2014 23:07:29 +0200 Subject: [PATCH 189/259] Fixed incorrect array indexing. --- library/PolyVoxCore/include/PolyVoxCore/Array.h | 2 +- tests/TestArray.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index 4ec0f616..276a4f1e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -95,7 +95,7 @@ namespace PolyVox { static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); - return m_pElements[z * m_uDimensions[1] * m_uDimensions[1] + y * m_uDimensions[0] + x]; + return m_pElements[z * m_uDimensions[0] * m_uDimensions[1] + y * m_uDimensions[0] + x]; } uint32_t getDimension(uint32_t dimension) diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 359a2abf..67e0143b 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -31,9 +31,9 @@ using namespace PolyVox; void TestArray::testCArraySpeed() { - const int width = 32; + const int width = 64; const int height = 32; - const int depth = 32; + const int depth = 16; int cArray[width][height][depth]; @@ -58,9 +58,9 @@ void TestArray::testCArraySpeed() void TestArray::testPolyVoxArraySpeed() { - const int width = 32; + const int width = 64; const int height = 32; - const int depth = 32; + const int depth = 16; Array<3, int> polyvoxArray(width, height, depth); From a9f1a29868156b95bd33521b5de57c981ba99888 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 5 Sep 2014 16:06:40 +0200 Subject: [PATCH 190/259] Adding Vector performance test. --- tests/testvector.cpp | 22 ++++++++++++++++++++++ tests/testvector.h | 1 + 2 files changed, 23 insertions(+) diff --git a/tests/testvector.cpp b/tests/testvector.cpp index 78d24383..08649f28 100644 --- a/tests/testvector.cpp +++ b/tests/testvector.cpp @@ -29,6 +29,12 @@ freely, subject to the following restrictions: using namespace PolyVox; +Vector3DFloat incrementVector(Vector3DFloat input) +{ + Vector3DFloat result = input += 1.0f; + return result; +} + void TestVector::testLength() { Vector3DInt8 vec(3, 4, 5); @@ -51,4 +57,20 @@ void TestVector::testEquality() QCOMPARE(vecxy != vecz, true); } +void TestVector::testPerformance() +{ + Vector3DFloat vec(1.0, 1.0, 1.0); + + QBENCHMARK + { + for(uint32_t ct = 0; ct < 10000000; ct++) + { + vec = incrementVector(vec); + } + } + + // Use the result so the calls don't get optimized away. + QCOMPARE(vec.lengthSquared() > 0.0f, true); +} + QTEST_MAIN(TestVector) diff --git a/tests/testvector.h b/tests/testvector.h index baad1e3d..53ed5718 100644 --- a/tests/testvector.h +++ b/tests/testvector.h @@ -34,6 +34,7 @@ class TestVector: public QObject void testLength(); void testDotProduct(); void testEquality(); + void testPerformance(); }; #endif From 882798ccb8f17c5749eb5ed7cc7c4bd6be6c3a1e Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 12 Sep 2014 00:02:06 +0200 Subject: [PATCH 191/259] Modifying surface extractor test to work with LargeVolume. --- tests/TestSurfaceExtractor.cpp | 37 +++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 496c39ac..440e8a73 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -24,9 +24,12 @@ freely, subject to the following restrictions: #include "TestSurfaceExtractor.h" #include "PolyVoxCore/Density.h" +#include "PolyVoxCore/FilePager.h" +#include "PolyVoxCore/MinizBlockCompressor.h" #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/LargeVolume.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include @@ -95,13 +98,16 @@ void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) voxel.setMaterial(valueToWrite); } -template -SimpleVolume* createAndFillVolume(void) +template +VolumeType* createAndFillVolume(void) { const int32_t uVolumeSideLength = 64; + MinizBlockCompressor* compressor = new MinizBlockCompressor(); + FilePager* pager = new FilePager("./"); + //Create empty volume - SimpleVolume* volData = new SimpleVolume(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), compressor, pager); // Fill for (int32_t z = 0; z < uVolumeSideLength; z++) @@ -112,9 +118,9 @@ SimpleVolume* createAndFillVolume(void) { // Create a density field which changes throughout the volume. It's // zero in the lower corner and increasing as the coordinates increase. - VoxelType voxelValue; - writeDensityValueToVoxel(x + y + z, voxelValue); - writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); + VolumeType::VoxelType voxelValue; + writeDensityValueToVoxel(x + y + z, voxelValue); + writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); volData->setVoxelAt(x, y, z, voxelValue); } } @@ -135,8 +141,11 @@ float randomFloat(float a, float b) template VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) { + MinizBlockCompressor* compressor = new MinizBlockCompressor(); + FilePager* pager = new FilePager("./"); + //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), compressor, pager); // Seed generator for consistency between runs. srand(12345); @@ -167,7 +176,7 @@ void TestSurfaceExtractor::testBehaviour() // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. - auto uintVol = createAndFillVolume(); + auto uintVol = createAndFillVolume< LargeVolume >(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh @@ -175,7 +184,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type // This test makes use of a custom controller - auto floatVol = createAndFillVolume(); + auto floatVol = createAndFillVolume< LargeVolume >(); CustomMarchingCubesController floatCustomController; auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices @@ -185,7 +194,7 @@ void TestSurfaceExtractor::testBehaviour() // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us // use a default for the second-to-last parameter but noot use a default for the last parameter. - auto intVol = createAndFillVolume(); + auto intVol = createAndFillVolume< LargeVolume >(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices @@ -194,7 +203,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type // This test makes use of a user-provided mesh and also a custom controller. - auto doubleVol = createAndFillVolume(); + auto doubleVol = createAndFillVolume< LargeVolume >(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); @@ -204,7 +213,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type // This test ensures the extractor works on a non-primitive voxel type. - auto materialVol = createAndFillVolume(); + auto materialVol = createAndFillVolume< LargeVolume >(); auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh @@ -214,7 +223,7 @@ void TestSurfaceExtractor::testBehaviour() void TestSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -2.0f, -1.0f); + auto emptyVol = createAndFillVolumeWithNoise< LargeVolume >(128, -2.0f, -1.0f); Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); @@ -222,7 +231,7 @@ void TestSurfaceExtractor::testEmptyVolumePerformance() void TestSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, -1.0f, 1.0f); + auto noiseVol = createAndFillVolumeWithNoise< LargeVolume >(128, -1.0f, 1.0f); Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); From 4781ca5c42c42faec1be7ab0f9d3e3133f4453ff Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 12 Sep 2014 15:36:28 +0200 Subject: [PATCH 192/259] Work on removing compression from LargeVolume. --- examples/Paging/main.cpp | 14 +++++------ .../include/PolyVoxCore/FilePager.h | 10 ++++---- .../include/PolyVoxCore/LargeVolume.inl | 24 +++++++++++++------ .../PolyVoxCore/include/PolyVoxCore/Pager.h | 6 ++--- tests/testvolume.cpp | 8 +++---- tests/testvolume.h | 4 ++-- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 58e94b5d..53c3f161 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -91,11 +91,11 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, CompressedBlock* pBlockData) + virtual void pageIn(const PolyVox::Region& region, UncompressedBlock* pBlockData) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... - UncompressedBlock block(256); + //UncompressedBlock block(256); Perlin perlin(2,2,1,234); @@ -133,18 +133,18 @@ public: // Voxel position within a block always start from zero. So if a block represents region (4, 8, 12) to (11, 19, 15) // then the valid block voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the // region from the volume space position in order to get the block space position. - block.setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); + pBlockData->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); } } } // Now compress the computed data into the provided block. - RLEBlockCompressor* compressor = new RLEBlockCompressor(); - compressor->compress(&block, pBlockData); - delete compressor; + //RLEBlockCompressor* compressor = new RLEBlockCompressor(); + //compressor->compress(&block, pBlockData); + //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, CompressedBlock* /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, UncompressedBlock* /*pBlockData*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 830e0374..5e0a6081 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -68,7 +68,7 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, CompressedBlock* pBlockData) + virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); @@ -88,14 +88,16 @@ namespace PolyVox { POLYVOX_LOG_TRACE("Paging in data for " << region); - fseek(pFile, 0L, SEEK_END); + /*fseek(pFile, 0L, SEEK_END); size_t fileSizeInBytes = ftell(pFile); fseek(pFile, 0L, SEEK_SET); uint8_t* buffer = new uint8_t[fileSizeInBytes]; fread(buffer, sizeof(uint8_t), fileSizeInBytes, pFile); pBlockData->setData(buffer, fileSizeInBytes); - delete[] buffer; + delete[] buffer;*/ + + fread(pBlockData->getData(), sizeof(uint8_t), pBlockData->getDataSizeInBytes(), pFile); if(ferror(pFile)) { @@ -110,7 +112,7 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, CompressedBlock* pBlockData) + virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 8c12aa45..b17eb128 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -571,7 +571,7 @@ namespace PolyVox Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength-1, m_uBlockSideLength-1, m_uBlockSideLength-1); // Page the data out - m_pPager->pageOut(Region(v3dLower, v3dUpper), pCompressedBlock); + //m_pPager->pageOut(Region(v3dLower, v3dUpper), pCompressedBlock); // The compressed data is no longer modified with respect to the data on disk pCompressedBlock->m_bDataModified = false; @@ -591,7 +591,7 @@ namespace PolyVox // This should never happen as blocks are deleted based on being least recently used. // I the case that we are flushing we delete all blocks, but the flush function will // reset the 'm_pLastAccessedBlock' anyway to prevent it being accidentally reused. - POLYVOX_ASSERT(pUncompressedBlock != m_pLastAccessedBlock, "Attempted to delete last accessed block."); + //POLYVOX_ASSERT(pUncompressedBlock != m_pLastAccessedBlock, "Attempted to delete last accessed block."); // Before deleting the block we may need to recompress its data. We // only do this if the data has been modified since it was decompressed. @@ -599,9 +599,13 @@ namespace PolyVox { // Get the compressed block which we will copy the data back in to. Vector3DInt32 v3dBlockPos = itUncompressedBlock->first; - CompressedBlock* pCompressedBlock = getCompressedBlock(v3dBlockPos.getX(), v3dBlockPos.getY(), v3dBlockPos.getZ()); - m_pBlockCompressor->compress(pUncompressedBlock, pCompressedBlock); + // From the coordinates of the block we deduce the coordinates of the contained voxels. + Vector3DInt32 v3dLower(v3dBlockPos.getX() << m_uBlockSideLengthPower, v3dBlockPos.getY() << m_uBlockSideLengthPower, v3dBlockPos.getZ() << m_uBlockSideLengthPower); + Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); + + // Page the data out + m_pPager->pageOut(Region(v3dLower, v3dUpper), itUncompressedBlock->second); // The compressed data has been updated, so the uncompressed data is no longer modified with respect to it. pUncompressedBlock->m_bDataModified = false; @@ -679,13 +683,19 @@ namespace PolyVox // An uncompressed bock is always backed by a compressed one, and this is created by getCompressedBlock() if it doesn't // already exist. If it does already exist and has data then we bring this across into the ucompressed version. - if(getCompressedBlock(uBlockX, uBlockY, uBlockZ)->getData() != 0) + /*if(getCompressedBlock(uBlockX, uBlockY, uBlockZ)->getData() != 0) { // FIXME - multiple getCompressedBlock() calls (including the one above) - CompressedBlock* pBlock = getCompressedBlock(uBlockX, uBlockY, uBlockZ); + CompressedBlock* pBlock = getCompressedBlock(uBlockX, uBlockY, ); m_pBlockCompressor->decompress(pBlock, pUncompressedBlock); - } + }*/ + + // Pass the block to the Pager to give it a chance to initialise it with any data + Vector3DInt32 v3dLower(uBlockX << m_uBlockSideLengthPower, uBlockY << m_uBlockSideLengthPower, uBlockZ << m_uBlockSideLengthPower); + Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); + Region reg(v3dLower, v3dUpper); + m_pPager->pageIn(reg, pUncompressedBlock); // Add our new block to the map. m_pUncompressedBlockCache.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index eb37e4f7..c11d8afd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Pager_H__ #define __PolyVox_Pager_H__ -#include "PolyVoxCore/CompressedBlock.h" +#include "PolyVoxCore/UncompressedBlock.h" #include "PolyVoxCore/Impl/TypeDef.h" namespace PolyVox @@ -41,8 +41,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, CompressedBlock* pBlockData) = 0; - virtual void pageOut(const Region& region, CompressedBlock* pBlockData) = 0; + virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) = 0; + virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) = 0; }; } diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index f879f1bf..4a0d65e1 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -313,7 +313,7 @@ TestVolume::~TestVolume() * RawVolume Tests */ -void TestVolume::testRawVolumeDirectAccessAllInternalForwards() +/*void TestVolume::testRawVolumeDirectAccessAllInternalForwards() { int32_t result = 0; @@ -399,13 +399,13 @@ void TestVolume::testRawVolumeSamplersWithExternalBackwards() result = testSamplersWithWrappingBackwards(m_pRawVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-769775893)); -} +}*/ /* * SimpleVolume Tests */ -void TestVolume::testSimpleVolumeDirectAccessAllInternalForwards() +/*void TestVolume::testSimpleVolumeDirectAccessAllInternalForwards() { int32_t result = 0; QBENCHMARK @@ -483,7 +483,7 @@ void TestVolume::testSimpleVolumeSamplersWithExternalBackwards() result = testSamplersWithWrappingBackwards(m_pSimpleVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-769775893)); -} +}*/ /* * LargeVolume Tests diff --git a/tests/testvolume.h b/tests/testvolume.h index 9db5f7a0..57390641 100644 --- a/tests/testvolume.h +++ b/tests/testvolume.h @@ -37,7 +37,7 @@ public: ~TestVolume(); private slots: - void testRawVolumeDirectAccessAllInternalForwards(); + /*void testRawVolumeDirectAccessAllInternalForwards(); void testRawVolumeSamplersAllInternalForwards(); void testRawVolumeDirectAccessWithExternalForwards(); void testRawVolumeSamplersWithExternalForwards(); @@ -53,7 +53,7 @@ private slots: void testSimpleVolumeDirectAccessAllInternalBackwards(); void testSimpleVolumeSamplersAllInternalBackwards(); void testSimpleVolumeDirectAccessWithExternalBackwards(); - void testSimpleVolumeSamplersWithExternalBackwards(); + void testSimpleVolumeSamplersWithExternalBackwards();*/ void testLargeVolumeDirectAccessAllInternalForwards(); void testLargeVolumeSamplersAllInternalForwards(); From bfe03142b7e7669e97905ea29abf514d5bb677f0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 13 Sep 2014 11:30:52 +0200 Subject: [PATCH 193/259] Carefully dismanteling compression related code. --- .../include/PolyVoxCore/BlockCompressor.h | 2 +- .../include/PolyVoxCore/Impl/MinizWrapper.h | 12 ++++++------ .../include/PolyVoxCore/MinizBlockCompressor.h | 4 ++-- .../include/PolyVoxCore/MinizBlockCompressor.inl | 2 +- .../include/PolyVoxCore/RLEBlockCompressor.h | 2 +- .../include/PolyVoxCore/RLEBlockCompressor.inl | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h index 5af6dbfb..da4a8c51 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h @@ -40,7 +40,7 @@ namespace PolyVox BlockCompressor() {}; virtual ~BlockCompressor() {}; - virtual void compress(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) = 0; + virtual void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) = 0; virtual void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock) = 0; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h index fbb52250..04659ac1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h @@ -33,12 +33,12 @@ freely, subject to the following restrictions: // Diable things we don't need, and in particular the zlib compatible names which // would cause conflicts if a user application is using both PolyVox and zlib. -#define MINIZ_NO_STDIO -#define MINIZ_NO_ARCHIVE_APIS -#define MINIZ_NO_TIME -#define MINIZ_NO_ZLIB_APIS -#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES -#define MINIZ_NO_MALLOC +//#define MINIZ_NO_STDIO +//#define MINIZ_NO_ARCHIVE_APIS +//#define MINIZ_NO_TIME +//#define MINIZ_NO_ZLIB_APIS +//#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES +//#define MINIZ_NO_MALLOC // Include only the declarations of the functions in miniz.c. Don't include // the actual definitions, as this 'MinizWrapper.h' may be included from multiple diff --git a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h index fc6bdda5..f701101c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h @@ -40,10 +40,10 @@ namespace PolyVox MinizBlockCompressor(int iCompressionLevel = 6); // Miniz defines MZ_DEFAULT_LEVEL = 6 so we use the same here ~MinizBlockCompressor(); - void compress(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); + void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock); - private: + public: uint32_t getExpectedCompressedSize(uint32_t uUncompressedInputSize); uint32_t getMaxCompressedSize(uint32_t uUncompressedInputSize); uint32_t compressWithMiniz(const void* pSrcData, size_t uSrcLength, void* pDstData, size_t uDstLength); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl index 59befd51..a4e41e72 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl @@ -57,7 +57,7 @@ namespace PolyVox } template - void MinizBlockCompressor::compress(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) + void MinizBlockCompressor::compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) { // The uncompressed data will be read straight out of the block void* pSrcData = reinterpret_cast(pSrcBlock->getData()); diff --git a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h index ad388b6e..cb4fc38d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h @@ -49,7 +49,7 @@ namespace PolyVox RLEBlockCompressor(); ~RLEBlockCompressor(); - void compress(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); + void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock); }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl index 369fb912..a8408059 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl @@ -36,7 +36,7 @@ namespace PolyVox } template - void RLEBlockCompressor::compress(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) + void RLEBlockCompressor::compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) { void* pSrcData = reinterpret_cast(pSrcBlock->getData()); uint32_t uSrcLength = pSrcBlock->getDataSizeInBytes(); From 302c6e688b0f4b3adaff3bdc0af3fb9e371f4087 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 13 Sep 2014 11:59:51 +0200 Subject: [PATCH 194/259] More work eliminating compression from inside LargeVolume. --- examples/OpenGL/main.cpp | 2 +- examples/Paging/main.cpp | 12 +- .../include/PolyVoxCore/LargeVolume.h | 27 +-- .../include/PolyVoxCore/LargeVolume.inl | 190 ++---------------- tests/TestSurfaceExtractor.cpp | 4 +- tests/testvolume.cpp | 6 +- 6 files changed, 28 insertions(+), 213 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index bdf700e0..580448ee 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) { RLEBlockCompressor* compressor = new RLEBlockCompressor(); FilePager* pager = new FilePager("./"); - LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), compressor, pager); + LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); //Make our volume contain a sphere in the center. int32_t minPos = 0; diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 53c3f161..862ede7b 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) RLEBlockCompressor* compressor = new RLEBlockCompressor(); PerlinNoisePager* pager = new PerlinNoisePager(); - LargeVolume volData(PolyVox::Region::MaxRegion, compressor, pager, 256); - volData.setMaxNumberOfBlocksInMemory(4096); + LargeVolume volData(PolyVox::Region::MaxRegion, pager, 256); + //volData.setMaxNumberOfBlocksInMemory(4096); volData.setMaxNumberOfUncompressedBlocks(64); //volData.setMaxNumberOfUncompressedBlocks(4096); @@ -168,22 +168,22 @@ int main(int argc, char *argv[]) //createPerlinTerrain(volData); //createPerlinVolumeSlow(volData); std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //volData.setBlockCacheSize(64); PolyVox::Region reg(Vector3DInt32(-255,0,0), Vector3DInt32(255,255,255)); std::cout << "Prefetching region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; volData.prefetch(reg); std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; PolyVox::Region reg2(Vector3DInt32(0,0,0), Vector3DInt32(255,255,255)); std::cout << "Flushing region: " << reg2.getLowerCorner() << " -> " << reg2.getUpperCorner() << std::endl; volData.flush(reg2); std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; std::cout << "Flushing entire volume" << std::endl; volData.flushAll(); std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; //Extract the surface auto mesh = extractCubicMesh(&volData, reg2); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 5d02efea..01741c2b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -232,15 +232,8 @@ namespace PolyVox /// Constructor for creating a fixed size volume. LargeVolume ( - const Region& regValid, - uint16_t uBlockSideLength = 32 - ); - /// Constructor for creating a fixed size volume. - LargeVolume - ( - const Region& regValid, - BlockCompressor* pBlockCompressor, - Pager* pPager , + const Region& regValid, + Pager* pPager = nullptr, uint16_t uBlockSideLength = 32 ); /// Destructor @@ -265,8 +258,6 @@ namespace PolyVox /// Sets the number of blocks for which uncompressed data is stored void setMaxNumberOfUncompressedBlocks(uint32_t uMaxNumberOfUncompressedBlocks); - /// Sets the number of blocks which can be in memory before the paging system starts unloading them - void setMaxNumberOfBlocksInMemory(uint32_t uMaxNumberOfBlocksInMemory); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); /// Sets the voxel at the position given by a 3D vector @@ -282,10 +273,6 @@ namespace PolyVox /// Removes all voxels from memory void flushAll(); - /// Empties the cache of uncompressed blocks - void clearBlockCache(void); - /// Calculates the approximate compression ratio of the store volume data - float calculateCompressionRatio(void); /// Calculates approximatly how many bytes of memory the volume is currently using. uint32_t calculateSizeInBytes(void); @@ -314,12 +301,10 @@ namespace PolyVox } }; - typedef std::map*, BlockPositionCompare> CompressedBlockMap; typedef std::map*, BlockPositionCompare> UncompressedBlockMap; uint32_t calculateBlockMemoryUsage(void) const; - void ensureCompressedBlockMapHasFreeSpace(void) const; void ensureUncompressedBlockMapHasFreeSpace(void) const; void initialise(); @@ -332,21 +317,17 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - CompressedBlock* getCompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; UncompressedBlock* getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - void eraseBlock(typename CompressedBlockMap::iterator itCompressedBlock) const; void eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const; // The block data - mutable CompressedBlockMap m_pBlocks; mutable UncompressedBlockMap m_pUncompressedBlockCache; mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; mutable UncompressedBlock* m_pLastAccessedBlock; uint32_t m_uMaxNumberOfUncompressedBlocks; - uint32_t m_uMaxNumberOfBlocksInMemory; // The size of the volume Region m_regValidRegionInBlocks; @@ -355,8 +336,6 @@ namespace PolyVox uint16_t m_uBlockSideLength; uint8_t m_uBlockSideLengthPower; - // The compressor used by the Blocks to compress their data if required. - BlockCompressor* m_pBlockCompressor; Pager* m_pPager; // Compressed data for an empty block (sometimes needed for initialisation). @@ -364,7 +343,7 @@ namespace PolyVox // Whether we created the compressor or whether it was provided // by the user. This controls whether we delete it on destruction. - bool m_bIsOurCompressor; + //bool m_bIsOurCompressor; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index b17eb128..f3914a64 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -29,30 +29,6 @@ freely, subject to the following restrictions: namespace PolyVox { - //////////////////////////////////////////////////////////////////////////////// - /// When construncting a very large volume you need to be prepared to handle the scenario where there is so much data that PolyVox cannot fit it all in memory. When PolyVox runs out of memory, it identifies the least recently used data and hands it back to the application via a callback function. It is then the responsibility of the application to store this data until PolyVox needs it again (as signalled by another callback function). Please see the LargeVolume class documentation for a full description of this process and the required function signatures. If you really don't want to handle these events then you can provide null pointers here, in which case the data will be discarded and/or filled with default values. - /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in memory. - /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. - /// \param uBlockSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. - //////////////////////////////////////////////////////////////////////////////// - template - LargeVolume::LargeVolume - ( - const Region& regValid, - uint16_t uBlockSideLength - ) - :BaseVolume(regValid) - { - m_uBlockSideLength = uBlockSideLength; - - m_pBlockCompressor = new MinizBlockCompressor(); - m_bIsOurCompressor = true; - - m_pPager = 0; - - initialise(); - } - //////////////////////////////////////////////////////////////////////////////// /// This constructor creates a volume with a fixed size which is specified as a parameter. By default this constructor will not enable paging but you can override this if desired. If you do wish to enable paging then you are required to provide the call back function (see the other LargeVolume constructor). /// \param regValid Specifies the minimum and maximum valid voxel positions. @@ -66,7 +42,6 @@ namespace PolyVox LargeVolume::LargeVolume ( const Region& regValid, - BlockCompressor* pBlockCompressor, Pager* pPager, uint16_t uBlockSideLength ) @@ -74,9 +49,6 @@ namespace PolyVox { m_uBlockSideLength = uBlockSideLength; - m_pBlockCompressor = pBlockCompressor; - m_bIsOurCompressor = false; - m_pPager = pPager; initialise(); @@ -102,14 +74,6 @@ namespace PolyVox LargeVolume::~LargeVolume() { flushAll(); - - // Only delete the compressor if it was created by us (in the constructor), not by the user. - if(m_bIsOurCompressor) - { - delete m_pBlockCompressor; - } - - //delete m_pCompressedEmptyBlock; } //////////////////////////////////////////////////////////////////////////////// @@ -253,7 +217,12 @@ namespace PolyVox template void LargeVolume::setMaxNumberOfUncompressedBlocks(uint32_t uMaxNumberOfUncompressedBlocks) { - clearBlockCache(); + //clearBlockCache(); + + /*if (m_pBlocks.size() > uMaxNumberOfBlocksInMemory) + { + flushAll(); + }*/ m_uMaxNumberOfUncompressedBlocks = uMaxNumberOfUncompressedBlocks; @@ -262,21 +231,6 @@ namespace PolyVox << ", which is " << m_uMaxNumberOfUncompressedBlocks * uUncompressedBlockSizeInBytes << " bytes"); } - //////////////////////////////////////////////////////////////////////////////// - /// Increasing the number of blocks in memory causes less paging to occur - /// \param uMaxNumberOfBlocksInMemory The number of blocks - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::setMaxNumberOfBlocksInMemory(uint32_t uMaxNumberOfBlocksInMemory) - { - if(m_pBlocks.size() > uMaxNumberOfBlocksInMemory) - { - flushAll(); - } - - m_uMaxNumberOfBlocksInMemory = uMaxNumberOfBlocksInMemory; - } - //////////////////////////////////////////////////////////////////////////////// /// \param uXPos the \c x position of the voxel /// \param uYPos the \c y position of the voxel @@ -403,7 +357,7 @@ namespace PolyVox for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { Vector3DInt32 pos(x,y,z); - typename CompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); + /*typename CompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); if(itBlock != m_pBlocks.end()) { @@ -412,7 +366,7 @@ namespace PolyVox // This might be nice, but on the prefetch region could be bigger than the uncompressed cache size. // This would limit the amount of prefetching we could do. continue; - } + }*/ if(numblocks == 0) { @@ -434,8 +388,6 @@ namespace PolyVox template void LargeVolume::flushAll() { - typename CompressedBlockMap::iterator i; - // Flushing will remove the most accessed block, so invalidate the pointer. m_pLastAccessedBlock = 0; @@ -445,11 +397,6 @@ namespace PolyVox { eraseBlock(m_pUncompressedBlockCache.begin()); } - - while(m_pBlocks.size() > 0) - { - eraseBlock(m_pBlocks.begin()); - } } //////////////////////////////////////////////////////////////////////////////// @@ -477,8 +424,8 @@ namespace PolyVox for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { Vector3DInt32 pos(x,y,z); - typename CompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); - if(itBlock == m_pBlocks.end()) + typename UncompressedBlockMap::iterator itBlock = m_pUncompressedBlockCache.find(pos); + if (itBlock == m_pUncompressedBlockCache.end()) { // not loaded, not unloading continue; @@ -494,14 +441,6 @@ namespace PolyVox } // for x } - //////////////////////////////////////////////////////////////////////////////// - /// - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::clearBlockCache(void) - { - } - //////////////////////////////////////////////////////////////////////////////// /// This function should probably be made internal... //////////////////////////////////////////////////////////////////////////////// @@ -519,11 +458,6 @@ namespace PolyVox POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); } - if(!m_pBlockCompressor) - { - POLYVOX_THROW(std::invalid_argument, "You must provide a valid compressor for the LargeVolume to use."); - } - m_uTimestamper = 0; //m_uMaxNumberOfUncompressedBlocks = 16; //m_uMaxNumberOfBlocksInMemory = 1024; @@ -543,10 +477,7 @@ namespace PolyVox //setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks); //Clear the previous data - m_pBlocks.clear(); - - //Clear the previous data - m_pBlocks.clear(); + m_pUncompressedBlockCache.clear(); //Other properties we might find useful later this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); @@ -554,35 +485,6 @@ namespace PolyVox this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); } - template - void LargeVolume::eraseBlock(typename CompressedBlockMap::iterator itCompressedBlock) const - { - CompressedBlock* pCompressedBlock = itCompressedBlock->second; - - // Before deleting the block we may need to page out its data. We - // only do this if the data has been modified since it was paged in. - if(pCompressedBlock->m_bDataModified) - { - // The position of the block within the volume. - Vector3DInt32 v3dBlockPos = itCompressedBlock->first; - - // From the coordinates of the block we deduce the coordinates of the contained voxels. - Vector3DInt32 v3dLower(v3dBlockPos.getX() << m_uBlockSideLengthPower, v3dBlockPos.getY() << m_uBlockSideLengthPower, v3dBlockPos.getZ() << m_uBlockSideLengthPower); - Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength-1, m_uBlockSideLength-1, m_uBlockSideLength-1); - - // Page the data out - //m_pPager->pageOut(Region(v3dLower, v3dUpper), pCompressedBlock); - - // The compressed data is no longer modified with respect to the data on disk - pCompressedBlock->m_bDataModified = false; - } - - delete itCompressedBlock->second; - - // We can now remove the block data from memory. - m_pBlocks.erase(itCompressedBlock); - } - template void LargeVolume::eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const { @@ -617,39 +519,6 @@ namespace PolyVox m_pUncompressedBlockCache.erase(itUncompressedBlock); } - template - CompressedBlock* LargeVolume::getCompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const - { - Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); - - CompressedBlock* pBlock = 0; - - typename CompressedBlockMap::iterator itBlock = m_pBlocks.find(v3dBlockPos); - if(itBlock != m_pBlocks.end()) - { - pBlock = itBlock->second; - } - else - { - ensureCompressedBlockMapHasFreeSpace(); - - // The block wasn't found so we create a new one - pBlock = new CompressedBlock; - - // Pass the block to the Pager to give it a chance to initialise it with any data - Vector3DInt32 v3dLower(v3dBlockPos.getX() << m_uBlockSideLengthPower, v3dBlockPos.getY() << m_uBlockSideLengthPower, v3dBlockPos.getZ() << m_uBlockSideLengthPower); - Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength-1, m_uBlockSideLength-1, m_uBlockSideLength-1); - Region reg(v3dLower, v3dUpper); - m_pPager->pageIn(reg, pBlock); - - // Add the block to the map - itBlock = m_pBlocks.insert(std::make_pair(v3dBlockPos, pBlock)).first; - } - - pBlock->m_uBlockLastAccessed = ++m_uTimestamper; - return pBlock; - } - template UncompressedBlock* LargeVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const { @@ -708,17 +577,6 @@ namespace PolyVox return pUncompressedBlock; } - //////////////////////////////////////////////////////////////////////////////// - /// Note: This function needs reviewing for accuracy... - //////////////////////////////////////////////////////////////////////////////// - template - float LargeVolume::calculateCompressionRatio(void) - { - float fRawSize = static_cast(m_pBlocks.size() * m_uBlockSideLength * m_uBlockSideLength* m_uBlockSideLength * sizeof(VoxelType)); - float fCompressedSize = static_cast(calculateSizeInBytes()); - return fCompressedSize/fRawSize; - } - //////////////////////////////////////////////////////////////////////////////// /// Note: This function needs reviewing for accuracy... //////////////////////////////////////////////////////////////////////////////// @@ -728,8 +586,8 @@ namespace PolyVox uint32_t uSizeInBytes = sizeof(LargeVolume); //Memory used by the blocks - typename CompressedBlockMap::iterator i; - for(i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) + typename UncompressedBlockMap::iterator i; + for (i = m_pUncompressedBlockCache.begin(); i != m_pUncompressedBlockCache.end(); i++) { //Inaccurate - account for rest of loaded block. uSizeInBytes += i->second->calculateSizeInBytes(); @@ -757,28 +615,6 @@ namespace PolyVox return uMemoryUsage; } - template - void LargeVolume::ensureCompressedBlockMapHasFreeSpace(void) const - { - while(m_pBlocks.size() > m_uMaxNumberOfBlocksInMemory) - { - // Find the least recently used block. This is somewhat inefficient as it searches through - // the map, so if it proves to be a bottleneck we may want some kind of sorted structure. - typename CompressedBlockMap::iterator i; - typename CompressedBlockMap::iterator itUnloadBlock = m_pBlocks.begin(); - for(i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) - { - if(i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) - { - itUnloadBlock = i; - } - } - - // Erase the least recently used block - eraseBlock(itUnloadBlock); - } - } - template void LargeVolume::ensureUncompressedBlockMapHasFreeSpace(void) const { diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 440e8a73..71e74d70 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -107,7 +107,7 @@ VolumeType* createAndFillVolume(void) FilePager* pager = new FilePager("./"); //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), compressor, pager); + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); // Fill for (int32_t z = 0; z < uVolumeSideLength; z++) @@ -145,7 +145,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minVal FilePager* pager = new FilePager("./"); //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), compressor, pager); + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); // Seed generator for consistency between runs. srand(12345); diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 4a0d65e1..c3090f2c 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -278,10 +278,10 @@ TestVolume::TestVolume() //Create the volumes m_pRawVolume = new RawVolume(region); m_pSimpleVolume = new SimpleVolume(region); - m_pLargeVolume = new LargeVolume(region, m_pBlockCompressor, m_pFilePager, 32); + m_pLargeVolume = new LargeVolume(region, m_pFilePager, 32); - m_pLargeVolume->setMaxNumberOfBlocksInMemory(32); - m_pLargeVolume->setMaxNumberOfUncompressedBlocks(16); + //m_pLargeVolume->setMaxNumberOfBlocksInMemory(32); + m_pLargeVolume->setMaxNumberOfUncompressedBlocks(64); //Fill the volume with some data for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) From c0a22de2df945f793696c2f0ad7ea595dba68580 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 13 Sep 2014 12:20:56 +0200 Subject: [PATCH 195/259] Removed a lot of compression-related code. --- examples/OpenGL/main.cpp | 2 - examples/Paging/main.cpp | 2 - library/PolyVoxCore/CMakeLists.txt | 9 - .../include/PolyVoxCore/BlockCompressor.h | 48 - .../include/PolyVoxCore/CompressedBlock.h | 63 - .../include/PolyVoxCore/CompressedBlock.inl | 79 - .../include/PolyVoxCore/Impl/MinizWrapper.h | 49 - .../include/PolyVoxCore/Impl/miniz.c | 4777 ----------------- .../include/PolyVoxCore/LargeVolume.h | 1 - .../include/PolyVoxCore/LargeVolume.inl | 2 - .../PolyVoxCore/MinizBlockCompressor.h | 65 - .../PolyVoxCore/MinizBlockCompressor.inl | 210 - .../include/PolyVoxCore/RLEBlockCompressor.h | 59 - .../PolyVoxCore/RLEBlockCompressor.inl | 167 - .../PolyVoxCore/source/Impl/MinizWrapper.cpp | 29 - tests/TestSurfaceExtractor.cpp | 7 +- tests/testvolume.cpp | 3 - 17 files changed, 2 insertions(+), 5570 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/miniz.c delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl delete mode 100644 library/PolyVoxCore/source/Impl/MinizWrapper.cpp diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 580448ee..1c51f511 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -27,7 +27,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/LargeVolume.h" #include "PolyVoxCore/LowPassFilter.h" #include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/RLEBlockCompressor.h" #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/Impl/Utility.h" @@ -51,7 +50,6 @@ const int32_t g_uVolumeSideLength = 128; int main(int argc, char *argv[]) { - RLEBlockCompressor* compressor = new RLEBlockCompressor(); FilePager* pager = new FilePager("./"); LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 862ede7b..a01779fb 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -28,7 +28,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Pager.h" -#include "PolyVoxCore/RLEBlockCompressor.h" #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/LargeVolume.h" @@ -157,7 +156,6 @@ int main(int argc, char *argv[]) OpenGLWidget openGLWidget(0); openGLWidget.show(); - RLEBlockCompressor* compressor = new RLEBlockCompressor(); PerlinNoisePager* pager = new PerlinNoisePager(); LargeVolume volData(PolyVox::Region::MaxRegion, pager, 256); //volData.setMaxNumberOfBlocksInMemory(4096); diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 2f115630..c8b13071 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -39,9 +39,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/BaseVolume.inl include/PolyVoxCore/BaseVolumeSampler.inl include/PolyVoxCore/Block.h - include/PolyVoxCore/BlockCompressor.h - include/PolyVoxCore/CompressedBlock.h - include/PolyVoxCore/CompressedBlock.inl include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -64,8 +61,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/MaterialDensityPair.h include/PolyVoxCore/Mesh.h include/PolyVoxCore/Mesh.inl - include/PolyVoxCore/MinizBlockCompressor.h - include/PolyVoxCore/MinizBlockCompressor.inl include/PolyVoxCore/Pager.h include/PolyVoxCore/PolyVoxForwardDeclarations.h include/PolyVoxCore/Picking.h @@ -76,8 +71,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/Raycast.h include/PolyVoxCore/Raycast.inl include/PolyVoxCore/Region.h - include/PolyVoxCore/RLEBlockCompressor.h - include/PolyVoxCore/RLEBlockCompressor.inl include/PolyVoxCore/SimpleVolume.h include/PolyVoxCore/SimpleVolume.inl include/PolyVoxCore/SimpleVolumeBlock.inl @@ -97,7 +90,6 @@ SET(IMPL_SRC_FILES source/Impl/ErrorHandling.cpp source/Impl/Logging.cpp source/Impl/MarchingCubesTables.cpp - source/Impl/MinizWrapper.cpp source/Impl/RandomUnitVectors.cpp source/Impl/RandomVectors.cpp source/Impl/Timer.cpp @@ -110,7 +102,6 @@ SET(IMPL_INC_FILES include/PolyVoxCore/Impl/ErrorHandling.h include/PolyVoxCore/Impl/Logging.h include/PolyVoxCore/Impl/MarchingCubesTables.h - include/PolyVoxCore/Impl/MinizWrapper.h include/PolyVoxCore/Impl/RandomUnitVectors.h include/PolyVoxCore/Impl/RandomVectors.h include/PolyVoxCore/Impl/Timer.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h deleted file mode 100644 index da4a8c51..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/BlockCompressor.h +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_BlockCompressor_H__ -#define __PolyVox_BlockCompressor_H__ - -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/CompressedBlock.h" -#include "PolyVoxCore/UncompressedBlock.h" - -namespace PolyVox -{ - /** - * Provides an interface for performing compression of blocks. - */ - template - class BlockCompressor - { - public: - BlockCompressor() {}; - virtual ~BlockCompressor() {}; - - virtual void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) = 0; - virtual void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock) = 0; - }; -} - -#endif //__PolyVox_BlockCompressor_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.h deleted file mode 100644 index 5a8ba89a..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_CompressedBlock_H__ -#define __PolyVox_CompressedBlock_H__ - -#include "PolyVoxCore/Block.h" - -namespace PolyVox -{ - template - class CompressedBlock : public Block - { - friend class LargeVolume; - - public: - CompressedBlock(); - ~CompressedBlock(); - - const uint8_t* getData(void) const; - uint32_t getDataSizeInBytes(void) const; - - void setData(const uint8_t* const pData, uint32_t uDataSizeInBytes); - - private: - /// Private copy constructor to prevent accisdental copying - CompressedBlock(const CompressedBlock& /*rhs*/) {}; - - /// Private assignment operator to prevent accisdental copying - CompressedBlock& operator=(const CompressedBlock& /*rhs*/) {}; - - // Made this private to avoid any confusion with getDataSizeInBytes(). - // Users shouldn't really need this for CompressedBlock anyway. - uint32_t calculateSizeInBytes(void); - - uint8_t* m_pData; - uint32_t m_uDataSizeInBytes; - }; -} - -#include "PolyVoxCore/CompressedBlock.inl" - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.inl deleted file mode 100644 index e98df8e3..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/CompressedBlock.inl +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - template - CompressedBlock::CompressedBlock() - :m_pData(0) - ,m_uDataSizeInBytes(0) - { - } - - template - CompressedBlock::~CompressedBlock() - { - delete[] m_pData; - m_pData = 0; - } - - template - const uint8_t* CompressedBlock::getData(void) const - { - return m_pData; - } - - template - uint32_t CompressedBlock::getDataSizeInBytes(void) const - { - return m_uDataSizeInBytes; - } - - template - void CompressedBlock::setData(const uint8_t* const pData, uint32_t uDataSizeInBytes) - { - POLYVOX_THROW_IF(pData == 0, std::invalid_argument, "Pointer to data cannot be null"); - POLYVOX_THROW_IF(m_pData == pData, std::invalid_argument, "Attempting to copy data onto itself"); - - // Delete any existing data - delete[] m_pData; - - // Allocate new data - m_uDataSizeInBytes = uDataSizeInBytes; - m_pData = new uint8_t[uDataSizeInBytes]; - - // Copy the data across - memcpy(m_pData, pData, uDataSizeInBytes); - - // Flag as modified - this->m_bDataModified = true; - } - - template - uint32_t CompressedBlock::calculateSizeInBytes(void) - { - // Returns the size of this class plus the size of the compressed data. - uint32_t uSizeInBytes = sizeof(CompressedBlock) + m_uDataSizeInBytes; - return uSizeInBytes; - } -} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h deleted file mode 100644 index 04659ac1..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/MinizWrapper.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_MinizWrapper_H__ -#define __PolyVox_MinizWrapper_H__ - -// The miniz library is suplied as a single '.c' file, but this is messy for a project like PolyVox -// because it consists mostly of headers. Many of our headers may want to make use of Miniz code which -// means we need to be careful about #including 'miniz.c' multiple times and getting linker errors. -// We simplify this situation with this 'MinizWrapper.h' and 'MinizWrapper.c' which include 'miniz.c' -// with only declarations and definitions respectively. 'MinizWrapper.cpp' only gets compiled once, -// and all other parts of PolyVox can simply include 'MinizWrapper.h' to get the declarations. - -// Diable things we don't need, and in particular the zlib compatible names which -// would cause conflicts if a user application is using both PolyVox and zlib. -//#define MINIZ_NO_STDIO -//#define MINIZ_NO_ARCHIVE_APIS -//#define MINIZ_NO_TIME -//#define MINIZ_NO_ZLIB_APIS -//#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES -//#define MINIZ_NO_MALLOC - -// Include only the declarations of the functions in miniz.c. Don't include -// the actual definitions, as this 'MinizWrapper.h' may be included from multiple -// locations and we want to avoid linker errors regarding multiple definitions. -#define MINIZ_HEADER_FILE_ONLY -#include "PolyVoxCore/Impl/miniz.c" - -#endif //__PolyVox_MinizWrapper_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/miniz.c b/library/PolyVoxCore/include/PolyVoxCore/Impl/miniz.c deleted file mode 100644 index 4b2608e1..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/miniz.c +++ /dev/null @@ -1,4777 +0,0 @@ -/* - * CHANGES FOR POLYVOX - * ------------------- - * This file gave compiler warnings on certain versions of GCC (at least version 4.3.5 used by out build machine) - * and I did not want to risk tampering with the code to fix them.Therefore the only difference between this file - * and the official 'miniz.c' is the pragma below which disables warnings for this file in GCC. - */ -#ifdef __GNUC__ -#pragma GCC system_header -#endif - -/* miniz.c v1.14 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing - See "unlicense" statement at the end of this file. - Rich Geldreich , last updated May 20, 2012 - Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt - - Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define - MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros). - - * Change History - 5/20/12 v1.14 - MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include (thanks fermtect). - 5/19/12 v1.13 - From jason@cornsyrup.org and kelwert@mtu.edu - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit. - Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. - Eliminated a bunch of warnings when compiling with GCC 32-bit/64. - Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly - "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning). - Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. - Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. - Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. - Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.) - Fix ftell() usage in examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). - 4/12/12 v1.12 - More comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's. - level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson for the feedback/bug report. - 5/28/11 v1.11 - Added statement from unlicense.org - 5/27/11 v1.10 - Substantial compressor optimizations: - Level 1 is now ~4x faster than before. The L1 compressor's throughput now varies between 70-110MB/sec. on a - Core i7 (actual throughput varies depending on the type of data, and x64 vs. x86). - Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types. - Refactored the compression code for better readability and maintainability. - Added level 10 compression level (L10 has slightly better ratio than level 9, but could have a potentially large - drop in throughput on some files). - 5/15/11 v1.09 - Initial stable release. - - * Low-level Deflate/Inflate implementation notes: - - Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or - greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses - approximately as well as zlib. - - Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function - coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory - block large enough to hold the entire file. - - The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation. - - * zlib-style API notes: - - miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in - zlib replacement in many apps: - The z_stream struct, optional memory allocation callbacks - deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound - inflateInit/inflateInit2/inflate/inflateEnd - compress, compress2, compressBound, uncompress - CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines. - Supports raw deflate streams or standard zlib streams with adler-32 checking. - - Limitations: - The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries. - I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but - there are no guarantees that miniz.c pulls this off perfectly. - - * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by - Alex Evans. Supports 1-4 bytes/pixel images. - - * ZIP archive API notes: - - The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to - get the job done with minimal fuss. There are simple API's to retrieve file information, read files from - existing archives, create new archives, append new files to existing archives, or clone archive data from - one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h), - or you can specify custom file read/write callbacks. - - - Archive reading: Just call this function to read a single file from a disk archive: - - void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, - size_t *pSize, mz_uint zip_flags); - - For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central - directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files. - - - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file: - - int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); - - The locate operation can optionally check file comments too, which (as one example) can be used to identify - multiple versions of the same file in an archive. This function uses a simple linear search through the central - directory, so it's not very fast. - - Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and - retrieve detailed info on each file by calling mz_zip_reader_file_stat(). - - - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data - to disk and builds an exact image of the central directory in memory. The central directory image is written - all at once at the end of the archive file when the archive is finalized. - - The archive writer can optionally align each file's local header and file data to any power of 2 alignment, - which can be useful when the archive will be read from optical media. Also, the writer supports placing - arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still - readable by any ZIP tool. - - - Archive appending: The simple way to add a single file to an archive is to call this function: - - mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, - const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); - - The archive will be created if it doesn't already exist, otherwise it'll be appended to. - Note the appending is done in-place and is not an atomic operation, so if something goes wrong - during the operation it's possible the archive could be left without a central directory (although the local - file headers and file data will be fine, so the archive will be recoverable). - - For more complex archive modification scenarios: - 1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to - preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the - compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and - you're done. This is safe but requires a bunch of temporary disk space or heap memory. - - 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(), - append new files as needed, then finalize the archive which will write an updated central directory to the - original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a - possibility that the archive's central directory could be lost with this method if anything goes wrong, though. - - - ZIP archive support limitations: - No zip64 or spanning support. Extraction functions can only handle unencrypted, stored or deflated files. - Requires streams capable of seeking. - - * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the - below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it. - - * Important: For best perf. be sure to customize the below macros for your target platform: - #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 - #define MINIZ_LITTLE_ENDIAN 1 - #define MINIZ_HAS_64BIT_REGISTERS 1 -*/ - -#ifndef MINIZ_HEADER_INCLUDED -#define MINIZ_HEADER_INCLUDED - -#include - -#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS) -#include -#endif - -// Defines to completely disable specific portions of miniz.c: -// If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. - -// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. -//#define MINIZ_NO_STDIO - -// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or -// get/set file times. -//#define MINIZ_NO_TIME - -// Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. -//#define MINIZ_NO_ARCHIVE_APIS - -// Define MINIZ_NO_ARCHIVE_APIS to disable all writing related ZIP archive API's. -//#define MINIZ_NO_ARCHIVE_WRITING_APIS - -// Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. -//#define MINIZ_NO_ZLIB_APIS - -// Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. -//#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES - -// Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc. -// Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc -// callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user -// functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. -//#define MINIZ_NO_MALLOC - -#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__) -// MINIZ_X86_OR_X64_CPU is only used to help set the below macros. -#define MINIZ_X86_OR_X64_CPU 1 -#endif - -#if (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU -// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. -#define MINIZ_LITTLE_ENDIAN 1 -#endif - -#if MINIZ_X86_OR_X64_CPU -// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. -#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 -#endif - -#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) -// Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). -#define MINIZ_HAS_64BIT_REGISTERS 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// ------------------- zlib-style API Definitions. - -// For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! -typedef unsigned long mz_ulong; - -// Heap allocation callbacks. -// Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. -typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); -typedef void (*mz_free_func)(void *opaque, void *address); -typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); - -#define MZ_ADLER32_INIT (1) -// mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. -mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len); - -#define MZ_CRC32_INIT (0) -// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. -mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len); - -// Compression strategies. -enum { MZ_DEFAULT_STRATEGY = 0, MZ_FILTERED = 1, MZ_HUFFMAN_ONLY = 2, MZ_RLE = 3, MZ_FIXED = 4 }; - -// Method -#define MZ_DEFLATED 8 - -#ifndef MINIZ_NO_ZLIB_APIS - -#define MZ_VERSION "9.1.14" -#define MZ_VERNUM 0x91E0 -#define MZ_VER_MAJOR 9 -#define MZ_VER_MINOR 1 -#define MZ_VER_REVISION 14 -#define MZ_VER_SUBREVISION 0 - -// Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). -enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 }; - -// Return status codes. MZ_PARAM_ERROR is non-standard. -enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 }; - -// Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. -enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_UBER_COMPRESSION = 10, MZ_DEFAULT_LEVEL = 6, MZ_DEFAULT_COMPRESSION = -1 }; - -// Window bits -#define MZ_DEFAULT_WINDOW_BITS 15 - -struct mz_internal_state; - -// Compression/decompression stream struct. -typedef struct mz_stream_s -{ - const unsigned char *next_in; // pointer to next byte to read - unsigned int avail_in; // number of bytes available at next_in - mz_ulong total_in; // total number of bytes consumed so far - - unsigned char *next_out; // pointer to next byte to write - unsigned int avail_out; // number of bytes that can be written to next_out - mz_ulong total_out; // total number of bytes produced so far - - char *msg; // error msg (unused) - struct mz_internal_state *state; // internal state, allocated by zalloc/zfree - - mz_alloc_func zalloc; // optional heap allocation function (defaults to malloc) - mz_free_func zfree; // optional heap free function (defaults to free) - void *opaque; // heap alloc function user pointer - - int data_type; // data_type (unused) - mz_ulong adler; // adler32 of the source or uncompressed data - mz_ulong reserved; // not used -} mz_stream; - -typedef mz_stream *mz_streamp; - -// Returns the version string of miniz.c. -const char *mz_version(void); - -// mz_deflateInit() initializes a compressor with default options: -// Parameters: -// pStream must point to an initialized mz_stream struct. -// level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. -// level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. -// (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) -// Return values: -// MZ_OK on success. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_PARAM_ERROR if the input parameters are bogus. -// MZ_MEM_ERROR on out of memory. -int mz_deflateInit(mz_streamp pStream, int level); - -// mz_deflateInit2() is like mz_deflate(), except with more control: -// Additional parameters: -// method must be MZ_DEFLATED -// window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) -// mem_level must be between [1, 9] (it's checked but ignored by miniz.c) -int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); - -// Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). -int mz_deflateReset(mz_streamp pStream); - -// mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. -// Parameters: -// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. -// flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. -// Return values: -// MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). -// MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_PARAM_ERROR if one of the parameters is invalid. -// MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) -int mz_deflate(mz_streamp pStream, int flush); - -// mz_deflateEnd() deinitializes a compressor: -// Return values: -// MZ_OK on success. -// MZ_STREAM_ERROR if the stream is bogus. -int mz_deflateEnd(mz_streamp pStream); - -// mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. -mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len); - -// Single-call compression functions mz_compress() and mz_compress2(): -// Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. -int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); -int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level); - -// mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). -mz_ulong mz_compressBound(mz_ulong source_len); - -// Initializes a decompressor. -int mz_inflateInit(mz_streamp pStream); - -// mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: -// window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). -int mz_inflateInit2(mz_streamp pStream, int window_bits); - -// Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. -// Parameters: -// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. -// flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. -// On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). -// MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. -// Return values: -// MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. -// MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_DATA_ERROR if the deflate stream is invalid. -// MZ_PARAM_ERROR if one of the parameters is invalid. -// MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again -// with more input data, or with more room in the output buffer (except when using single call decompression, described above). -int mz_inflate(mz_streamp pStream, int flush); - -// Deinitializes a decompressor. -int mz_inflateEnd(mz_streamp pStream); - -// Single-call decompression. -// Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. -int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); - -// Returns a string description of the specified error code, or NULL if the error code is invalid. -const char *mz_error(int err); - -// Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. -// Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. -#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES - typedef unsigned char Byte; - typedef unsigned int uInt; - typedef mz_ulong uLong; - typedef Byte Bytef; - typedef uInt uIntf; - typedef char charf; - typedef int intf; - typedef void *voidpf; - typedef uLong uLongf; - typedef void *voidp; - typedef void *const voidpc; - #define Z_NULL 0 - #define Z_NO_FLUSH MZ_NO_FLUSH - #define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH - #define Z_SYNC_FLUSH MZ_SYNC_FLUSH - #define Z_FULL_FLUSH MZ_FULL_FLUSH - #define Z_FINISH MZ_FINISH - #define Z_BLOCK MZ_BLOCK - #define Z_OK MZ_OK - #define Z_STREAM_END MZ_STREAM_END - #define Z_NEED_DICT MZ_NEED_DICT - #define Z_ERRNO MZ_ERRNO - #define Z_STREAM_ERROR MZ_STREAM_ERROR - #define Z_DATA_ERROR MZ_DATA_ERROR - #define Z_MEM_ERROR MZ_MEM_ERROR - #define Z_BUF_ERROR MZ_BUF_ERROR - #define Z_VERSION_ERROR MZ_VERSION_ERROR - #define Z_PARAM_ERROR MZ_PARAM_ERROR - #define Z_NO_COMPRESSION MZ_NO_COMPRESSION - #define Z_BEST_SPEED MZ_BEST_SPEED - #define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION - #define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION - #define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY - #define Z_FILTERED MZ_FILTERED - #define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY - #define Z_RLE MZ_RLE - #define Z_FIXED MZ_FIXED - #define Z_DEFLATED MZ_DEFLATED - #define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS - #define alloc_func mz_alloc_func - #define free_func mz_free_func - #define internal_state mz_internal_state - #define z_stream mz_stream - #define deflateInit mz_deflateInit - #define deflateInit2 mz_deflateInit2 - #define deflateReset mz_deflateReset - #define deflate mz_deflate - #define deflateEnd mz_deflateEnd - #define deflateBound mz_deflateBound - #define compress mz_compress - #define compress2 mz_compress2 - #define compressBound mz_compressBound - #define inflateInit mz_inflateInit - #define inflateInit2 mz_inflateInit2 - #define inflate mz_inflate - #define inflateEnd mz_inflateEnd - #define uncompress mz_uncompress - #define crc32 mz_crc32 - #define adler32 mz_adler32 - #define MAX_WBITS 15 - #define MAX_MEM_LEVEL 9 - #define zError mz_error - #define ZLIB_VERSION MZ_VERSION - #define ZLIB_VERNUM MZ_VERNUM - #define ZLIB_VER_MAJOR MZ_VER_MAJOR - #define ZLIB_VER_MINOR MZ_VER_MINOR - #define ZLIB_VER_REVISION MZ_VER_REVISION - #define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION - #define zlibVersion mz_version - #define zlib_version mz_version() -#endif // #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES - -#endif // MINIZ_NO_ZLIB_APIS - -// ------------------- Types and macros - -typedef unsigned char mz_uint8; -typedef signed short mz_int16; -typedef unsigned short mz_uint16; -typedef unsigned int mz_uint32; -typedef unsigned int mz_uint; -typedef long long mz_int64; -typedef unsigned long long mz_uint64; -typedef int mz_bool; - -#define MZ_FALSE (0) -#define MZ_TRUE (1) - -// Works around MSVC's spammy "warning C4127: conditional expression is constant" message. -#ifdef _MSC_VER - #define MZ_MACRO_END while (0, 0) -#else - #define MZ_MACRO_END while (0) -#endif - -// ------------------- ZIP archive reading/writing - -#ifndef MINIZ_NO_ARCHIVE_APIS - -enum -{ - MZ_ZIP_MAX_IO_BUF_SIZE = 64*1024, - MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 260, - MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 256 -}; - -typedef struct -{ - mz_uint32 m_file_index; - mz_uint32 m_central_dir_ofs; - mz_uint16 m_version_made_by; - mz_uint16 m_version_needed; - mz_uint16 m_bit_flag; - mz_uint16 m_method; -#ifndef MINIZ_NO_TIME - time_t m_time; -#endif - mz_uint32 m_crc32; - mz_uint64 m_comp_size; - mz_uint64 m_uncomp_size; - mz_uint16 m_internal_attr; - mz_uint32 m_external_attr; - mz_uint64 m_local_header_ofs; - mz_uint32 m_comment_size; - char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; - char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; -} mz_zip_archive_file_stat; - -typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); -typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n); - -struct mz_zip_internal_state_tag; -typedef struct mz_zip_internal_state_tag mz_zip_internal_state; - -typedef enum -{ - MZ_ZIP_MODE_INVALID = 0, - MZ_ZIP_MODE_READING = 1, - MZ_ZIP_MODE_WRITING = 2, - MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 -} mz_zip_mode; - -typedef struct -{ - mz_uint64 m_archive_size; - mz_uint64 m_central_directory_file_ofs; - mz_uint m_total_files; - mz_zip_mode m_zip_mode; - - mz_uint m_file_offset_alignment; - - mz_alloc_func m_pAlloc; - mz_free_func m_pFree; - mz_realloc_func m_pRealloc; - void *m_pAlloc_opaque; - - mz_file_read_func m_pRead; - mz_file_write_func m_pWrite; - void *m_pIO_opaque; - - mz_zip_internal_state *m_pState; - -} mz_zip_archive; - -typedef enum -{ - MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100, - MZ_ZIP_FLAG_IGNORE_PATH = 0x0200, - MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400, - MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800 -} mz_zip_flags; - -// ZIP archive reading - -// Inits a ZIP archive reader. -// These functions read and validate the archive's central directory. -mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint32 flags); -mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint32 flags); - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags); -#endif - -// Returns the total number of files in the archive. -mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip); - -// Returns detailed information about an archive file entry. -mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat); - -// Determines if an archive file entry is a directory entry. -mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index); -mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index); - -// Retrieves the filename of an archive file entry. -// Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. -mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size); - -// Attempts to locates a file in the archive's central directory. -// Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH -// Returns -1 if the file cannot be found. -int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); - -// Extracts a archive file to a memory buffer using no memory allocation. -mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); -mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); - -// Extracts a archive file to a memory buffer. -mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags); - -// Extracts a archive file to a dynamically allocated heap buffer. -void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags); -void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags); - -// Extracts a archive file using a callback function to output the file's data. -mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); - -#ifndef MINIZ_NO_STDIO -// Extracts a archive file to a disk file and sets its last accessed and modified times. -// This function only extracts files, not archive directory records. -mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags); -#endif - -// Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. -mz_bool mz_zip_reader_end(mz_zip_archive *pZip); - -// ZIP archive writing - -#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -// Inits a ZIP archive writer. -mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size); -mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size); - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning); -#endif - -// Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. -// For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. -// For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). -// Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. -// Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before -// the archive is finalized the file's central directory will be hosed. -mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename); - -// Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. -// To add a directory entry, call this method with an archive name ending in a forwardslash with empty buffer. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags); -mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); - -#ifndef MINIZ_NO_STDIO -// Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); -#endif - -// Adds a file to an archive by fully cloning the data from another archive. -// This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data, and comment fields. -mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint file_index); - -// Finalizes the archive by writing the central directory records followed by the end of central directory record. -// After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). -// An archive must be manually finalized by calling this function for it to be valid. -mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip); -mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf, size_t *pSize); - -// Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. -// Note for the archive to be valid, it must have been finalized before ending. -mz_bool mz_zip_writer_end(mz_zip_archive *pZip); - -// Misc. high-level helper functions: - -// mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); - -// Reads a single file from an archive into a heap block. -// Returns NULL on failure. -void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint zip_flags); - -#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -#endif // #ifndef MINIZ_NO_ARCHIVE_APIS - -// ------------------- Low-level Decompression API Definitions - -// Decompression flags used by tinfl_decompress(). -// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. -// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. -// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). -// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. -enum -{ - TINFL_FLAG_PARSE_ZLIB_HEADER = 1, - TINFL_FLAG_HAS_MORE_INPUT = 2, - TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, - TINFL_FLAG_COMPUTE_ADLER32 = 8 -}; - -// High level decompression functions: -// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). -// On entry: -// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. -// On return: -// Function returns a pointer to the decompressed data, or NULL on failure. -// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. -// The caller must free() the returned block when it's no longer needed. -void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); - -// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. -// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. -#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); - -// tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. -// Returns 1 on success or 0 on failure. -typedef int (*tinfl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); -int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; - -// Max size of LZ dictionary. -#define TINFL_LZ_DICT_SIZE 32768 - -// Return status. -typedef enum -{ - TINFL_STATUS_BAD_PARAM = -3, - TINFL_STATUS_ADLER32_MISMATCH = -2, - TINFL_STATUS_FAILED = -1, - TINFL_STATUS_DONE = 0, - TINFL_STATUS_NEEDS_MORE_INPUT = 1, - TINFL_STATUS_HAS_MORE_OUTPUT = 2 -} tinfl_status; - -// Initializes the decompressor to its initial state. -#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END -#define tinfl_get_adler32(r) (r)->m_check_adler32 - -// Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. -// This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. -tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); - -// Internal/private bits follow. -enum -{ - TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, - TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS -}; - -typedef struct -{ - mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; - mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; -} tinfl_huff_table; - -#if MINIZ_HAS_64BIT_REGISTERS - #define TINFL_USE_64BIT_BITBUF 1 -#endif - -#if TINFL_USE_64BIT_BITBUF - typedef mz_uint64 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (64) -#else - typedef mz_uint32 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (32) -#endif - -struct tinfl_decompressor_tag -{ - mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; - tinfl_bit_buf_t m_bit_buf; - size_t m_dist_from_out_buf_start; - tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; - mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; -}; - -// ------------------- Low-level Compression API Definitions - -// Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). -#define TDEFL_LESS_MEMORY 0 - -// tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): -// TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). -enum -{ - TDEFL_HUFFMAN_ONLY = 0, TDEFL_DEFAULT_MAX_PROBES = 128, TDEFL_MAX_PROBES_MASK = 0xFFF -}; - -// TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. -// TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). -// TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. -// TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). -// TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) -// TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. -// TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. -// TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. -enum -{ - TDEFL_WRITE_ZLIB_HEADER = 0x01000, - TDEFL_COMPUTE_ADLER32 = 0x02000, - TDEFL_GREEDY_PARSING_FLAG = 0x04000, - TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000, - TDEFL_RLE_MATCHES = 0x10000, - TDEFL_FILTER_MATCHES = 0x20000, - TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000, - TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000 -}; - -// High level compression functions: -// tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). -// On entry: -// pSrc_buf, src_buf_len: Pointer and size of source block to compress. -// flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. -// On return: -// Function returns a pointer to the compressed data, or NULL on failure. -// *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. -// The caller must free() the returned block when it's no longer needed. -void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); - -// tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. -// Returns 0 on failure. -size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); - -// Compresses an image to a compressed PNG file in memory. -// On entry: -// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. -// On return: -// Function returns a pointer to the compressed data, or NULL on failure. -// *pLen_out will be set to the size of the PNG image file. -// The caller must free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. -void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out); - -// Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. -typedef mz_bool (*tdefl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); - -// tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. -mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -enum { TDEFL_MAX_HUFF_TABLES = 3, TDEFL_MAX_HUFF_SYMBOLS_0 = 288, TDEFL_MAX_HUFF_SYMBOLS_1 = 32, TDEFL_MAX_HUFF_SYMBOLS_2 = 19, TDEFL_LZ_DICT_SIZE = 32768, TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1, TDEFL_MIN_MATCH_LEN = 3, TDEFL_MAX_MATCH_LEN = 258 }; - -// TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). -#if TDEFL_LESS_MEMORY -enum { TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 12, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; -#else -enum { TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 15, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; -#endif - -// The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. -typedef enum -{ - TDEFL_STATUS_BAD_PARAM = -2, - TDEFL_STATUS_PUT_BUF_FAILED = -1, - TDEFL_STATUS_OKAY = 0, - TDEFL_STATUS_DONE = 1, -} tdefl_status; - -// Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums -typedef enum -{ - TDEFL_NO_FLUSH = 0, - TDEFL_SYNC_FLUSH = 2, - TDEFL_FULL_FLUSH = 3, - TDEFL_FINISH = 4 -} tdefl_flush; - -// tdefl's compression state structure. -typedef struct -{ - tdefl_put_buf_func_ptr m_pPut_buf_func; - void *m_pPut_buf_user; - mz_uint m_flags, m_max_probes[2]; - int m_greedy_parsing; - mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size; - mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end; - mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer; - mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish; - tdefl_status m_prev_return_status; - const void *m_pIn_buf; - void *m_pOut_buf; - size_t *m_pIn_buf_size, *m_pOut_buf_size; - tdefl_flush m_flush; - const mz_uint8 *m_pSrc; - size_t m_src_buf_left, m_out_buf_ofs; - mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1]; - mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE]; - mz_uint16 m_next[TDEFL_LZ_DICT_SIZE]; - mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE]; - mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE]; -} tdefl_compressor; - -// Initializes the compressor. -// There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. -// If pBut_buf_func is NULL the user should always call the tdefl_compress() API. -// flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) -tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -// Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. -tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush); - -// tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. -// tdefl_compress_buffer() always consumes the entire input buffer. -tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush); - -tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d); -mz_uint32 tdefl_get_adler32(tdefl_compressor *d); - -// Can't use tdefl_create_comp_flags_from_zip_params if MINIZ_NO_ZLIB_APIS isn't defined, because it uses some of its macros. -#ifndef MINIZ_NO_ZLIB_APIS -// Create tdefl_compress() flags given zlib-style compression parameters. -// level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) -// window_bits may be -15 (raw deflate) or 15 (zlib) -// strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED -mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy); -#endif // #ifndef MINIZ_NO_ZLIB_APIS - -#ifdef __cplusplus -} -#endif - -#endif // MINIZ_HEADER_INCLUDED - -// ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) - -#ifndef MINIZ_HEADER_FILE_ONLY - -typedef unsigned char mz_validate_uint16[sizeof(mz_uint16)==2 ? 1 : -1]; -typedef unsigned char mz_validate_uint32[sizeof(mz_uint32)==4 ? 1 : -1]; -typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1]; - -#include -#include - -#define MZ_ASSERT(x) assert(x) - -#ifdef MINIZ_NO_MALLOC - #define MZ_MALLOC(x) NULL - #define MZ_FREE(x) (void)x, ((void)0) - #define MZ_REALLOC(p, x) NULL -#else - #define MZ_MALLOC(x) malloc(x) - #define MZ_FREE(x) free(x) - #define MZ_REALLOC(p, x) realloc(p, x) -#endif - -#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) -#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) -#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN - #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) - #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) -#else - #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) - #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) -#endif - -#ifdef _MSC_VER - #define MZ_FORCEINLINE __forceinline -#elif defined(__GNUC__) - #define MZ_FORCEINLINE __attribute__((__always_inline__)) -#else - #define MZ_FORCEINLINE inline -#endif - -#ifdef __cplusplus - extern "C" { -#endif - -// ------------------- zlib-style API's - -mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len) -{ - mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16); size_t block_len = buf_len % 5552; - if (!ptr) return MZ_ADLER32_INIT; - while (buf_len) { - for (i = 0; i + 7 < block_len; i += 8, ptr += 8) { - s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; - s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; - } - for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; - s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; - } - return (s2 << 16) + s1; -} - -// Karl Malbrain's compact CRC-32. See "A compact CCITT crc16 and crc32 C implementation that balances processor cache usage against speed": http://www.geocities.com/malbrain/ -mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len) -{ - static const mz_uint32 s_crc32[16] = { 0, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, - 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c }; - mz_uint32 crcu32 = (mz_uint32)crc; - if (!ptr) return MZ_CRC32_INIT; - crcu32 = ~crcu32; while (buf_len--) { mz_uint8 b = *ptr++; crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)]; crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b >> 4)]; } - return ~crcu32; -} - -#ifndef MINIZ_NO_ZLIB_APIS - -static void *def_alloc_func(void *opaque, size_t items, size_t size) { (void)opaque, (void)items, (void)size; return MZ_MALLOC(items * size); } -static void def_free_func(void *opaque, void *address) { (void)opaque, (void)address; MZ_FREE(address); } -static void *def_realloc_func(void *opaque, void *address, size_t items, size_t size) { (void)opaque, (void)address, (void)items, (void)size; return MZ_REALLOC(address, items * size); } - -const char *mz_version(void) -{ - return MZ_VERSION; -} - -int mz_deflateInit(mz_streamp pStream, int level) -{ - return mz_deflateInit2(pStream, level, MZ_DEFLATED, MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY); -} - -int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy) -{ - tdefl_compressor *pComp; - mz_uint comp_flags = TDEFL_COMPUTE_ADLER32 | tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy); - - if (!pStream) return MZ_STREAM_ERROR; - if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))) return MZ_PARAM_ERROR; - - pStream->data_type = 0; - pStream->adler = MZ_ADLER32_INIT; - pStream->msg = NULL; - pStream->reserved = 0; - pStream->total_in = 0; - pStream->total_out = 0; - if (!pStream->zalloc) pStream->zalloc = def_alloc_func; - if (!pStream->zfree) pStream->zfree = def_free_func; - - pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1, sizeof(tdefl_compressor)); - if (!pComp) - return MZ_MEM_ERROR; - - pStream->state = (struct mz_internal_state *)pComp; - - if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY) - { - mz_deflateEnd(pStream); - return MZ_PARAM_ERROR; - } - - return MZ_OK; -} - -int mz_deflateReset(mz_streamp pStream) -{ - if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree)) return MZ_STREAM_ERROR; - pStream->total_in = pStream->total_out = 0; - tdefl_init((tdefl_compressor*)pStream->state, NULL, NULL, ((tdefl_compressor*)pStream->state)->m_flags); - return MZ_OK; -} - -int mz_deflate(mz_streamp pStream, int flush) -{ - size_t in_bytes, out_bytes; - mz_ulong orig_total_in, orig_total_out; - int mz_status = MZ_OK; - - if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out)) return MZ_STREAM_ERROR; - if (!pStream->avail_out) return MZ_BUF_ERROR; - - if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; - - if (((tdefl_compressor*)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE) - return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR; - - orig_total_in = pStream->total_in; orig_total_out = pStream->total_out; - for ( ; ; ) - { - tdefl_status defl_status; - in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; - - defl_status = tdefl_compress((tdefl_compressor*)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush); - pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; - pStream->total_in += (mz_uint)in_bytes; pStream->adler = tdefl_get_adler32((tdefl_compressor*)pStream->state); - - pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; - pStream->total_out += (mz_uint)out_bytes; - - if (defl_status < 0) - { - mz_status = MZ_STREAM_ERROR; - break; - } - else if (defl_status == TDEFL_STATUS_DONE) - { - mz_status = MZ_STREAM_END; - break; - } - else if (!pStream->avail_out) - break; - else if ((!pStream->avail_in) && (flush != MZ_FINISH)) - { - if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out)) - break; - return MZ_BUF_ERROR; // Can't make forward progress without some input. - } - } - return mz_status; -} - -int mz_deflateEnd(mz_streamp pStream) -{ - if (!pStream) return MZ_STREAM_ERROR; - if (pStream->state) - { - pStream->zfree(pStream->opaque, pStream->state); - pStream->state = NULL; - } - return MZ_OK; -} - -mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len) -{ - (void)pStream; - // This is really over conservative. (And lame, but it's actually pretty tricky to compute a true upper bound given the way tdefl's blocking works.) - return MZ_MAX(128 + (source_len * 110) / 100, 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5); -} - -int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level) -{ - int status; - mz_stream stream; - memset(&stream, 0, sizeof(stream)); - - // In case mz_ulong is 64-bits (argh I hate longs). - if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; - - stream.next_in = pSource; - stream.avail_in = (mz_uint32)source_len; - stream.next_out = pDest; - stream.avail_out = (mz_uint32)*pDest_len; - - status = mz_deflateInit(&stream, level); - if (status != MZ_OK) return status; - - status = mz_deflate(&stream, MZ_FINISH); - if (status != MZ_STREAM_END) - { - mz_deflateEnd(&stream); - return (status == MZ_OK) ? MZ_BUF_ERROR : status; - } - - *pDest_len = stream.total_out; - return mz_deflateEnd(&stream); -} - -int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) -{ - return mz_compress2(pDest, pDest_len, pSource, source_len, MZ_DEFAULT_COMPRESSION); -} - -mz_ulong mz_compressBound(mz_ulong source_len) -{ - return mz_deflateBound(NULL, source_len); -} - -typedef struct -{ - tinfl_decompressor m_decomp; - mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; int m_window_bits; - mz_uint8 m_dict[TINFL_LZ_DICT_SIZE]; - tinfl_status m_last_status; -} inflate_state; - -int mz_inflateInit2(mz_streamp pStream, int window_bits) -{ - inflate_state *pDecomp; - if (!pStream) return MZ_STREAM_ERROR; - if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) return MZ_PARAM_ERROR; - - pStream->data_type = 0; - pStream->adler = 0; - pStream->msg = NULL; - pStream->total_in = 0; - pStream->total_out = 0; - pStream->reserved = 0; - if (!pStream->zalloc) pStream->zalloc = def_alloc_func; - if (!pStream->zfree) pStream->zfree = def_free_func; - - pDecomp = (inflate_state*)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state)); - if (!pDecomp) return MZ_MEM_ERROR; - - pStream->state = (struct mz_internal_state *)pDecomp; - - tinfl_init(&pDecomp->m_decomp); - pDecomp->m_dict_ofs = 0; - pDecomp->m_dict_avail = 0; - pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; - pDecomp->m_first_call = 1; - pDecomp->m_has_flushed = 0; - pDecomp->m_window_bits = window_bits; - - return MZ_OK; -} - -int mz_inflateInit(mz_streamp pStream) -{ - return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS); -} - -int mz_inflate(mz_streamp pStream, int flush) -{ - inflate_state* pState; - mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32; - size_t in_bytes, out_bytes, orig_avail_in; - tinfl_status status; - - if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR; - if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; - if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; - - pState = (inflate_state*)pStream->state; - if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER; - orig_avail_in = pStream->avail_in; - - first_call = pState->m_first_call; pState->m_first_call = 0; - if (pState->m_last_status < 0) return MZ_DATA_ERROR; - - if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; - pState->m_has_flushed |= (flush == MZ_FINISH); - - if ((flush == MZ_FINISH) && (first_call)) - { - // MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. - decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF; - in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; - status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags); - pState->m_last_status = status; - pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes; - pStream->adler = tinfl_get_adler32(&pState->m_decomp); - pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint)out_bytes; - - if (status < 0) - return MZ_DATA_ERROR; - else if (status != TINFL_STATUS_DONE) - { - pState->m_last_status = TINFL_STATUS_FAILED; - return MZ_BUF_ERROR; - } - return MZ_STREAM_END; - } - // flush != MZ_FINISH then we must assume there's more input. - if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT; - - if (pState->m_dict_avail) - { - n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); - memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); - pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; - pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); - return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; - } - - for ( ; ; ) - { - in_bytes = pStream->avail_in; - out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs; - - status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags); - pState->m_last_status = status; - - pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; - pStream->total_in += (mz_uint)in_bytes; pStream->adler = tinfl_get_adler32(&pState->m_decomp); - - pState->m_dict_avail = (mz_uint)out_bytes; - - n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); - memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); - pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; - pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); - - if (status < 0) - return MZ_DATA_ERROR; // Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). - else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in)) - return MZ_BUF_ERROR; // Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. - else if (flush == MZ_FINISH) - { - // The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. - if (status == TINFL_STATUS_DONE) - return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END; - // status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. - else if (!pStream->avail_out) - return MZ_BUF_ERROR; - } - else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)) - break; - } - - return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; -} - -int mz_inflateEnd(mz_streamp pStream) -{ - if (!pStream) - return MZ_STREAM_ERROR; - if (pStream->state) - { - pStream->zfree(pStream->opaque, pStream->state); - pStream->state = NULL; - } - return MZ_OK; -} - -int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) -{ - mz_stream stream; - int status; - memset(&stream, 0, sizeof(stream)); - - // In case mz_ulong is 64-bits (argh I hate longs). - if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; - - stream.next_in = pSource; - stream.avail_in = (mz_uint32)source_len; - stream.next_out = pDest; - stream.avail_out = (mz_uint32)*pDest_len; - - status = mz_inflateInit(&stream); - if (status != MZ_OK) - return status; - - status = mz_inflate(&stream, MZ_FINISH); - if (status != MZ_STREAM_END) - { - mz_inflateEnd(&stream); - return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status; - } - *pDest_len = stream.total_out; - - return mz_inflateEnd(&stream); -} - -const char *mz_error(int err) -{ - static struct { int m_err; const char *m_pDesc; } s_error_descs[] = - { - { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" }, - { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" } - }; - mz_uint i; for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc; - return NULL; -} - -#endif //MINIZ_NO_ZLIB_APIS - -// ------------------- Low-level Decompression (completely independent from all compression API's) - -#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) -#define TINFL_MEMSET(p, c, l) memset(p, c, l) - -#define TINFL_CR_BEGIN switch(r->m_state) { case 0: -#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END -#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END -#define TINFL_CR_FINISH } - -// TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never -// reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. -#define TINFL_GET_BYTE(state_index, c) do { \ - if (pIn_buf_cur >= pIn_buf_end) { \ - for ( ; ; ) { \ - if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ - TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ - if (pIn_buf_cur < pIn_buf_end) { \ - c = *pIn_buf_cur++; \ - break; \ - } \ - } else { \ - c = 0; \ - break; \ - } \ - } \ - } else c = *pIn_buf_cur++; } MZ_MACRO_END - -#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) -#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END -#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END - -// TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. -// It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a -// Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the -// bit buffer contains >=15 bits (deflate's max. Huffman code size). -#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ - do { \ - temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ - if (temp >= 0) { \ - code_len = temp >> 9; \ - if ((code_len) && (num_bits >= code_len)) \ - break; \ - } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ - code_len = TINFL_FAST_LOOKUP_BITS; \ - do { \ - temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ - } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ - } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ - } while (num_bits < 15); - -// TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read -// beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully -// decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. -// The slow path is only executed at the very end of the input buffer. -#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ - int temp; mz_uint code_len, c; \ - if (num_bits < 15) { \ - if ((pIn_buf_end - pIn_buf_cur) < 2) { \ - TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ - } else { \ - bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ - } \ - } \ - if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ - code_len = temp >> 9, temp &= 511; \ - else { \ - code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ - } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END - -tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) -{ - static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; - static const int s_length_extra[31]= { 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 }; - static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; - static const int s_dist_extra[32] = { 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}; - static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; - static const int s_min_table_sizes[3] = { 257, 1, 4 }; - - tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; - const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; - mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; - size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; - - // Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). - if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } - - num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; - TINFL_CR_BEGIN - - bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; - if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) - { - TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); - counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); - if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); - if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } - } - - do - { - TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; - if (r->m_type == 0) - { - TINFL_SKIP_BITS(5, num_bits & 7); - for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } - if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } - while ((counter) && (num_bits)) - { - TINFL_GET_BITS(51, dist, 8); - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = (mz_uint8)dist; - counter--; - } - while (counter) - { - size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } - while (pIn_buf_cur >= pIn_buf_end) - { - if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) - { - TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); - } - else - { - TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); - } - } - n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); - TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; - } - } - else if (r->m_type == 3) - { - TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); - } - else - { - if (r->m_type == 1) - { - mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; - r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); - for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8; - } - else - { - for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } - MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } - r->m_table_sizes[2] = 19; - } - for ( ; (int)r->m_type >= 0; r->m_type--) - { - int tree_next, tree_cur; tinfl_huff_table *pTable; - mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); - for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; - used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; - for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } - if ((65536 != total) && (used_syms > 1)) - { - TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); - } - for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) - { - mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; - cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); - if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } - if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } - rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); - for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) - { - tree_cur -= ((rev_code >>= 1) & 1); - if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; - } - tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; - } - if (r->m_type == 2) - { - for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) - { - mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } - if ((dist == 16) && (!counter)) - { - TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); - } - num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; - TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; - } - if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) - { - TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); - } - TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); - } - } - for ( ; ; ) - { - mz_uint8 *pSrc; - for ( ; ; ) - { - if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) - { - TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); - if (counter >= 256) - break; - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = (mz_uint8)counter; - } - else - { - int sym2; mz_uint code_len; -#if TINFL_USE_64BIT_BITBUF - if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } -#else - if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } -#endif - if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) - code_len = sym2 >> 9; - else - { - code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); - } - counter = sym2; bit_buf >>= code_len; num_bits -= code_len; - if (counter & 256) - break; - -#if !TINFL_USE_64BIT_BITBUF - if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } -#endif - if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) - code_len = sym2 >> 9; - else - { - code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); - } - bit_buf >>= code_len; num_bits -= code_len; - - pOut_buf_cur[0] = (mz_uint8)counter; - if (sym2 & 256) - { - pOut_buf_cur++; - counter = sym2; - break; - } - pOut_buf_cur[1] = (mz_uint8)sym2; - pOut_buf_cur += 2; - } - } - if ((counter &= 511) == 256) break; - - num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; - if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } - - TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); - num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; - if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } - - dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; - if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) - { - TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); - } - - pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); - - if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) - { - while (counter--) - { - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; - } - continue; - } -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES - else if ((counter >= 9) && (counter <= dist)) - { - const mz_uint8 *pSrc_end = pSrc + (counter & ~7); - do - { - ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; - ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; - pOut_buf_cur += 8; - } while ((pSrc += 8) < pSrc_end); - if ((counter &= 7) < 3) - { - if (counter) - { - pOut_buf_cur[0] = pSrc[0]; - if (counter > 1) - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur += counter; - } - continue; - } - } -#endif - do - { - pOut_buf_cur[0] = pSrc[0]; - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur[2] = pSrc[2]; - pOut_buf_cur += 3; pSrc += 3; - } while ((int)(counter -= 3) > 2); - if ((int)counter > 0) - { - pOut_buf_cur[0] = pSrc[0]; - if ((int)counter > 1) - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur += counter; - } - } - } - } while (!(r->m_final & 1)); - if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) - { - TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } - } - TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); - TINFL_CR_FINISH - -common_exit: - r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; - *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; - if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) - { - const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; - mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; - while (buf_len) - { - for (i = 0; i + 7 < block_len; i += 8, ptr += 8) - { - s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; - s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; - } - for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; - s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; - } - r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; - } - return status; -} - -// Higher level helper functions. -void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) -{ - tinfl_decompressor decomp; void *pBuf = NULL, *pNew_buf; size_t src_buf_ofs = 0, out_buf_capacity = 0; - *pOut_len = 0; - tinfl_init(&decomp); - for ( ; ; ) - { - size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity; - tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8*)pBuf, pBuf ? (mz_uint8*)pBuf + *pOut_len : NULL, &dst_buf_size, - (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); - if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) - { - MZ_FREE(pBuf); *pOut_len = 0; return NULL; - } - src_buf_ofs += src_buf_size; - *pOut_len += dst_buf_size; - if (status == TINFL_STATUS_DONE) break; - new_out_buf_capacity = out_buf_capacity * 2; if (new_out_buf_capacity < 128) new_out_buf_capacity = 128; - pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity); - if (!pNew_buf) - { - MZ_FREE(pBuf); *pOut_len = 0; return NULL; - } - pBuf = pNew_buf; out_buf_capacity = new_out_buf_capacity; - } - return pBuf; -} - -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) -{ - tinfl_decompressor decomp; tinfl_status status; tinfl_init(&decomp); - status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf, &src_buf_len, (mz_uint8*)pOut_buf, (mz_uint8*)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); - return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len; -} - -int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) -{ - int result = 0; - tinfl_decompressor decomp; - mz_uint8 *pDict = (mz_uint8*)MZ_MALLOC(TINFL_LZ_DICT_SIZE); size_t in_buf_ofs = 0, dict_ofs = 0; - if (!pDict) - return TINFL_STATUS_FAILED; - tinfl_init(&decomp); - for ( ; ; ) - { - size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs; - tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, - (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); - in_buf_ofs += in_buf_size; - if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) - break; - if (status != TINFL_STATUS_HAS_MORE_OUTPUT) - { - result = (status == TINFL_STATUS_DONE); - break; - } - dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1); - } - MZ_FREE(pDict); - *pIn_buf_size = in_buf_ofs; - return result; -} - -// ------------------- Low-level Compression (independent from all decompression API's) - -// Purposely making these tables static for faster init and thread safety. -static const mz_uint16 s_tdefl_len_sym[256] = { - 257,258,259,260,261,262,263,264,265,265,266,266,267,267,268,268,269,269,269,269,270,270,270,270,271,271,271,271,272,272,272,272, - 273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276, - 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278, - 279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281, - 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,285 }; - -static const mz_uint8 s_tdefl_len_extra[256] = { - 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0 }; - -static const mz_uint8 s_tdefl_small_dist_sym[512] = { - 0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11, - 11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13, - 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14, - 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, - 14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16, - 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, - 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, - 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17, - 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, - 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, - 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 }; - -static const mz_uint8 s_tdefl_small_dist_extra[512] = { - 0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7 }; - -static const mz_uint8 s_tdefl_large_dist_sym[128] = { - 0,0,18,19,20,20,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26, - 26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 }; - -static const mz_uint8 s_tdefl_large_dist_extra[128] = { - 0,0,8,8,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, - 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 }; - -// Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted values. -typedef struct { mz_uint16 m_key, m_sym_index; } tdefl_sym_freq; -static tdefl_sym_freq* tdefl_radix_sort_syms(mz_uint num_syms, tdefl_sym_freq* pSyms0, tdefl_sym_freq* pSyms1) -{ - mz_uint32 total_passes = 2, pass_shift, pass, i, hist[256 * 2]; tdefl_sym_freq* pCur_syms = pSyms0, *pNew_syms = pSyms1; MZ_CLEAR_OBJ(hist); - for (i = 0; i < num_syms; i++) { mz_uint freq = pSyms0[i].m_key; hist[freq & 0xFF]++; hist[256 + ((freq >> 8) & 0xFF)]++; } - while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256])) total_passes--; - for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8) - { - const mz_uint32* pHist = &hist[pass << 8]; - mz_uint offsets[256], cur_ofs = 0; - for (i = 0; i < 256; i++) { offsets[i] = cur_ofs; cur_ofs += pHist[i]; } - for (i = 0; i < num_syms; i++) pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] = pCur_syms[i]; - { tdefl_sym_freq* t = pCur_syms; pCur_syms = pNew_syms; pNew_syms = t; } - } - return pCur_syms; -} - -// tdefl_calculate_minimum_redundancy() originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996. -static void tdefl_calculate_minimum_redundancy(tdefl_sym_freq *A, int n) -{ - int root, leaf, next, avbl, used, dpth; - if (n==0) return; else if (n==1) { A[0].m_key = 1; return; } - A[0].m_key += A[1].m_key; root = 0; leaf = 2; - for (next=1; next < n-1; next++) - { - if (leaf>=n || A[root].m_key=n || (root=0; next--) A[next].m_key = A[A[next].m_key].m_key+1; - avbl = 1; used = dpth = 0; root = n-2; next = n-1; - while (avbl>0) - { - while (root>=0 && (int)A[root].m_key==dpth) { used++; root--; } - while (avbl>used) { A[next--].m_key = (mz_uint16)(dpth); avbl--; } - avbl = 2*used; dpth++; used = 0; - } -} - -// Limits canonical Huffman code table's max code size. -enum { TDEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32 }; -static void tdefl_huffman_enforce_max_code_size(int *pNum_codes, int code_list_len, int max_code_size) -{ - int i; mz_uint32 total = 0; if (code_list_len <= 1) return; - for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++) pNum_codes[max_code_size] += pNum_codes[i]; - for (i = max_code_size; i > 0; i--) total += (((mz_uint32)pNum_codes[i]) << (max_code_size - i)); - while (total != (1UL << max_code_size)) - { - pNum_codes[max_code_size]--; - for (i = max_code_size - 1; i > 0; i--) if (pNum_codes[i]) { pNum_codes[i]--; pNum_codes[i + 1] += 2; break; } - total--; - } -} - -static void tdefl_optimize_huffman_table(tdefl_compressor *d, int table_num, int table_len, int code_size_limit, int static_table) -{ - int i, j, l, num_codes[1 + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE]; mz_uint next_code[TDEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1]; MZ_CLEAR_OBJ(num_codes); - if (static_table) - { - for (i = 0; i < table_len; i++) num_codes[d->m_huff_code_sizes[table_num][i]]++; - } - else - { - tdefl_sym_freq syms0[TDEFL_MAX_HUFF_SYMBOLS], syms1[TDEFL_MAX_HUFF_SYMBOLS], *pSyms; - int num_used_syms = 0; - const mz_uint16 *pSym_count = &d->m_huff_count[table_num][0]; - for (i = 0; i < table_len; i++) if (pSym_count[i]) { syms0[num_used_syms].m_key = (mz_uint16)pSym_count[i]; syms0[num_used_syms++].m_sym_index = (mz_uint16)i; } - - pSyms = tdefl_radix_sort_syms(num_used_syms, syms0, syms1); tdefl_calculate_minimum_redundancy(pSyms, num_used_syms); - - for (i = 0; i < num_used_syms; i++) num_codes[pSyms[i].m_key]++; - - tdefl_huffman_enforce_max_code_size(num_codes, num_used_syms, code_size_limit); - - MZ_CLEAR_OBJ(d->m_huff_code_sizes[table_num]); MZ_CLEAR_OBJ(d->m_huff_codes[table_num]); - for (i = 1, j = num_used_syms; i <= code_size_limit; i++) - for (l = num_codes[i]; l > 0; l--) d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (mz_uint8)(i); - } - - next_code[1] = 0; for (j = 0, i = 2; i <= code_size_limit; i++) next_code[i] = j = ((j + num_codes[i - 1]) << 1); - - for (i = 0; i < table_len; i++) - { - mz_uint rev_code = 0, code, code_size; if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0) continue; - code = next_code[code_size]++; for (l = code_size; l > 0; l--, code >>= 1) rev_code = (rev_code << 1) | (code & 1); - d->m_huff_codes[table_num][i] = (mz_uint16)rev_code; - } -} - -#define TDEFL_PUT_BITS(b, l) do { \ - mz_uint bits = b; mz_uint len = l; MZ_ASSERT(bits <= ((1U << len) - 1U)); \ - d->m_bit_buffer |= (bits << d->m_bits_in); d->m_bits_in += len; \ - while (d->m_bits_in >= 8) { \ - if (d->m_pOutput_buf < d->m_pOutput_buf_end) \ - *d->m_pOutput_buf++ = (mz_uint8)(d->m_bit_buffer); \ - d->m_bit_buffer >>= 8; \ - d->m_bits_in -= 8; \ - } \ -} MZ_MACRO_END - -#define TDEFL_RLE_PREV_CODE_SIZE() { if (rle_repeat_count) { \ - if (rle_repeat_count < 3) { \ - d->m_huff_count[2][prev_code_size] = (mz_uint16)(d->m_huff_count[2][prev_code_size] + rle_repeat_count); \ - while (rle_repeat_count--) packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \ - } else { \ - d->m_huff_count[2][16] = (mz_uint16)(d->m_huff_count[2][16] + 1); packed_code_sizes[num_packed_code_sizes++] = 16; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_repeat_count - 3); \ -} rle_repeat_count = 0; } } - -#define TDEFL_RLE_ZERO_CODE_SIZE() { if (rle_z_count) { \ - if (rle_z_count < 3) { \ - d->m_huff_count[2][0] = (mz_uint16)(d->m_huff_count[2][0] + rle_z_count); while (rle_z_count--) packed_code_sizes[num_packed_code_sizes++] = 0; \ - } else if (rle_z_count <= 10) { \ - d->m_huff_count[2][17] = (mz_uint16)(d->m_huff_count[2][17] + 1); packed_code_sizes[num_packed_code_sizes++] = 17; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 3); \ - } else { \ - d->m_huff_count[2][18] = (mz_uint16)(d->m_huff_count[2][18] + 1); packed_code_sizes[num_packed_code_sizes++] = 18; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 11); \ -} rle_z_count = 0; } } - -static mz_uint8 s_tdefl_packed_code_size_syms_swizzle[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - -static void tdefl_start_dynamic_block(tdefl_compressor *d) -{ - int num_lit_codes, num_dist_codes, num_bit_lengths; mz_uint i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index; - mz_uint8 code_sizes_to_pack[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], packed_code_sizes[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], prev_code_size = 0xFF; - - d->m_huff_count[0][256] = 1; - - tdefl_optimize_huffman_table(d, 0, TDEFL_MAX_HUFF_SYMBOLS_0, 15, MZ_FALSE); - tdefl_optimize_huffman_table(d, 1, TDEFL_MAX_HUFF_SYMBOLS_1, 15, MZ_FALSE); - - for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--) if (d->m_huff_code_sizes[0][num_lit_codes - 1]) break; - for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--) if (d->m_huff_code_sizes[1][num_dist_codes - 1]) break; - - memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes); - memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes); - total_code_sizes_to_pack = num_lit_codes + num_dist_codes; num_packed_code_sizes = 0; rle_z_count = 0; rle_repeat_count = 0; - - memset(&d->m_huff_count[2][0], 0, sizeof(d->m_huff_count[2][0]) * TDEFL_MAX_HUFF_SYMBOLS_2); - for (i = 0; i < total_code_sizes_to_pack; i++) - { - mz_uint8 code_size = code_sizes_to_pack[i]; - if (!code_size) - { - TDEFL_RLE_PREV_CODE_SIZE(); - if (++rle_z_count == 138) { TDEFL_RLE_ZERO_CODE_SIZE(); } - } - else - { - TDEFL_RLE_ZERO_CODE_SIZE(); - if (code_size != prev_code_size) - { - TDEFL_RLE_PREV_CODE_SIZE(); - d->m_huff_count[2][code_size] = (mz_uint16)(d->m_huff_count[2][code_size] + 1); packed_code_sizes[num_packed_code_sizes++] = code_size; - } - else if (++rle_repeat_count == 6) - { - TDEFL_RLE_PREV_CODE_SIZE(); - } - } - prev_code_size = code_size; - } - if (rle_repeat_count) { TDEFL_RLE_PREV_CODE_SIZE(); } else { TDEFL_RLE_ZERO_CODE_SIZE(); } - - tdefl_optimize_huffman_table(d, 2, TDEFL_MAX_HUFF_SYMBOLS_2, 7, MZ_FALSE); - - TDEFL_PUT_BITS(2, 2); - - TDEFL_PUT_BITS(num_lit_codes - 257, 5); - TDEFL_PUT_BITS(num_dist_codes - 1, 5); - - for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--) if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]]) break; - num_bit_lengths = MZ_MAX(4, (num_bit_lengths + 1)); TDEFL_PUT_BITS(num_bit_lengths - 4, 4); - for (i = 0; (int)i < num_bit_lengths; i++) TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3); - - for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes; ) - { - mz_uint code = packed_code_sizes[packed_code_sizes_index++]; MZ_ASSERT(code < TDEFL_MAX_HUFF_SYMBOLS_2); - TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]); - if (code >= 16) TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]); - } -} - -static void tdefl_start_static_block(tdefl_compressor *d) -{ - mz_uint i; - mz_uint8 *p = &d->m_huff_code_sizes[0][0]; - - for (i = 0; i <= 143; ++i) *p++ = 8; - for ( ; i <= 255; ++i) *p++ = 9; - for ( ; i <= 279; ++i) *p++ = 7; - for ( ; i <= 287; ++i) *p++ = 8; - - memset(d->m_huff_code_sizes[1], 5, 32); - - tdefl_optimize_huffman_table(d, 0, 288, 15, MZ_TRUE); - tdefl_optimize_huffman_table(d, 1, 32, 15, MZ_TRUE); - - TDEFL_PUT_BITS(1, 2); -} - -static const mz_uint mz_bitmasks[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS -static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) -{ - mz_uint flags; - mz_uint8 *pLZ_codes; - mz_uint8 *pOutput_buf = d->m_pOutput_buf; - mz_uint8 *pLZ_code_buf_end = d->m_pLZ_code_buf; - mz_uint64 bit_buffer = d->m_bit_buffer; - mz_uint bits_in = d->m_bits_in; - -#define TDEFL_PUT_BITS_FAST(b, l) { bit_buffer |= (((mz_uint64)(b)) << bits_in); bits_in += (l); } - - flags = 1; - for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end; flags >>= 1) - { - if (flags == 1) - flags = *pLZ_codes++ | 0x100; - - if (flags & 1) - { - mz_uint s0, s1, n0, n1, sym, num_extra_bits; - mz_uint match_len = pLZ_codes[0], match_dist = *(const mz_uint16 *)(pLZ_codes + 1); pLZ_codes += 3; - - MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); - TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); - TDEFL_PUT_BITS_FAST(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); - - // This sequence coaxes MSVC into using cmov's vs. jmp's. - s0 = s_tdefl_small_dist_sym[match_dist & 511]; - n0 = s_tdefl_small_dist_extra[match_dist & 511]; - s1 = s_tdefl_large_dist_sym[match_dist >> 8]; - n1 = s_tdefl_large_dist_extra[match_dist >> 8]; - sym = (match_dist < 512) ? s0 : s1; - num_extra_bits = (match_dist < 512) ? n0 : n1; - - MZ_ASSERT(d->m_huff_code_sizes[1][sym]); - TDEFL_PUT_BITS_FAST(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); - TDEFL_PUT_BITS_FAST(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); - } - else - { - mz_uint lit = *pLZ_codes++; - MZ_ASSERT(d->m_huff_code_sizes[0][lit]); - TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); - - if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) - { - flags >>= 1; - lit = *pLZ_codes++; - MZ_ASSERT(d->m_huff_code_sizes[0][lit]); - TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); - - if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) - { - flags >>= 1; - lit = *pLZ_codes++; - MZ_ASSERT(d->m_huff_code_sizes[0][lit]); - TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); - } - } - } - - if (pOutput_buf >= d->m_pOutput_buf_end) - return MZ_FALSE; - - *(mz_uint64*)pOutput_buf = bit_buffer; - pOutput_buf += (bits_in >> 3); - bit_buffer >>= (bits_in & ~7); - bits_in &= 7; - } - -#undef TDEFL_PUT_BITS_FAST - - d->m_pOutput_buf = pOutput_buf; - d->m_bits_in = 0; - d->m_bit_buffer = 0; - - while (bits_in) - { - mz_uint32 n = MZ_MIN(bits_in, 16); - TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n); - bit_buffer >>= n; - bits_in -= n; - } - - TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); - - return (d->m_pOutput_buf < d->m_pOutput_buf_end); -} -#else -static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) -{ - mz_uint flags; - mz_uint8 *pLZ_codes; - - flags = 1; - for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1) - { - if (flags == 1) - flags = *pLZ_codes++ | 0x100; - if (flags & 1) - { - mz_uint sym, num_extra_bits; - mz_uint match_len = pLZ_codes[0], match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8)); pLZ_codes += 3; - - MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); - TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); - TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); - - if (match_dist < 512) - { - sym = s_tdefl_small_dist_sym[match_dist]; num_extra_bits = s_tdefl_small_dist_extra[match_dist]; - } - else - { - sym = s_tdefl_large_dist_sym[match_dist >> 8]; num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8]; - } - MZ_ASSERT(d->m_huff_code_sizes[1][sym]); - TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); - TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); - } - else - { - mz_uint lit = *pLZ_codes++; - MZ_ASSERT(d->m_huff_code_sizes[0][lit]); - TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); - } - } - - TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); - - return (d->m_pOutput_buf < d->m_pOutput_buf_end); -} -#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS - -static mz_bool tdefl_compress_block(tdefl_compressor *d, mz_bool static_block) -{ - if (static_block) - tdefl_start_static_block(d); - else - tdefl_start_dynamic_block(d); - return tdefl_compress_lz_codes(d); -} - -static int tdefl_flush_block(tdefl_compressor *d, int flush) -{ - mz_uint saved_bit_buf, saved_bits_in; - mz_uint8 *pSaved_output_buf; - mz_bool comp_block_succeeded = MZ_FALSE; - int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size; - mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf; - - d->m_pOutput_buf = pOutput_buf_start; - d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16; - - MZ_ASSERT(!d->m_output_flush_remaining); - d->m_output_flush_ofs = 0; - d->m_output_flush_remaining = 0; - - *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left); - d->m_pLZ_code_buf -= (d->m_num_flags_left == 8); - - if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index)) - { - TDEFL_PUT_BITS(0x78, 8); TDEFL_PUT_BITS(0x01, 8); - } - - TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1); - - pSaved_output_buf = d->m_pOutput_buf; saved_bit_buf = d->m_bit_buffer; saved_bits_in = d->m_bits_in; - - if (!use_raw_block) - comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48)); - - // If the block gets expanded, forget the current contents of the output buffer and send a raw block instead. - if ( ((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) && - ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size) ) - { - mz_uint i; d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; - TDEFL_PUT_BITS(0, 2); - if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } - for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF) - { - TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16); - } - for (i = 0; i < d->m_total_lz_bytes; ++i) - { - TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8); - } - } - // Check for the extremely unlikely (if not impossible) case of the compressed block not fitting into the output buffer when using dynamic codes. - else if (!comp_block_succeeded) - { - d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; - tdefl_compress_block(d, MZ_TRUE); - } - - if (flush) - { - if (flush == TDEFL_FINISH) - { - if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } - if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER) { mz_uint i, a = d->m_adler32; for (i = 0; i < 4; i++) { TDEFL_PUT_BITS((a >> 24) & 0xFF, 8); a <<= 8; } } - } - else - { - mz_uint i, z = 0; TDEFL_PUT_BITS(0, 3); if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } for (i = 2; i; --i, z ^= 0xFFFF) { TDEFL_PUT_BITS(z & 0xFFFF, 16); } - } - } - - MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end); - - memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); - memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); - - d->m_pLZ_code_buf = d->m_lz_code_buf + 1; d->m_pLZ_flags = d->m_lz_code_buf; d->m_num_flags_left = 8; d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes; d->m_total_lz_bytes = 0; d->m_block_index++; - - if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0) - { - if (d->m_pPut_buf_func) - { - *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; - if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user)) - return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED); - } - else if (pOutput_buf_start == d->m_output_buf) - { - int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs)); - memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy); - d->m_out_buf_ofs += bytes_to_copy; - if ((n -= bytes_to_copy) != 0) - { - d->m_output_flush_ofs = bytes_to_copy; - d->m_output_flush_remaining = n; - } - } - else - { - d->m_out_buf_ofs += n; - } - } - - return d->m_output_flush_remaining; -} - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES -#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16*)(p) -static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) -{ - mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; - mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; - const mz_uint16 *s = (const mz_uint16*)(d->m_dict + pos), *p, *q; - mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD(s); - MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return; - for ( ; ; ) - { - for ( ; ; ) - { - if (--num_probes_left == 0) return; - #define TDEFL_PROBE \ - next_probe_pos = d->m_next[probe_pos]; \ - if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \ - probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ - if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break; - TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE; - } - if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32; - do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && - (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) ); - if (!probe_len) - { - *pMatch_dist = dist; *pMatch_len = MZ_MIN(max_match_len, TDEFL_MAX_MATCH_LEN); break; - } - else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8*)p == *(const mz_uint8*)q)) > match_len) - { - *pMatch_dist = dist; if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len) break; - c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]); - } - } -} -#else -static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) -{ - mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; - mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; - const mz_uint8 *s = d->m_dict + pos, *p, *q; - mz_uint8 c0 = d->m_dict[pos + match_len], c1 = d->m_dict[pos + match_len - 1]; - MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return; - for ( ; ; ) - { - for ( ; ; ) - { - if (--num_probes_left == 0) return; - #define TDEFL_PROBE \ - next_probe_pos = d->m_next[probe_pos]; \ - if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \ - probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ - if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) break; - TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE; - } - if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break; - if (probe_len > match_len) - { - *pMatch_dist = dist; if ((*pMatch_len = match_len = probe_len) == max_match_len) return; - c0 = d->m_dict[pos + match_len]; c1 = d->m_dict[pos + match_len - 1]; - } - } -} -#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN -static mz_bool tdefl_compress_fast(tdefl_compressor *d) -{ - // Faster, minimally featured LZRW1-style match+parse loop with better register utilization. Intended for applications where raw throughput is valued more highly than ratio. - mz_uint lookahead_pos = d->m_lookahead_pos, lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size, total_lz_bytes = d->m_total_lz_bytes, num_flags_left = d->m_num_flags_left; - mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags; - mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; - - while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size))) - { - const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096; - mz_uint dst_pos = (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; - mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size); - d->m_src_buf_left -= num_bytes_to_process; - lookahead_size += num_bytes_to_process; - - while (num_bytes_to_process) - { - mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process); - memcpy(d->m_dict + dst_pos, d->m_pSrc, n); - if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) - memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos)); - d->m_pSrc += n; - dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK; - num_bytes_to_process -= n; - } - - dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size); - if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE)) break; - - while (lookahead_size >= 4) - { - mz_uint cur_match_dist, cur_match_len = 1; - mz_uint8 *pCur_dict = d->m_dict + cur_pos; - mz_uint first_trigram = (*(const mz_uint32 *)pCur_dict) & 0xFFFFFF; - mz_uint hash = (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) & TDEFL_LEVEL1_HASH_SIZE_MASK; - mz_uint probe_pos = d->m_hash[hash]; - d->m_hash[hash] = (mz_uint16)lookahead_pos; - - if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((*(const mz_uint32 *)(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram)) - { - const mz_uint16 *p = (const mz_uint16 *)pCur_dict; - const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos); - mz_uint32 probe_len = 32; - do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && - (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) ); - cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q); - if (!probe_len) - cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0; - - if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U*1024U))) - { - cur_match_len = 1; - *pLZ_code_buf++ = (mz_uint8)first_trigram; - *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); - d->m_huff_count[0][(mz_uint8)first_trigram]++; - } - else - { - mz_uint32 s0, s1; - cur_match_len = MZ_MIN(cur_match_len, lookahead_size); - - MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE)); - - cur_match_dist--; - - pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN); - *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist; - pLZ_code_buf += 3; - *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80); - - s0 = s_tdefl_small_dist_sym[cur_match_dist & 511]; - s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8]; - d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++; - - d->m_huff_count[0][s_tdefl_len_sym[cur_match_len - TDEFL_MIN_MATCH_LEN]]++; - } - } - else - { - *pLZ_code_buf++ = (mz_uint8)first_trigram; - *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); - d->m_huff_count[0][(mz_uint8)first_trigram]++; - } - - if (--num_flags_left == 0) { num_flags_left = 8; pLZ_flags = pLZ_code_buf++; } - - total_lz_bytes += cur_match_len; - lookahead_pos += cur_match_len; - dict_size = MZ_MIN(dict_size + cur_match_len, TDEFL_LZ_DICT_SIZE); - cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK; - MZ_ASSERT(lookahead_size >= cur_match_len); - lookahead_size -= cur_match_len; - - if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) - { - int n; - d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; - d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; - if ((n = tdefl_flush_block(d, 0)) != 0) - return (n < 0) ? MZ_FALSE : MZ_TRUE; - total_lz_bytes = d->m_total_lz_bytes; pLZ_code_buf = d->m_pLZ_code_buf; pLZ_flags = d->m_pLZ_flags; num_flags_left = d->m_num_flags_left; - } - } - - while (lookahead_size) - { - mz_uint8 lit = d->m_dict[cur_pos]; - - total_lz_bytes++; - *pLZ_code_buf++ = lit; - *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); - if (--num_flags_left == 0) { num_flags_left = 8; pLZ_flags = pLZ_code_buf++; } - - d->m_huff_count[0][lit]++; - - lookahead_pos++; - dict_size = MZ_MIN(dict_size + 1, TDEFL_LZ_DICT_SIZE); - cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; - lookahead_size--; - - if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) - { - int n; - d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; - d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; - if ((n = tdefl_flush_block(d, 0)) != 0) - return (n < 0) ? MZ_FALSE : MZ_TRUE; - total_lz_bytes = d->m_total_lz_bytes; pLZ_code_buf = d->m_pLZ_code_buf; pLZ_flags = d->m_pLZ_flags; num_flags_left = d->m_num_flags_left; - } - } - } - - d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; - d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; - return MZ_TRUE; -} -#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN - -static MZ_FORCEINLINE void tdefl_record_literal(tdefl_compressor *d, mz_uint8 lit) -{ - d->m_total_lz_bytes++; - *d->m_pLZ_code_buf++ = lit; - *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> 1); if (--d->m_num_flags_left == 0) { d->m_num_flags_left = 8; d->m_pLZ_flags = d->m_pLZ_code_buf++; } - d->m_huff_count[0][lit]++; -} - -static MZ_FORCEINLINE void tdefl_record_match(tdefl_compressor *d, mz_uint match_len, mz_uint match_dist) -{ - mz_uint32 s0, s1; - - MZ_ASSERT((match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)); - - d->m_total_lz_bytes += match_len; - - d->m_pLZ_code_buf[0] = (mz_uint8)(match_len - TDEFL_MIN_MATCH_LEN); - - match_dist -= 1; - d->m_pLZ_code_buf[1] = (mz_uint8)(match_dist & 0xFF); - d->m_pLZ_code_buf[2] = (mz_uint8)(match_dist >> 8); d->m_pLZ_code_buf += 3; - - *d->m_pLZ_flags = (mz_uint8)((*d->m_pLZ_flags >> 1) | 0x80); if (--d->m_num_flags_left == 0) { d->m_num_flags_left = 8; d->m_pLZ_flags = d->m_pLZ_code_buf++; } - - s0 = s_tdefl_small_dist_sym[match_dist & 511]; s1 = s_tdefl_large_dist_sym[(match_dist >> 8) & 127]; - d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++; - - if (match_len >= TDEFL_MIN_MATCH_LEN) d->m_huff_count[0][s_tdefl_len_sym[match_len - TDEFL_MIN_MATCH_LEN]]++; -} - -static mz_bool tdefl_compress_normal(tdefl_compressor *d) -{ - const mz_uint8 *pSrc = d->m_pSrc; size_t src_buf_left = d->m_src_buf_left; - tdefl_flush flush = d->m_flush; - - while ((src_buf_left) || ((flush) && (d->m_lookahead_size))) - { - mz_uint len_to_move, cur_match_dist, cur_match_len, cur_pos; - // Update dictionary and hash chains. Keeps the lookahead size equal to TDEFL_MAX_MATCH_LEN. - if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1)) - { - mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK, ins_pos = d->m_lookahead_pos + d->m_lookahead_size - 2; - mz_uint hash = (d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK]; - mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size); - const mz_uint8 *pSrc_end = pSrc + num_bytes_to_process; - src_buf_left -= num_bytes_to_process; - d->m_lookahead_size += num_bytes_to_process; - while (pSrc != pSrc_end) - { - mz_uint8 c = *pSrc++; d->m_dict[dst_pos] = c; if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; - hash = ((hash << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); - d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; d->m_hash[hash] = (mz_uint16)(ins_pos); - dst_pos = (dst_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; ins_pos++; - } - } - else - { - while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) - { - mz_uint8 c = *pSrc++; - mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; - src_buf_left--; - d->m_dict[dst_pos] = c; - if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) - d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; - if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN) - { - mz_uint ins_pos = d->m_lookahead_pos + (d->m_lookahead_size - 1) - 2; - mz_uint hash = ((d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << (TDEFL_LZ_HASH_SHIFT * 2)) ^ (d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); - d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; d->m_hash[hash] = (mz_uint16)(ins_pos); - } - } - } - d->m_dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - d->m_lookahead_size, d->m_dict_size); - if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) - break; - - // Simple lazy/greedy parsing state machine. - len_to_move = 1; cur_match_dist = 0; cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1); cur_pos = d->m_lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; - if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS)) - { - if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) - { - mz_uint8 c = d->m_dict[(cur_pos - 1) & TDEFL_LZ_DICT_SIZE_MASK]; - cur_match_len = 0; while (cur_match_len < d->m_lookahead_size) { if (d->m_dict[cur_pos + cur_match_len] != c) break; cur_match_len++; } - if (cur_match_len < TDEFL_MIN_MATCH_LEN) cur_match_len = 0; else cur_match_dist = 1; - } - } - else - { - tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size, d->m_lookahead_size, &cur_match_dist, &cur_match_len); - } - if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U*1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5))) - { - cur_match_dist = cur_match_len = 0; - } - if (d->m_saved_match_len) - { - if (cur_match_len > d->m_saved_match_len) - { - tdefl_record_literal(d, (mz_uint8)d->m_saved_lit); - if (cur_match_len >= 128) - { - tdefl_record_match(d, cur_match_len, cur_match_dist); - d->m_saved_match_len = 0; len_to_move = cur_match_len; - } - else - { - d->m_saved_lit = d->m_dict[cur_pos]; d->m_saved_match_dist = cur_match_dist; d->m_saved_match_len = cur_match_len; - } - } - else - { - tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist); - len_to_move = d->m_saved_match_len - 1; d->m_saved_match_len = 0; - } - } - else if (!cur_match_dist) - tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]); - else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128)) - { - tdefl_record_match(d, cur_match_len, cur_match_dist); - len_to_move = cur_match_len; - } - else - { - d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]; d->m_saved_match_dist = cur_match_dist; d->m_saved_match_len = cur_match_len; - } - // Move the lookahead forward by len_to_move bytes. - d->m_lookahead_pos += len_to_move; - MZ_ASSERT(d->m_lookahead_size >= len_to_move); - d->m_lookahead_size -= len_to_move; - d->m_dict_size = MZ_MIN(d->m_dict_size + len_to_move, TDEFL_LZ_DICT_SIZE); - // Check if it's time to flush the current LZ codes to the internal output buffer. - if ( (d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) || - ( (d->m_total_lz_bytes > 31*1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) ) - { - int n; - d->m_pSrc = pSrc; d->m_src_buf_left = src_buf_left; - if ((n = tdefl_flush_block(d, 0)) != 0) - return (n < 0) ? MZ_FALSE : MZ_TRUE; - } - } - - d->m_pSrc = pSrc; d->m_src_buf_left = src_buf_left; - return MZ_TRUE; -} - -static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d) -{ - if (d->m_pIn_buf_size) - { - *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; - } - - if (d->m_pOut_buf_size) - { - size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs, d->m_output_flush_remaining); - memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf + d->m_output_flush_ofs, n); - d->m_output_flush_ofs += (mz_uint)n; - d->m_output_flush_remaining -= (mz_uint)n; - d->m_out_buf_ofs += n; - - *d->m_pOut_buf_size = d->m_out_buf_ofs; - } - - return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY; -} - -tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush) -{ - if (!d) - { - if (pIn_buf_size) *pIn_buf_size = 0; - if (pOut_buf_size) *pOut_buf_size = 0; - return TDEFL_STATUS_BAD_PARAM; - } - - d->m_pIn_buf = pIn_buf; d->m_pIn_buf_size = pIn_buf_size; - d->m_pOut_buf = pOut_buf; d->m_pOut_buf_size = pOut_buf_size; - d->m_pSrc = (const mz_uint8 *)(pIn_buf); d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0; - d->m_out_buf_ofs = 0; - d->m_flush = flush; - - if ( ((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) || - (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf) ) - { - if (pIn_buf_size) *pIn_buf_size = 0; - if (pOut_buf_size) *pOut_buf_size = 0; - return (d->m_prev_return_status = TDEFL_STATUS_BAD_PARAM); - } - d->m_wants_to_finish |= (flush == TDEFL_FINISH); - - if ((d->m_output_flush_remaining) || (d->m_finished)) - return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN - if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) && - ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) && - ((d->m_flags & (TDEFL_FILTER_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS | TDEFL_RLE_MATCHES)) == 0)) - { - if (!tdefl_compress_fast(d)) - return d->m_prev_return_status; - } - else -#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN - { - if (!tdefl_compress_normal(d)) - return d->m_prev_return_status; - } - - if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf)) - d->m_adler32 = (mz_uint32)mz_adler32(d->m_adler32, (const mz_uint8 *)pIn_buf, d->m_pSrc - (const mz_uint8 *)pIn_buf); - - if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining)) - { - if (tdefl_flush_block(d, flush) < 0) - return d->m_prev_return_status; - d->m_finished = (flush == TDEFL_FINISH); - if (flush == TDEFL_FULL_FLUSH) { MZ_CLEAR_OBJ(d->m_hash); MZ_CLEAR_OBJ(d->m_next); d->m_dict_size = 0; } - } - - return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); -} - -tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush) -{ - MZ_ASSERT(d->m_pPut_buf_func); return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush); -} - -tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) -{ - d->m_pPut_buf_func = pPut_buf_func; d->m_pPut_buf_user = pPut_buf_user; - d->m_flags = (mz_uint)(flags); d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3; d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0; - d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3; - if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) MZ_CLEAR_OBJ(d->m_hash); - d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size = d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0; - d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0; - d->m_pLZ_code_buf = d->m_lz_code_buf + 1; d->m_pLZ_flags = d->m_lz_code_buf; d->m_num_flags_left = 8; - d->m_pOutput_buf = d->m_output_buf; d->m_pOutput_buf_end = d->m_output_buf; d->m_prev_return_status = TDEFL_STATUS_OKAY; - d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0; d->m_adler32 = 1; - d->m_pIn_buf = NULL; d->m_pOut_buf = NULL; - d->m_pIn_buf_size = NULL; d->m_pOut_buf_size = NULL; - d->m_flush = TDEFL_NO_FLUSH; d->m_pSrc = NULL; d->m_src_buf_left = 0; d->m_out_buf_ofs = 0; - memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); - memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); - return TDEFL_STATUS_OKAY; -} - -tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d) -{ - return d->m_prev_return_status; -} - -mz_uint32 tdefl_get_adler32(tdefl_compressor *d) -{ - return d->m_adler32; -} - -mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) -{ - tdefl_compressor *pComp; mz_bool succeeded; if (((buf_len) && (!pBuf)) || (!pPut_buf_func)) return MZ_FALSE; - pComp = (tdefl_compressor*)MZ_MALLOC(sizeof(tdefl_compressor)); if (!pComp) return MZ_FALSE; - succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY); - succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE); - MZ_FREE(pComp); return succeeded; -} - -typedef struct -{ - size_t m_size, m_capacity; - mz_uint8 *m_pBuf; - mz_bool m_expandable; -} tdefl_output_buffer; - -static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len, void *pUser) -{ - tdefl_output_buffer *p = (tdefl_output_buffer *)pUser; - size_t new_size = p->m_size + len; - if (new_size > p->m_capacity) - { - size_t new_capacity = p->m_capacity; mz_uint8 *pNew_buf; if (!p->m_expandable) return MZ_FALSE; - do { new_capacity = MZ_MAX(128U, new_capacity << 1U); } while (new_size > new_capacity); - pNew_buf = (mz_uint8*)MZ_REALLOC(p->m_pBuf, new_capacity); if (!pNew_buf) return MZ_FALSE; - p->m_pBuf = pNew_buf; p->m_capacity = new_capacity; - } - memcpy((mz_uint8*)p->m_pBuf + p->m_size, pBuf, len); p->m_size = new_size; - return MZ_TRUE; -} - -void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) -{ - tdefl_output_buffer out_buf; MZ_CLEAR_OBJ(out_buf); - if (!pOut_len) return MZ_FALSE; else *pOut_len = 0; - out_buf.m_expandable = MZ_TRUE; - if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) return NULL; - *pOut_len = out_buf.m_size; return out_buf.m_pBuf; -} - -size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) -{ - tdefl_output_buffer out_buf; MZ_CLEAR_OBJ(out_buf); - if (!pOut_buf) return 0; - out_buf.m_pBuf = (mz_uint8*)pOut_buf; out_buf.m_capacity = out_buf_len; - if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) return 0; - return out_buf.m_size; -} - -#ifndef MINIZ_NO_ZLIB_APIS -static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 }; - -// level may actually range from [0,10] (10 is a "hidden" max level, where we want a bit more compression and it's fine if throughput to fall off a cliff on some files). -mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy) -{ - mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0); - if (window_bits > 0) comp_flags |= TDEFL_WRITE_ZLIB_HEADER; - - if (!level) comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS; - else if (strategy == MZ_FILTERED) comp_flags |= TDEFL_FILTER_MATCHES; - else if (strategy == MZ_HUFFMAN_ONLY) comp_flags &= ~TDEFL_MAX_PROBES_MASK; - else if (strategy == MZ_FIXED) comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS; - else if (strategy == MZ_RLE) comp_flags |= TDEFL_RLE_MATCHES; - - return comp_flags; -} -#endif //MINIZ_NO_ZLIB_APIS - -#ifdef _MSC_VER -#pragma warning (push) -#pragma warning (disable:4204) // nonstandard extension used : non-constant aggregate initializer (also supported by GNU C and C99, so no big deal) -#endif - -// Simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299, more context at -// http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/. -void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out) -{ - tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); tdefl_output_buffer out_buf; int i, bpl = w * num_chans, y, z; mz_uint32 c; *pLen_out = 0; - if (!pComp) return NULL; - MZ_CLEAR_OBJ(out_buf); out_buf.m_expandable = MZ_TRUE; out_buf.m_capacity = 57+MZ_MAX(64, (1+bpl)*h); if (NULL == (out_buf.m_pBuf = (mz_uint8*)MZ_MALLOC(out_buf.m_capacity))) { MZ_FREE(pComp); return NULL; } - // write dummy header - for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf); - // compress image data - tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, TDEFL_DEFAULT_MAX_PROBES | TDEFL_WRITE_ZLIB_HEADER); - for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8*)pImage + y * bpl, bpl, TDEFL_NO_FLUSH); } - if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } - // write real header - *pLen_out = out_buf.m_size-41; - { - mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, - 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, - (mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54}; - c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24); - memcpy(out_buf.m_pBuf, pnghdr, 41); - } - // write footer (IDAT CRC-32, followed by IEND chunk) - if (!tdefl_output_buffer_putter("\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf)) { *pLen_out = 0; MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } - c = (mz_uint32)mz_crc32(MZ_CRC32_INIT,out_buf.m_pBuf+41-4, *pLen_out+4); for (i=0; i<4; ++i, c<<=8) (out_buf.m_pBuf+out_buf.m_size-16)[i] = (mz_uint8)(c >> 24); - // compute final size of file, grab compressed data buffer and return - *pLen_out += 57; MZ_FREE(pComp); return out_buf.m_pBuf; -} - -#ifdef _MSC_VER -#pragma warning (pop) -#endif - -// ------------------- .ZIP archive reading - -#ifndef MINIZ_NO_ARCHIVE_APIS - -#ifdef MINIZ_NO_STDIO - #define MZ_FILE void * -#else - #include - #include - #if defined(_MSC_VER) || defined(__MINGW64__) - #include - #define MZ_FILE FILE - #define MZ_FOPEN fopen - #define MZ_FCLOSE fclose - #define MZ_FREAD fread - #define MZ_FWRITE fwrite - #define MZ_FTELL64 _ftelli64 - #define MZ_FSEEK64 _fseeki64 - #define MZ_FILE_STAT_STRUCT _stat - #define MZ_FILE_STAT _stat - #define MZ_FFLUSH fflush - #define MZ_FREOPEN freopen - #define MZ_DELETE_FILE remove - #elif defined(__MINGW32__) - #include - #define MZ_FILE FILE - #define MZ_FOPEN fopen - #define MZ_FCLOSE fclose - #define MZ_FREAD fread - #define MZ_FWRITE fwrite - #define MZ_FTELL64 ftello64 - #define MZ_FSEEK64 fseeko64 - #define MZ_FILE_STAT_STRUCT _stat - #define MZ_FILE_STAT _stat - #define MZ_FFLUSH fflush - #define MZ_FREOPEN freopen - #define MZ_DELETE_FILE remove - #else - #include - #define MZ_FILE FILE - #define MZ_FOPEN fopen - #define MZ_FCLOSE fclose - #define MZ_FREAD fread - #define MZ_FWRITE fwrite - #define MZ_FTELL64 ftello - #define MZ_FSEEK64 fseeko - #define MZ_FILE_STAT_STRUCT stat - #define MZ_FILE_STAT stat - #define MZ_FFLUSH fflush - #define MZ_FREOPEN freopen - #define MZ_DELETE_FILE remove - #endif // #ifdef _MSC_VER -#endif // #ifdef MINIZ_NO_STDIO - -#define MZ_TOLOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c)) - -// Various ZIP archive enums. To completely avoid cross platform compiler alignment and platform endian issues, miniz.c doesn't use structs for any of this stuff. -enum -{ - // ZIP archive identifiers and record sizes - MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06054b50, MZ_ZIP_CENTRAL_DIR_HEADER_SIG = 0x02014b50, MZ_ZIP_LOCAL_DIR_HEADER_SIG = 0x04034b50, - MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22, - // Central directory header record offsets - MZ_ZIP_CDH_SIG_OFS = 0, MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4, MZ_ZIP_CDH_VERSION_NEEDED_OFS = 6, MZ_ZIP_CDH_BIT_FLAG_OFS = 8, - MZ_ZIP_CDH_METHOD_OFS = 10, MZ_ZIP_CDH_FILE_TIME_OFS = 12, MZ_ZIP_CDH_FILE_DATE_OFS = 14, MZ_ZIP_CDH_CRC32_OFS = 16, - MZ_ZIP_CDH_COMPRESSED_SIZE_OFS = 20, MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS = 24, MZ_ZIP_CDH_FILENAME_LEN_OFS = 28, MZ_ZIP_CDH_EXTRA_LEN_OFS = 30, - MZ_ZIP_CDH_COMMENT_LEN_OFS = 32, MZ_ZIP_CDH_DISK_START_OFS = 34, MZ_ZIP_CDH_INTERNAL_ATTR_OFS = 36, MZ_ZIP_CDH_EXTERNAL_ATTR_OFS = 38, MZ_ZIP_CDH_LOCAL_HEADER_OFS = 42, - // Local directory header offsets - MZ_ZIP_LDH_SIG_OFS = 0, MZ_ZIP_LDH_VERSION_NEEDED_OFS = 4, MZ_ZIP_LDH_BIT_FLAG_OFS = 6, MZ_ZIP_LDH_METHOD_OFS = 8, MZ_ZIP_LDH_FILE_TIME_OFS = 10, - MZ_ZIP_LDH_FILE_DATE_OFS = 12, MZ_ZIP_LDH_CRC32_OFS = 14, MZ_ZIP_LDH_COMPRESSED_SIZE_OFS = 18, MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22, - MZ_ZIP_LDH_FILENAME_LEN_OFS = 26, MZ_ZIP_LDH_EXTRA_LEN_OFS = 28, - // End of central directory offsets - MZ_ZIP_ECDH_SIG_OFS = 0, MZ_ZIP_ECDH_NUM_THIS_DISK_OFS = 4, MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS = 6, MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 8, - MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS = 10, MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12, MZ_ZIP_ECDH_CDIR_OFS_OFS = 16, MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20, -}; - -typedef struct -{ - void *m_p; - size_t m_size, m_capacity; - mz_uint m_element_size; -} mz_zip_array; - -struct mz_zip_internal_state_tag -{ - mz_zip_array m_central_dir; - mz_zip_array m_central_dir_offsets; - mz_zip_array m_sorted_central_dir_offsets; - MZ_FILE *m_pFile; - void *m_pMem; - size_t m_mem_size; - size_t m_mem_capacity; -}; - -#define MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(array_ptr, element_size) (array_ptr)->m_element_size = element_size -#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[index] - -static MZ_FORCEINLINE void mz_zip_array_clear(mz_zip_archive *pZip, mz_zip_array *pArray) -{ - pZip->m_pFree(pZip->m_pAlloc_opaque, pArray->m_p); - memset(pArray, 0, sizeof(mz_zip_array)); -} - -static mz_bool mz_zip_array_ensure_capacity(mz_zip_archive *pZip, mz_zip_array *pArray, size_t min_new_capacity, mz_uint growing) -{ - void *pNew_p; size_t new_capacity = min_new_capacity; MZ_ASSERT(pArray->m_element_size); if (pArray->m_capacity >= min_new_capacity) return MZ_TRUE; - if (growing) { new_capacity = MZ_MAX(1, pArray->m_capacity); while (new_capacity < min_new_capacity) new_capacity *= 2; } - if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity))) return MZ_FALSE; - pArray->m_p = pNew_p; pArray->m_capacity = new_capacity; - return MZ_TRUE; -} - -static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_capacity, mz_uint growing) -{ - if (new_capacity > pArray->m_capacity) { if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing)) return MZ_FALSE; } - return MZ_TRUE; -} - -static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_size, mz_uint growing) -{ - if (new_size > pArray->m_capacity) { if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing)) return MZ_FALSE; } - pArray->m_size = new_size; - return MZ_TRUE; -} - -static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip, mz_zip_array *pArray, size_t n) -{ - return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE); -} - -static MZ_FORCEINLINE mz_bool mz_zip_array_push_back(mz_zip_archive *pZip, mz_zip_array *pArray, const void *pElements, size_t n) -{ - size_t orig_size = pArray->m_size; if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE)) return MZ_FALSE; - memcpy((mz_uint8*)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size); - return MZ_TRUE; -} - -#ifndef MINIZ_NO_TIME -static time_t mz_zip_dos_to_time_t(int dos_time, int dos_date) -{ - struct tm tm; - memset(&tm, 0, sizeof(tm)); tm.tm_isdst = -1; - tm.tm_year = ((dos_date >> 9) & 127) + 1980 - 1900; tm.tm_mon = ((dos_date >> 5) & 15) - 1; tm.tm_mday = dos_date & 31; - tm.tm_hour = (dos_time >> 11) & 31; tm.tm_min = (dos_time >> 5) & 63; tm.tm_sec = (dos_time << 1) & 62; - return mktime(&tm); -} - -static void mz_zip_time_to_dos_time(time_t time, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date) -{ - struct tm *tm = localtime(&time); - *pDOS_time = (mz_uint16)(((tm->tm_hour) << 11) + ((tm->tm_min) << 5) + ((tm->tm_sec) >> 1)); - *pDOS_date = (mz_uint16)(((tm->tm_year + 1900 - 1980) << 9) + ((tm->tm_mon + 1) << 5) + tm->tm_mday); -} -#endif - -#ifndef MINIZ_NO_STDIO -static mz_bool mz_zip_get_file_modified_time(const char *pFilename, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date) -{ -#ifdef MINIZ_NO_TIME - (void)pFilename; *pDOS_date = *pDOS_time = 0; -#else - struct MZ_FILE_STAT_STRUCT file_stat; if (MZ_FILE_STAT(pFilename, &file_stat) != 0) return MZ_FALSE; - mz_zip_time_to_dos_time(file_stat.st_mtime, pDOS_time, pDOS_date); -#endif // #ifdef MINIZ_NO_TIME - return MZ_TRUE; -} - -static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time, time_t modified_time) -{ -#ifndef MINIZ_NO_TIME - struct utimbuf t; t.actime = access_time; t.modtime = modified_time; - return !utime(pFilename, &t); -#else - pFilename, access_time, modified_time; - return MZ_TRUE; -#endif // #ifndef MINIZ_NO_TIME -} -#endif - -static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint32 flags) -{ - (void)flags; - if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) - return MZ_FALSE; - - if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func; - if (!pZip->m_pFree) pZip->m_pFree = def_free_func; - if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func; - - pZip->m_zip_mode = MZ_ZIP_MODE_READING; - pZip->m_archive_size = 0; - pZip->m_central_directory_file_ofs = 0; - pZip->m_total_files = 0; - - if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) - return MZ_FALSE; - memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); - return MZ_TRUE; -} - -static MZ_FORCEINLINE mz_bool mz_zip_reader_filename_less(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, mz_uint r_index) -{ - const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; - const mz_uint8 *pR = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, r_index)); - mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS), r_len = MZ_READ_LE16(pR + MZ_ZIP_CDH_FILENAME_LEN_OFS); - mz_uint8 l = 0, r = 0; - pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; pR += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; - pE = pL + MZ_MIN(l_len, r_len); - while (pL < pE) - { - if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) - break; - pL++; pR++; - } - return (pL == pE) ? (l_len < r_len) : (l < r); -} - -#define MZ_SWAP_UINT32(a, b) do { mz_uint32 t = a; a = b; b = t; } MZ_MACRO_END - -// Heap sort of lowercased filenames, used to help accelerate plain central directory searches by mz_zip_reader_locate_file(). (Could also use qsort(), but it could allocate memory.) -static void mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip) -{ - mz_zip_internal_state *pState = pZip->m_pState; - const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; - const mz_zip_array *pCentral_dir = &pState->m_central_dir; - mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); - const int size = pZip->m_total_files; - int start = (size - 2) >> 1, end; - while (start >= 0) - { - int child, root = start; - for ( ; ; ) - { - if ((child = (root << 1) + 1) >= size) - break; - child += (((child + 1) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1]))); - if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) - break; - MZ_SWAP_UINT32(pIndices[root], pIndices[child]); root = child; - } - start--; - } - - end = size - 1; - while (end > 0) - { - int child, root = 0; - MZ_SWAP_UINT32(pIndices[end], pIndices[0]); - for ( ; ; ) - { - if ((child = (root << 1) + 1) >= end) - break; - child += (((child + 1) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1])); - if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) - break; - MZ_SWAP_UINT32(pIndices[root], pIndices[child]); root = child; - } - end--; - } -} - -static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, mz_uint32 flags) -{ - mz_uint cdir_size, num_this_disk, cdir_disk_index; - mz_uint64 cdir_ofs; - mz_int64 cur_file_ofs; - const mz_uint8 *p; - mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; mz_uint8 *pBuf = (mz_uint8 *)buf_u32; - // Basic sanity checks - reject files which are too small, and check the first 4 bytes of the file to make sure a local header is there. - if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) - return MZ_FALSE; - // Find the end of central directory record by scanning the file from the end towards the beginning. - cur_file_ofs = MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0); - for ( ; ; ) - { - int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs); - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n) - return MZ_FALSE; - for (i = n - 4; i >= 0; --i) - if (MZ_READ_LE32(pBuf + i) == MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) - break; - if (i >= 0) - { - cur_file_ofs += i; - break; - } - if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (0xFFFF + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE))) - return MZ_FALSE; - cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0); - } - // Read and verify the end of central directory record. - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) - return MZ_FALSE; - if ((MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) || - ((pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS)) != MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS))) - return MZ_FALSE; - - num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS); - cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS); - if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1))) - return MZ_FALSE; - - if ((cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS)) < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) - return MZ_FALSE; - - cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); - if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size) - return MZ_FALSE; - - pZip->m_central_directory_file_ofs = cdir_ofs; - - if (pZip->m_total_files) - { - mz_uint i, n; - // Read the entire central directory into a heap block, and allocate another heap block to hold the unsorted central dir file record offsets, and another to hold the sorted indices. - if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) || - (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)) || - (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))) - return MZ_FALSE; - if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size) - return MZ_FALSE; - - // Now create an index into the central directory file records, do some basic sanity checking on each record, and check for zip64 entries (which are not yet supported). - p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p; - for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) - { - mz_uint total_header_size, comp_size, decomp_size, disk_index; - if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)) - return MZ_FALSE; - MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, i) = (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p); - MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, mz_uint32, i) = i; - comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); - decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); - if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size) || (decomp_size == 0xFFFFFFFF) || (comp_size == 0xFFFFFFFF)) - return MZ_FALSE; - disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS); - if ((disk_index != num_this_disk) && (disk_index != 1)) - return MZ_FALSE; - if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size) - return MZ_FALSE; - if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n) - return MZ_FALSE; - n -= total_header_size; p += total_header_size; - } - } - - if ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) - mz_zip_reader_sort_central_dir_offsets_by_filename(pZip); - - return MZ_TRUE; -} - -mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint32 flags) -{ - if ((!pZip) || (!pZip->m_pRead)) - return MZ_FALSE; - if (!mz_zip_reader_init_internal(pZip, flags)) - return MZ_FALSE; - pZip->m_archive_size = size; - if (!mz_zip_reader_read_central_dir(pZip, flags)) - { - mz_zip_reader_end(pZip); - return MZ_FALSE; - } - return MZ_TRUE; -} - -static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) -{ - mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; - size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n); - memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s); - return s; -} - -mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint32 flags) -{ - if (!mz_zip_reader_init_internal(pZip, flags)) - return MZ_FALSE; - pZip->m_archive_size = size; - pZip->m_pRead = mz_zip_mem_read_func; - pZip->m_pIO_opaque = pZip; - pZip->m_pState->m_pMem = (void *)pMem; - pZip->m_pState->m_mem_size = size; - if (!mz_zip_reader_read_central_dir(pZip, flags)) - { - mz_zip_reader_end(pZip); - return MZ_FALSE; - } - return MZ_TRUE; -} - -#ifndef MINIZ_NO_STDIO -static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) -{ - mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; - mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); - if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) - return 0; - return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile); -} - -mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags) -{ - mz_uint64 file_size; - MZ_FILE *pFile = MZ_FOPEN(pFilename, "rb"); - if (!pFile) - return MZ_FALSE; - if (MZ_FSEEK64(pFile, 0, SEEK_END)) - return MZ_FALSE; - file_size = MZ_FTELL64(pFile); - if (!mz_zip_reader_init_internal(pZip, flags)) - { - MZ_FCLOSE(pFile); - return MZ_FALSE; - } - pZip->m_pRead = mz_zip_file_read_func; - pZip->m_pIO_opaque = pZip; - pZip->m_pState->m_pFile = pFile; - pZip->m_archive_size = file_size; - if (!mz_zip_reader_read_central_dir(pZip, flags)) - { - mz_zip_reader_end(pZip); - return MZ_FALSE; - } - return MZ_TRUE; -} -#endif // #ifndef MINIZ_NO_STDIO - -mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip) -{ - return pZip ? pZip->m_total_files : 0; -} - -static MZ_FORCEINLINE const mz_uint8 *mz_zip_reader_get_cdh(mz_zip_archive *pZip, mz_uint file_index) -{ - if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) - return NULL; - return &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); -} - -mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index) -{ - mz_uint m_bit_flag; - const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); - if (!p) - return MZ_FALSE; - m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); - return (m_bit_flag & 1); -} - -mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index) -{ - mz_uint filename_len, internal_attr, external_attr; - const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); - if (!p) - return MZ_FALSE; - - internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS); - external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); - if ((!internal_attr) && ((external_attr & 0x10) != 0)) - return MZ_TRUE; - - filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); - if (filename_len) - { - if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/') - return MZ_TRUE; - } - - return MZ_FALSE; -} - -mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat) -{ - mz_uint n; - const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); - if ((!p) || (!pStat)) - return MZ_FALSE; - - // Unpack the central directory record. - pStat->m_file_index = file_index; - pStat->m_central_dir_ofs = MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index); - pStat->m_version_made_by = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS); - pStat->m_version_needed = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_NEEDED_OFS); - pStat->m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); - pStat->m_method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS); -#ifndef MINIZ_NO_TIME - pStat->m_time = mz_zip_dos_to_time_t(MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_TIME_OFS), MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_DATE_OFS)); -#endif - pStat->m_crc32 = MZ_READ_LE32(p + MZ_ZIP_CDH_CRC32_OFS); - pStat->m_comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); - pStat->m_uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); - pStat->m_internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS); - pStat->m_external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); - pStat->m_local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS); - - // Copy as much of the filename and comment as possible. - n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE - 1); - memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); pStat->m_filename[n] = '\0'; - - n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS); n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1); - pStat->m_comment_size = n; - memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n); pStat->m_comment[n] = '\0'; - - return MZ_TRUE; -} - -mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size) -{ - mz_uint n; - const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); - if (!p) { if (filename_buf_size) pFilename[0] = '\0'; return 0; } - n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); - if (filename_buf_size) - { - n = MZ_MIN(n, filename_buf_size - 1); - memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); - pFilename[n] = '\0'; - } - return n + 1; -} - -static MZ_FORCEINLINE mz_bool mz_zip_reader_string_equal(const char *pA, const char *pB, mz_uint len, mz_uint flags) -{ - mz_uint i; - if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) - return 0 == memcmp(pA, pB, len); - for (i = 0; i < len; ++i) - if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i])) - return MZ_FALSE; - return MZ_TRUE; -} - -static MZ_FORCEINLINE int mz_zip_reader_filename_compare(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, const char *pR, mz_uint r_len) -{ - const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; - mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS); - mz_uint8 l = 0, r = 0; - pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; - pE = pL + MZ_MIN(l_len, r_len); - while (pL < pE) - { - if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) - break; - pL++; pR++; - } - return (pL == pE) ? (int)(l_len - r_len) : (l - r); -} - -static int mz_zip_reader_locate_file_binary_search(mz_zip_archive *pZip, const char *pFilename) -{ - mz_zip_internal_state *pState = pZip->m_pState; - const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; - const mz_zip_array *pCentral_dir = &pState->m_central_dir; - mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); - const int size = pZip->m_total_files; - const mz_uint filename_len = (mz_uint)strlen(pFilename); - int l = 0, h = size - 1; - while (l <= h) - { - int m = (l + h) >> 1, file_index = pIndices[m], comp = mz_zip_reader_filename_compare(pCentral_dir, pCentral_dir_offsets, file_index, pFilename, filename_len); - if (!comp) - return file_index; - else if (comp < 0) - l = m + 1; - else - h = m - 1; - } - return -1; -} - -int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags) -{ - mz_uint file_index; size_t name_len, comment_len; - if ((!pZip) || (!pZip->m_pState) || (!pName) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) - return -1; - if (((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_p)) - return mz_zip_reader_locate_file_binary_search(pZip, pName); - name_len = strlen(pName); if (name_len > 0xFFFF) return -1; - comment_len = pComment ? strlen(pComment) : 0; if (comment_len > 0xFFFF) return -1; - for (file_index = 0; file_index < pZip->m_total_files; file_index++) - { - const mz_uint8 *pHeader = &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); - mz_uint filename_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_FILENAME_LEN_OFS); - const char *pFilename = (const char *)pHeader + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; - if (filename_len < name_len) - continue; - if (comment_len) - { - mz_uint file_extra_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_EXTRA_LEN_OFS), file_comment_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_COMMENT_LEN_OFS); - const char *pFile_comment = pFilename + filename_len + file_extra_len; - if ((file_comment_len != comment_len) || (!mz_zip_reader_string_equal(pComment, pFile_comment, file_comment_len, flags))) - continue; - } - if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len)) - { - int ofs = filename_len - 1; - do - { - if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':')) - break; - } while (--ofs >= 0); - ofs++; - pFilename += ofs; filename_len -= ofs; - } - if ((filename_len == name_len) && (mz_zip_reader_string_equal(pName, pFilename, filename_len, flags))) - return file_index; - } - return -1; -} - -mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) -{ - int status = TINFL_STATUS_DONE; - mz_uint64 needed_size, cur_file_ofs, comp_remaining, out_buf_ofs = 0, read_buf_size, read_buf_ofs = 0, read_buf_avail; - mz_zip_archive_file_stat file_stat; - void *pRead_buf; - mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; - tinfl_decompressor inflator; - - if ((buf_size) && (!pBuf)) - return MZ_FALSE; - - if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) - return MZ_FALSE; - - if (!file_stat.m_comp_size) - return MZ_TRUE; - - // Encryption and patch files are not supported. - if (file_stat.m_bit_flag & (1 | 32)) - return MZ_FALSE; - - // This function only supports stored and deflate. - if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) - return MZ_FALSE; - - // Ensure supplied output buffer is large enough. - needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size; - if (buf_size < needed_size) - return MZ_FALSE; - - // Read and parse the local directory entry. - cur_file_ofs = file_stat.m_local_header_ofs; - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) - return MZ_FALSE; - if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) - return MZ_FALSE; - - cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); - if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) - return MZ_FALSE; - - if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) - { - // The file is stored or the caller has requested the compressed data. - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size) - return MZ_FALSE; - return ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) != 0) || (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) == file_stat.m_crc32); - } - - // Decompress the file either directly from memory or from a file input buffer. - tinfl_init(&inflator); - - if (pZip->m_pState->m_pMem) - { - // Read directly from the archive in memory. - pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; - read_buf_size = read_buf_avail = file_stat.m_comp_size; - comp_remaining = 0; - } - else if (pUser_read_buf) - { - // Use a user provided read buffer. - if (!user_read_buf_size) - return MZ_FALSE; - pRead_buf = (mz_uint8 *)pUser_read_buf; - read_buf_size = user_read_buf_size; - read_buf_avail = 0; - comp_remaining = file_stat.m_uncomp_size; - } - else - { - // Temporarily allocate a read buffer. - read_buf_size = MZ_MIN(file_stat.m_comp_size, MZ_ZIP_MAX_IO_BUF_SIZE); -#ifdef _MSC_VER - if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF)) -#else - if (((sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF)) -#endif - return MZ_FALSE; - if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) - return MZ_FALSE; - read_buf_avail = 0; - comp_remaining = file_stat.m_comp_size; - } - - do - { - size_t in_buf_size, out_buf_size = (size_t)(file_stat.m_uncomp_size - out_buf_ofs); - if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) - { - read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) - { - status = TINFL_STATUS_FAILED; - break; - } - cur_file_ofs += read_buf_avail; - comp_remaining -= read_buf_avail; - read_buf_ofs = 0; - } - in_buf_size = (size_t)read_buf_avail; - status = tinfl_decompress(&inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0)); - read_buf_avail -= in_buf_size; - read_buf_ofs += in_buf_size; - out_buf_ofs += out_buf_size; - } while (status == TINFL_STATUS_NEEDS_MORE_INPUT); - - if (status == TINFL_STATUS_DONE) - { - // Make sure the entire file was decompressed, and check its CRC. - if ((out_buf_ofs != file_stat.m_uncomp_size) || (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)) - status = TINFL_STATUS_FAILED; - } - - if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf)) - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - - return status == TINFL_STATUS_DONE; -} - -mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) -{ - int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); - if (file_index < 0) - return MZ_FALSE; - return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, pUser_read_buf, user_read_buf_size); -} - -mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags) -{ - return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, NULL, 0); -} - -mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags) -{ - return mz_zip_reader_extract_file_to_mem_no_alloc(pZip, pFilename, pBuf, buf_size, flags, NULL, 0); -} - -void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags) -{ - mz_uint64 comp_size, uncomp_size, alloc_size; - const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); - void *pBuf; - - if (pSize) - *pSize = 0; - if (!p) - return NULL; - - comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); - uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); - - alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size; -#ifdef _MSC_VER - if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF)) -#else - if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF)) -#endif - return NULL; - if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size))) - return NULL; - - if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size, flags)) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - return NULL; - } - - if (pSize) *pSize = (size_t)alloc_size; - return pBuf; -} - -void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags) -{ - int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); - if (file_index < 0) - { - if (pSize) *pSize = 0; - return MZ_FALSE; - } - return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags); -} - -mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) -{ - int status = TINFL_STATUS_DONE; mz_uint file_crc32 = MZ_CRC32_INIT; - mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining, out_buf_ofs = 0, cur_file_ofs; - mz_zip_archive_file_stat file_stat; - void *pRead_buf = NULL; void *pWrite_buf = NULL; - mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; - - if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) - return MZ_FALSE; - - if (!file_stat.m_comp_size) - return MZ_TRUE; - - // Encryption and patch files are not supported. - if (file_stat.m_bit_flag & (1 | 32)) - return MZ_FALSE; - - // This function only supports stored and deflate. - if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) - return MZ_FALSE; - - // Read and parse the local directory entry. - cur_file_ofs = file_stat.m_local_header_ofs; - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) - return MZ_FALSE; - if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) - return MZ_FALSE; - - cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); - if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) - return MZ_FALSE; - - // Decompress the file either directly from memory or from a file input buffer. - if (pZip->m_pState->m_pMem) - { - pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; - read_buf_size = read_buf_avail = file_stat.m_comp_size; - comp_remaining = 0; - } - else - { - read_buf_size = MZ_MIN(file_stat.m_comp_size, MZ_ZIP_MAX_IO_BUF_SIZE); - if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) - return MZ_FALSE; - read_buf_avail = 0; - comp_remaining = file_stat.m_comp_size; - } - - if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) - { - // The file is stored or the caller has requested the compressed data. - if (pZip->m_pState->m_pMem) - { -#ifdef _MSC_VER - if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > 0xFFFFFFFF)) -#else - if (((sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > 0xFFFFFFFF)) -#endif - return MZ_FALSE; - if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size) - status = TINFL_STATUS_FAILED; - else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) - file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)file_stat.m_comp_size); - cur_file_ofs += file_stat.m_comp_size; - out_buf_ofs += file_stat.m_comp_size; - comp_remaining = 0; - } - else - { - while (comp_remaining) - { - read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) - { - status = TINFL_STATUS_FAILED; - break; - } - - if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) - file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail); - - if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) - { - status = TINFL_STATUS_FAILED; - break; - } - cur_file_ofs += read_buf_avail; - out_buf_ofs += read_buf_avail; - comp_remaining -= read_buf_avail; - } - } - } - else - { - tinfl_decompressor inflator; - tinfl_init(&inflator); - - if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE))) - status = TINFL_STATUS_FAILED; - else - { - do - { - mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); - size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); - if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) - { - read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); - if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) - { - status = TINFL_STATUS_FAILED; - break; - } - cur_file_ofs += read_buf_avail; - comp_remaining -= read_buf_avail; - read_buf_ofs = 0; - } - - in_buf_size = (size_t)read_buf_avail; - status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0); - read_buf_avail -= in_buf_size; - read_buf_ofs += in_buf_size; - - if (out_buf_size) - { - if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size) - { - status = TINFL_STATUS_FAILED; - break; - } - file_crc32 = (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size); - if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size) - { - status = TINFL_STATUS_FAILED; - break; - } - } - } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT)); - } - } - - if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) - { - // Make sure the entire file was decompressed, and check its CRC. - if ((out_buf_ofs != file_stat.m_uncomp_size) || (file_crc32 != file_stat.m_crc32)) - status = TINFL_STATUS_FAILED; - } - - if (!pZip->m_pState->m_pMem) - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - if (pWrite_buf) - pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf); - - return status == TINFL_STATUS_DONE; -} - -mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) -{ - int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); - if (file_index < 0) - return MZ_FALSE; - return mz_zip_reader_extract_to_callback(pZip, file_index, pCallback, pOpaque, flags); -} - -#ifndef MINIZ_NO_STDIO -static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs, const void *pBuf, size_t n) -{ - (void)ofs; return MZ_FWRITE(pBuf, 1, n, (MZ_FILE*)pOpaque); -} - -mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags) -{ - mz_bool status; - mz_zip_archive_file_stat file_stat; - MZ_FILE *pFile; - if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) - return MZ_FALSE; - pFile = MZ_FOPEN(pDst_filename, "wb"); - if (!pFile) - return MZ_FALSE; - status = mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags); - if (MZ_FCLOSE(pFile) == EOF) - return MZ_FALSE; -#ifndef MINIZ_NO_TIME - if (status) - mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time); -#endif - return status; -} -#endif // #ifndef MINIZ_NO_STDIO - -mz_bool mz_zip_reader_end(mz_zip_archive *pZip) -{ - if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) - return MZ_FALSE; - - if (pZip->m_pState) - { - mz_zip_internal_state *pState = pZip->m_pState; pZip->m_pState = NULL; - mz_zip_array_clear(pZip, &pState->m_central_dir); - mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); - mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); - -#ifndef MINIZ_NO_STDIO - if (pState->m_pFile) - { - MZ_FCLOSE(pState->m_pFile); - pState->m_pFile = NULL; - } -#endif // #ifndef MINIZ_NO_STDIO - - pZip->m_pFree(pZip->m_pAlloc_opaque, pState); - } - pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; - - return MZ_TRUE; -} - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags) -{ - int file_index = mz_zip_reader_locate_file(pZip, pArchive_filename, NULL, flags); - if (file_index < 0) - return MZ_FALSE; - return mz_zip_reader_extract_to_file(pZip, file_index, pDst_filename, flags); -} -#endif - -// ------------------- .ZIP archive writing - -#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -static void mz_write_le16(mz_uint8 *p, mz_uint16 v) { p[0] = (mz_uint8)v; p[1] = (mz_uint8)(v >> 8); } -static void mz_write_le32(mz_uint8 *p, mz_uint32 v) { p[0] = (mz_uint8)v; p[1] = (mz_uint8)(v >> 8); p[2] = (mz_uint8)(v >> 16); p[3] = (mz_uint8)(v >> 24); } -#define MZ_WRITE_LE16(p, v) mz_write_le16((mz_uint8 *)(p), (mz_uint16)(v)) -#define MZ_WRITE_LE32(p, v) mz_write_le32((mz_uint8 *)(p), (mz_uint32)(v)) - -mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size) -{ - if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) - return MZ_FALSE; - - if (pZip->m_file_offset_alignment) - { - // Ensure user specified file offset alignment is a power of 2. - if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1)) - return MZ_FALSE; - } - - if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func; - if (!pZip->m_pFree) pZip->m_pFree = def_free_func; - if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func; - - pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; - pZip->m_archive_size = existing_size; - pZip->m_central_directory_file_ofs = 0; - pZip->m_total_files = 0; - - if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) - return MZ_FALSE; - memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); - MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); - return MZ_TRUE; -} - -static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) -{ - mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; - mz_zip_internal_state *pState = pZip->m_pState; - mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size); -#ifdef _MSC_VER - if ((!n) || ((0, sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))) -#else - if ((!n) || ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))) -#endif - return 0; - if (new_size > pState->m_mem_capacity) - { - void *pNew_block; - size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity); while (new_capacity < new_size) new_capacity *= 2; - if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity))) - return 0; - pState->m_pMem = pNew_block; pState->m_mem_capacity = new_capacity; - } - memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n); - pState->m_mem_size = (size_t)new_size; - return n; -} - -mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size) -{ - pZip->m_pWrite = mz_zip_heap_write_func; - pZip->m_pIO_opaque = pZip; - if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) - return MZ_FALSE; - if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning))) - { - if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size))) - { - mz_zip_writer_end(pZip); - return MZ_FALSE; - } - pZip->m_pState->m_mem_capacity = initial_allocation_size; - } - return MZ_TRUE; -} - -#ifndef MINIZ_NO_STDIO -static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) -{ - mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; - mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); - if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) - return 0; - return MZ_FWRITE(pBuf, 1, n, pZip->m_pState->m_pFile); -} - -mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning) -{ - MZ_FILE *pFile; - pZip->m_pWrite = mz_zip_file_write_func; - pZip->m_pIO_opaque = pZip; - if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) - return MZ_FALSE; - if (NULL == (pFile = MZ_FOPEN(pFilename, "wb"))) - { - mz_zip_writer_end(pZip); - return MZ_FALSE; - } - pZip->m_pState->m_pFile = pFile; - if (size_to_reserve_at_beginning) - { - mz_uint64 cur_ofs = 0; char buf[4096]; MZ_CLEAR_OBJ(buf); - do - { - size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning); - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n) - { - mz_zip_writer_end(pZip); - return MZ_FALSE; - } - cur_ofs += n; size_to_reserve_at_beginning -= n; - } while (size_to_reserve_at_beginning); - } - return MZ_TRUE; -} -#endif // #ifndef MINIZ_NO_STDIO - -mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename) -{ - mz_zip_internal_state *pState; - if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) - return MZ_FALSE; - // No sense in trying to write to an archive that's already at the support max size - if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) - return MZ_FALSE; - - pState = pZip->m_pState; - - if (pState->m_pFile) - { -#ifdef MINIZ_NO_STDIO - pFilename; return MZ_FALSE; -#else - // Archive is being read from stdio - try to reopen as writable. - if (pZip->m_pIO_opaque != pZip) - return MZ_FALSE; - if (!pFilename) - return MZ_FALSE; - pZip->m_pWrite = mz_zip_file_write_func; - if (NULL == (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile))) - { - // The mz_zip_archive is now in a bogus state because pState->m_pFile is NULL, so just close it. - mz_zip_reader_end(pZip); - return MZ_FALSE; - } -#endif // #ifdef MINIZ_NO_STDIO - } - else if (pState->m_pMem) - { - // Archive lives in a memory block. Assume it's from the heap that we can resize using the realloc callback. - if (pZip->m_pIO_opaque != pZip) - return MZ_FALSE; - pState->m_mem_capacity = pState->m_mem_size; - pZip->m_pWrite = mz_zip_heap_write_func; - } - // Archive is being read via a user provided read function - make sure the user has specified a write function too. - else if (!pZip->m_pWrite) - return MZ_FALSE; - - // Start writing new files at the archive's current central directory location. - pZip->m_archive_size = pZip->m_central_directory_file_ofs; - pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; - pZip->m_central_directory_file_ofs = 0; - - return MZ_TRUE; -} - -mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags) -{ - return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0, level_and_flags, 0, 0); -} - -typedef struct -{ - mz_zip_archive *m_pZip; - mz_uint64 m_cur_archive_file_ofs; - mz_uint64 m_comp_size; -} mz_zip_writer_add_state; - -static mz_bool mz_zip_writer_add_put_buf_callback(const void* pBuf, int len, void *pUser) -{ - mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser; - if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len) - return MZ_FALSE; - pState->m_cur_archive_file_ofs += len; - pState->m_comp_size += len; - return MZ_TRUE; -} - -static mz_bool mz_zip_writer_create_local_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date) -{ - (void)pZip; - memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE); - MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date); - MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32); - MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, comp_size); - MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, uncomp_size); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size); - MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size); - return MZ_TRUE; -} - -static mz_bool mz_zip_writer_create_central_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint16 comment_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, mz_uint64 local_header_ofs, mz_uint32 ext_attributes) -{ - (void)pZip; - memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, comp_size); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, uncomp_size); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size); - MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes); - MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_header_ofs); - return MZ_TRUE; -} - -static mz_bool mz_zip_writer_add_to_central_dir(mz_zip_archive *pZip, const char *pFilename, mz_uint16 filename_size, const void *pExtra, mz_uint16 extra_size, const void *pComment, mz_uint16 comment_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, mz_uint64 local_header_ofs, mz_uint32 ext_attributes) -{ - mz_zip_internal_state *pState = pZip->m_pState; - mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size; - size_t orig_central_dir_size = pState->m_central_dir.m_size; - mz_uint8 central_dir_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; - - // No zip64 support yet - if ((local_header_ofs > 0xFFFFFFFF) || (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size + comment_size) > 0xFFFFFFFF)) - return MZ_FALSE; - - if (!mz_zip_writer_create_central_dir_header(pZip, central_dir_header, filename_size, extra_size, comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_header_ofs, ext_attributes)) - return MZ_FALSE; - - if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) || - (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) || - (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) || - (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) || - (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, ¢ral_dir_ofs, 1))) - { - // Try to push the central directory array back into its original state. - mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); - return MZ_FALSE; - } - - return MZ_TRUE; -} - -static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name) -{ - // Basic ZIP archive filename validity checks: Valid filenames cannot start with a forward slash, cannot contain a drive letter, and cannot use DOS-style backward slashes. - if (*pArchive_name == '/') - return MZ_FALSE; - while (*pArchive_name) - { - if ((*pArchive_name == '\\') || (*pArchive_name == ':')) - return MZ_FALSE; - pArchive_name++; - } - return MZ_TRUE; -} - -static mz_uint mz_zip_writer_compute_padding_needed_for_file_alignment(mz_zip_archive *pZip) -{ - mz_uint32 n; - if (!pZip->m_file_offset_alignment) - return 0; - n = (mz_uint32)(pZip->m_archive_size & (pZip->m_file_offset_alignment - 1)); - return (pZip->m_file_offset_alignment - n) & (pZip->m_file_offset_alignment - 1); -} - -static mz_bool mz_zip_writer_write_zeros(mz_zip_archive *pZip, mz_uint64 cur_file_ofs, mz_uint32 n) -{ - char buf[4096]; - memset(buf, 0, MZ_MIN(sizeof(buf), n)); - while (n) - { - mz_uint32 s = MZ_MIN(sizeof(buf), n); - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s) - return MZ_FALSE; - cur_file_ofs += s; n -= s; - } - return MZ_TRUE; -} - -mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32) -{ - mz_uint16 method = 0, dos_time = 0, dos_date = 0; - mz_uint level, ext_attributes = 0, num_alignment_padding_bytes; - mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0; - size_t archive_name_size; - mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; - tdefl_compressor *pComp = NULL; - mz_bool store_data_uncompressed; - mz_zip_internal_state *pState; - - if ((int)level_and_flags < 0) - level_and_flags = MZ_DEFAULT_LEVEL; - level = level_and_flags & 0xF; - store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)); - - if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (pZip->m_total_files == 0xFFFF) || (level > MZ_UBER_COMPRESSION)) - return MZ_FALSE; - - pState = pZip->m_pState; - - if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size)) - return MZ_FALSE; - // No zip64 support yet - if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) - return MZ_FALSE; - if (!mz_zip_writer_validate_archive_name(pArchive_name)) - return MZ_FALSE; - -#ifndef MINIZ_NO_TIME - { - time_t cur_time; time(&cur_time); - mz_zip_time_to_dos_time(cur_time, &dos_time, &dos_date); - } -#endif // #ifndef MINIZ_NO_TIME - - archive_name_size = strlen(pArchive_name); - if (archive_name_size > 0xFFFF) - return MZ_FALSE; - - num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); - - // no zip64 support yet - if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + comment_size + archive_name_size) > 0xFFFFFFFF)) - return MZ_FALSE; - - if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/')) - { - // Set DOS Subdirectory attribute bit. - ext_attributes |= 0x10; - // Subdirectories cannot contain data. - if ((buf_size) || (uncomp_size)) - return MZ_FALSE; - } - - // Try to do any allocations before writing to the archive, so if an allocation fails the file remains unmodified. (A good idea if we're doing an in-place modification.) - if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size)) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1))) - return MZ_FALSE; - - if ((!store_data_uncompressed) && (buf_size)) - { - if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)))) - return MZ_FALSE; - } - - if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes + sizeof(local_dir_header))) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - return MZ_FALSE; - } - local_dir_header_ofs += num_alignment_padding_bytes; - if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } - cur_archive_file_ofs += num_alignment_padding_bytes + sizeof(local_dir_header); - - MZ_CLEAR_OBJ(local_dir_header); - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - return MZ_FALSE; - } - cur_archive_file_ofs += archive_name_size; - - if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) - { - uncomp_crc32 = (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8*)pBuf, buf_size); - uncomp_size = buf_size; - if (uncomp_size <= 3) - { - level = 0; - store_data_uncompressed = MZ_TRUE; - } - } - - if (store_data_uncompressed) - { - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - return MZ_FALSE; - } - - cur_archive_file_ofs += buf_size; - comp_size = buf_size; - - if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) - method = MZ_DEFLATED; - } - else if (buf_size) - { - mz_zip_writer_add_state state; - - state.m_pZip = pZip; - state.m_cur_archive_file_ofs = cur_archive_file_ofs; - state.m_comp_size = 0; - - if ((tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) || - (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) != TDEFL_STATUS_DONE)) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - return MZ_FALSE; - } - - comp_size = state.m_comp_size; - cur_archive_file_ofs = state.m_cur_archive_file_ofs; - - method = MZ_DEFLATED; - } - - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - pComp = NULL; - - // no zip64 support yet - if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF)) - return MZ_FALSE; - - if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date)) - return MZ_FALSE; - - if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) - return MZ_FALSE; - - if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment, comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date, local_dir_header_ofs, ext_attributes)) - return MZ_FALSE; - - pZip->m_total_files++; - pZip->m_archive_size = cur_archive_file_ofs; - - return MZ_TRUE; -} - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) -{ - mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes; - mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0; - mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = 0, comp_size = 0; - size_t archive_name_size; - mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; - MZ_FILE *pSrc_file = NULL; - - if ((int)level_and_flags < 0) - level_and_flags = MZ_DEFAULT_LEVEL; - level = level_and_flags & 0xF; - - if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) - return MZ_FALSE; - if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) - return MZ_FALSE; - if (!mz_zip_writer_validate_archive_name(pArchive_name)) - return MZ_FALSE; - - archive_name_size = strlen(pArchive_name); - if (archive_name_size > 0xFFFF) - return MZ_FALSE; - - num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); - - // no zip64 support yet - if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + comment_size + archive_name_size) > 0xFFFFFFFF)) - return MZ_FALSE; - - if (!mz_zip_get_file_modified_time(pSrc_filename, &dos_time, &dos_date)) - return MZ_FALSE; - - pSrc_file = MZ_FOPEN(pSrc_filename, "rb"); - if (!pSrc_file) - return MZ_FALSE; - MZ_FSEEK64(pSrc_file, 0, SEEK_END); - uncomp_size = MZ_FTELL64(pSrc_file); - MZ_FSEEK64(pSrc_file, 0, SEEK_SET); - - if (uncomp_size > 0xFFFFFFFF) - { - // No zip64 support yet - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - if (uncomp_size <= 3) - level = 0; - - if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes + sizeof(local_dir_header))) - return MZ_FALSE; - local_dir_header_ofs += num_alignment_padding_bytes; - if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } - cur_archive_file_ofs += num_alignment_padding_bytes + sizeof(local_dir_header); - - MZ_CLEAR_OBJ(local_dir_header); - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) - { - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - cur_archive_file_ofs += archive_name_size; - - if (uncomp_size) - { - mz_uint64 uncomp_remaining = uncomp_size; - void *pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE); - if (!pRead_buf) - { - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - - if (!level) - { - while (uncomp_remaining) - { - mz_uint n = (mz_uint)MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, uncomp_remaining); - if ((MZ_FREAD(pRead_buf, 1, n, pSrc_file) != n) || (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n)) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n); - uncomp_remaining -= n; - cur_archive_file_ofs += n; - } - comp_size = uncomp_size; - } - else - { - mz_bool result = MZ_FALSE; - mz_zip_writer_add_state state; - tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)); - if (!pComp) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - - state.m_pZip = pZip; - state.m_cur_archive_file_ofs = cur_archive_file_ofs; - state.m_comp_size = 0; - - if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - - for ( ; ; ) - { - size_t in_buf_size = (mz_uint32)MZ_MIN(uncomp_remaining, MZ_ZIP_MAX_IO_BUF_SIZE); - tdefl_status status; - - if (MZ_FREAD(pRead_buf, 1, in_buf_size, pSrc_file) != in_buf_size) - break; - - uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, in_buf_size); - uncomp_remaining -= in_buf_size; - - status = tdefl_compress_buffer(pComp, pRead_buf, in_buf_size, uncomp_remaining ? TDEFL_NO_FLUSH : TDEFL_FINISH); - if (status == TDEFL_STATUS_DONE) - { - result = MZ_TRUE; - break; - } - else if (status != TDEFL_STATUS_OKAY) - break; - } - - pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); - - if (!result) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - MZ_FCLOSE(pSrc_file); - return MZ_FALSE; - } - - comp_size = state.m_comp_size; - cur_archive_file_ofs = state.m_cur_archive_file_ofs; - - method = MZ_DEFLATED; - } - - pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); - } - - MZ_FCLOSE(pSrc_file); pSrc_file = NULL; - - // no zip64 support yet - if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF)) - return MZ_FALSE; - - if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date)) - return MZ_FALSE; - - if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) - return MZ_FALSE; - - if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment, comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date, local_dir_header_ofs, ext_attributes)) - return MZ_FALSE; - - pZip->m_total_files++; - pZip->m_archive_size = cur_archive_file_ofs; - - return MZ_TRUE; -} -#endif // #ifndef MINIZ_NO_STDIO - -mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint file_index) -{ - mz_uint n, bit_flags, num_alignment_padding_bytes; - mz_uint64 comp_bytes_remaining, local_dir_header_ofs; - mz_uint64 cur_src_file_ofs, cur_dst_file_ofs; - mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; - mz_uint8 central_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; - size_t orig_central_dir_size; - mz_zip_internal_state *pState; - void *pBuf; const mz_uint8 *pSrc_central_header; - - if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING)) - return MZ_FALSE; - if (NULL == (pSrc_central_header = mz_zip_reader_get_cdh(pSource_zip, file_index))) - return MZ_FALSE; - pState = pZip->m_pState; - - num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); - - // no zip64 support yet - if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) - return MZ_FALSE; - - cur_src_file_ofs = MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS); - cur_dst_file_ofs = pZip->m_archive_size; - - if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) - return MZ_FALSE; - if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) - return MZ_FALSE; - cur_src_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; - - if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes)) - return MZ_FALSE; - cur_dst_file_ofs += num_alignment_padding_bytes; - local_dir_header_ofs = cur_dst_file_ofs; - if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } - - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) - return MZ_FALSE; - cur_dst_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; - - n = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); - comp_bytes_remaining = n + MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); - - if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(sizeof(mz_uint32) * 4, MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, comp_bytes_remaining))))) - return MZ_FALSE; - - while (comp_bytes_remaining) - { - n = (mz_uint)MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, comp_bytes_remaining); - if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - return MZ_FALSE; - } - cur_src_file_ofs += n; - - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - return MZ_FALSE; - } - cur_dst_file_ofs += n; - - comp_bytes_remaining -= n; - } - - bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS); - if (bit_flags & 8) - { - // Copy data descriptor - if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - return MZ_FALSE; - } - - n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == 0x08074b50) ? 4 : 3); - if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - return MZ_FALSE; - } - - cur_src_file_ofs += n; - cur_dst_file_ofs += n; - } - pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); - - // no zip64 support yet - if (cur_dst_file_ofs > 0xFFFFFFFF) - return MZ_FALSE; - - orig_central_dir_size = pState->m_central_dir.m_size; - - memcpy(central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); - MZ_WRITE_LE32(central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_dir_header_ofs); - if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) - return MZ_FALSE; - - n = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_COMMENT_LEN_OFS); - if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n)) - { - mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); - return MZ_FALSE; - } - - if (pState->m_central_dir.m_size > 0xFFFFFFFF) - return MZ_FALSE; - n = (mz_uint32)pState->m_central_dir.m_size; - if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1)) - { - mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); - return MZ_FALSE; - } - - pZip->m_total_files++; - pZip->m_archive_size = cur_dst_file_ofs; - - return MZ_TRUE; -} - -mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip) -{ - mz_zip_internal_state *pState; - mz_uint64 central_dir_ofs, central_dir_size; - mz_uint8 hdr[MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE]; - - if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING)) - return MZ_FALSE; - - pState = pZip->m_pState; - - // no zip64 support yet - if ((pZip->m_total_files > 0xFFFF) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) - return MZ_FALSE; - - central_dir_ofs = 0; - central_dir_size = 0; - if (pZip->m_total_files) - { - // Write central directory - central_dir_ofs = pZip->m_archive_size; - central_dir_size = pState->m_central_dir.m_size; - pZip->m_central_directory_file_ofs = central_dir_ofs; - if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs, pState->m_central_dir.m_p, (size_t)central_dir_size) != central_dir_size) - return MZ_FALSE; - pZip->m_archive_size += central_dir_size; - } - - // Write end of central directory record - MZ_CLEAR_OBJ(hdr); - MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_SIG_OFS, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG); - MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, pZip->m_total_files); - MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, pZip->m_total_files); - MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, central_dir_size); - MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, central_dir_ofs); - - if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, sizeof(hdr)) != sizeof(hdr)) - return MZ_FALSE; -#ifndef MINIZ_NO_STDIO - if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF)) - return MZ_FALSE; -#endif // #ifndef MINIZ_NO_STDIO - - pZip->m_archive_size += sizeof(hdr); - - pZip->m_zip_mode = MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED; - return MZ_TRUE; -} - -mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf, size_t *pSize) -{ - if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pSize)) - return MZ_FALSE; - if (pZip->m_pWrite != mz_zip_heap_write_func) - return MZ_FALSE; - if (!mz_zip_writer_finalize_archive(pZip)) - return MZ_FALSE; - - *pBuf = pZip->m_pState->m_pMem; - *pSize = pZip->m_pState->m_mem_size; - pZip->m_pState->m_pMem = NULL; - pZip->m_pState->m_mem_size = pZip->m_pState->m_mem_capacity = 0; - return MZ_TRUE; -} - -mz_bool mz_zip_writer_end(mz_zip_archive *pZip) -{ - mz_zip_internal_state *pState; - mz_bool status = MZ_TRUE; - if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))) - return MZ_FALSE; - - pState = pZip->m_pState; - pZip->m_pState = NULL; - mz_zip_array_clear(pZip, &pState->m_central_dir); - mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); - mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); - -#ifndef MINIZ_NO_STDIO - if (pState->m_pFile) - { - MZ_FCLOSE(pState->m_pFile); - pState->m_pFile = NULL; - } -#endif // #ifndef MINIZ_NO_STDIO - - if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem)) - { - pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem); - pState->m_pMem = NULL; - } - - pZip->m_pFree(pZip->m_pAlloc_opaque, pState); - pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; - return status; -} - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) -{ - mz_bool status, created_new_archive = MZ_FALSE; - mz_zip_archive zip_archive; - struct MZ_FILE_STAT_STRUCT file_stat; - MZ_CLEAR_OBJ(zip_archive); - if ((int)level_and_flags < 0) - level_and_flags = MZ_DEFAULT_LEVEL; - if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION)) - return MZ_FALSE; - if (!mz_zip_writer_validate_archive_name(pArchive_name)) - return MZ_FALSE; - if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0) - { - // Create a new archive. - if (!mz_zip_writer_init_file(&zip_archive, pZip_filename, 0)) - return MZ_FALSE; - created_new_archive = MZ_TRUE; - } - else - { - // Append to an existing archive. - if (!mz_zip_reader_init_file(&zip_archive, pZip_filename, level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY)) - return MZ_FALSE; - if (!mz_zip_writer_init_from_reader(&zip_archive, pZip_filename)) - { - mz_zip_reader_end(&zip_archive); - return MZ_FALSE; - } - } - status = mz_zip_writer_add_mem_ex(&zip_archive, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, 0, 0); - // Always finalize, even if adding failed for some reason, so we have a valid central directory. (This may not always succeed, but we can try.) - if (!mz_zip_writer_finalize_archive(&zip_archive)) - status = MZ_FALSE; - if (!mz_zip_writer_end(&zip_archive)) - status = MZ_FALSE; - if ((!status) && (created_new_archive)) - { - // It's a new archive and something went wrong, so just delete it. - int ignoredStatus = MZ_DELETE_FILE(pZip_filename); - (void)ignoredStatus; - } - return status; -} - -void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags) -{ - int file_index; - mz_zip_archive zip_archive; - void *p = NULL; - - if (pSize) - *pSize = 0; - - if ((!pZip_filename) || (!pArchive_name)) - return NULL; - - MZ_CLEAR_OBJ(zip_archive); - if (!mz_zip_reader_init_file(&zip_archive, pZip_filename, flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY)) - return NULL; - - if ((file_index = mz_zip_reader_locate_file(&zip_archive, pArchive_name, NULL, flags)) >= 0) - p = mz_zip_reader_extract_to_heap(&zip_archive, file_index, pSize, flags); - - mz_zip_reader_end(&zip_archive); - return p; -} - -#endif // #ifndef MINIZ_NO_STDIO - -#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -#endif // #ifndef MINIZ_NO_ARCHIVE_APIS - -#ifdef __cplusplus -} -#endif - -#endif // MINIZ_HEADER_FILE_ONLY - -/* - This is free and unencumbered software released into the public domain. - - Anyone is free to copy, modify, publish, use, compile, sell, or - distribute this software, either in source code form or as a compiled - binary, for any purpose, commercial or non-commercial, and by any - means. - - In jurisdictions that recognize copyright laws, the author or authors - of this software dedicate any and all copyright interest in the - software to the public domain. We make this dedication for the benefit - of the public at large and to the detriment of our heirs and - successors. We intend this dedication to be an overt act of - relinquishment in perpetuity of all present and future rights to this - software under copyright law. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - For more information, please refer to -*/ diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 01741c2b..543906eb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -26,7 +26,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/Block.h" -#include "PolyVoxCore/BlockCompressor.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" #include "PolyVoxCore/Vector.h" diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index f3914a64..5e3ab738 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -23,8 +23,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/ErrorHandling.h" -#include "PolyVoxCore/MinizBlockCompressor.h" // For creating a default compressor when none is provided. - #include namespace PolyVox diff --git a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h deleted file mode 100644 index f701101c..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.h +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_MinizBlockCompressor_H__ -#define __PolyVox_MinizBlockCompressor_H__ - -#include "PolyVoxCore/BlockCompressor.h" - -#include "PolyVoxCore/Impl/MinizWrapper.h" - -namespace PolyVox -{ - /** - * Provides an interface for performing paging of data. - */ - template - class MinizBlockCompressor : public BlockCompressor - { - public: - MinizBlockCompressor(int iCompressionLevel = 6); // Miniz defines MZ_DEFAULT_LEVEL = 6 so we use the same here - ~MinizBlockCompressor(); - - void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); - void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock); - - public: - uint32_t getExpectedCompressedSize(uint32_t uUncompressedInputSize); - uint32_t getMaxCompressedSize(uint32_t uUncompressedInputSize); - uint32_t compressWithMiniz(const void* pSrcData, size_t uSrcLength, void* pDstData, size_t uDstLength); - uint32_t decompressWithMiniz(const void* pSrcData, size_t uSrcLength, void* pDstData, size_t uDstLength); - - unsigned int m_uCompressionFlags; - - // Data gets compressed into this, then we check how big the result - // is and copy the required number of bytes to the destination block. - std::vector m_vecTempBuffer; - - // tdefl_compressor contains all the state needed by the low-level compressor so it's a pretty big struct (~300k). - tdefl_compressor* m_pDeflator; - }; -} - -#include "PolyVoxCore/MinizBlockCompressor.inl" - -#endif //__PolyVox_MinizBlockCompressor_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl b/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl deleted file mode 100644 index a4e41e72..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/MinizBlockCompressor.inl +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include - -namespace PolyVox -{ - /** - * You can specify a compression level when constructing this compressor. This controls the tradeoff between speed and compression - * rate. Levels 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow). - * \param iCompressionLevel The desired compression level. - */ - template - MinizBlockCompressor::MinizBlockCompressor(int iCompressionLevel) - :m_pDeflator(0) - { - // Create and store the deflator. - m_pDeflator = new tdefl_compressor; - - // The number of dictionary probes to use at each compression level (0-10). 0=implies fastest/minimal possible probing. - // The discontinuity is unsettling but may be explained by the 'iCompressionLevel <= 3' check later? - static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 }; - - // Create tdefl() compatible flags (we have to compose the low-level flags ourselves, or use tdefl_create_comp_flags_from_zip_params() but that means MINIZ_NO_ZLIB_APIS can't be defined). - m_uCompressionFlags = TDEFL_WRITE_ZLIB_HEADER | s_tdefl_num_probes[(std::min)(10, iCompressionLevel)] | ((iCompressionLevel <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0); - if (!iCompressionLevel) - { - m_uCompressionFlags |= TDEFL_FORCE_ALL_RAW_BLOCKS; - } - } - - template - MinizBlockCompressor::~MinizBlockCompressor() - { - // Delete the deflator - delete m_pDeflator; - } - - template - void MinizBlockCompressor::compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) - { - // The uncompressed data will be read straight out of the block - void* pSrcData = reinterpret_cast(pSrcBlock->getData()); - size_t uSrcLength = pSrcBlock->getDataSizeInBytes(); - - // This compressor is expected to be used many times to compress a large number of blocks, but they are all - // expected to have the same size. Therefore the resize() function below should only perform allocation once. - uint32_t expectedCompressedSize = getExpectedCompressedSize(uSrcLength); - if(m_vecTempBuffer.size() != expectedCompressedSize) - { - POLYVOX_LOG_INFO("Resizing temp buffer to " << expectedCompressedSize << "bytes. " - << "This should only happen the first time the MinizBlockCompressor is used"); - m_vecTempBuffer.resize(expectedCompressedSize); - } - - // The compressed data will be written into this temporary buffer. - uint8_t* pDstData = &(m_vecTempBuffer[0]); - size_t uDstLength = m_vecTempBuffer.size(); - - try - { - // Perform the compression - uint32_t uCompressedLength = compressWithMiniz(pSrcData, uSrcLength, pDstData, uDstLength); - - // Copy the resulting compressed data into the compressed block - pDstBlock->setData(pDstData, uCompressedLength); - } - catch(std::exception&) - { - // It is possible for the compression to fail. A common cause for this would be if the destination - // buffer is not big enough. So now we try again using a buffer that is definitely big enough. - // Note that ideally we will choose our earlier buffer size so that this almost never happens. - POLYVOX_LOG_WARNING("The compressor failed to compress the block, probabaly due to the buffer being too small."); - POLYVOX_LOG_WARNING("The compression will be tried again with a larger buffer."); - - std::vector vecExtraBigBuffer; - vecExtraBigBuffer.resize(getMaxCompressedSize(uSrcLength)); - - uint8_t* pDstData = &(vecExtraBigBuffer[0]); - size_t uDstLength = vecExtraBigBuffer.size(); - - try - { - // Perform the compression - uint32_t uCompressedLength = compressWithMiniz(pSrcData, uSrcLength, pDstData, uDstLength); - - // Copy the resulting compressed data into the compressed block - pDstBlock->setData(pDstData, uCompressedLength); - } - catch(std::exception&) - { - // At this point it didn't work even with a bigger buffer. - // Not much more we can do so just rethrow the exception. - POLYVOX_THROW(std::runtime_error, "Failed to compress block data"); - } - } - } - - template - void MinizBlockCompressor::decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock) - { - // Get raw pointers so that the data can be decompressed directly into the destination block. - const void* pSrcData = reinterpret_cast(pSrcBlock->getData()); - void* pDstData = reinterpret_cast(pDstBlock->getData()); - size_t uSrcLength = pSrcBlock->getDataSizeInBytes(); - size_t uDstLength = pDstBlock->getDataSizeInBytes(); - - // Perform the decompression - uint32_t uUncompressedLength = decompressWithMiniz(pSrcData, uSrcLength, pDstData, uDstLength); - - // We know we should have received exactly one block's worth of data. If not then something went wrong. - POLYVOX_THROW_IF(uUncompressedLength != pDstBlock->getDataSizeInBytes(), std::runtime_error, "Decompressed data does not have the expected length"); - } - - template - uint32_t MinizBlockCompressor::getExpectedCompressedSize(uint32_t uUncompressedInputSize) - { - // We expect this block compressor will be used for smoothly changing volume data such as density fields and so - // the compression rate might not be great. The value beloew is basically a guess based on previous experience. - uint32_t uExpectedCompressionRate = 4; - return uUncompressedInputSize / uExpectedCompressionRate; - } - - template - uint32_t MinizBlockCompressor::getMaxCompressedSize(uint32_t uUncompressedInputSize) - { - // The contents of this function are copied from miniz's 'mz_deflateBound()' - // (which we can't use because it is part of the zlib-style higher level API). - unsigned long source_len = uUncompressedInputSize; - - // This is really over conservative. (And lame, but it's actually pretty tricky to compute a true upper bound given the way tdefl's blocking works.) - return (std::max)(128 + (source_len * 110) / 100, 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5); - } - - template - uint32_t MinizBlockCompressor::compressWithMiniz(const void* pSrcData, size_t uSrcLength, void* pDstData, size_t uDstLength) - { - // It seems we have to reinitialise the deflator for each fresh dataset (it's probably intended for streaming, which we're not doing here) - tdefl_status status = tdefl_init(m_pDeflator, NULL, NULL, m_uCompressionFlags); - if (status != TDEFL_STATUS_OKAY) - { - std::stringstream ss; - ss << "tdefl_init() failed with return code '" << status << "'"; - POLYVOX_THROW(std::runtime_error, ss.str()); - } - - // Compress as much of the input as possible (or all of it) to the output buffer. - status = tdefl_compress(m_pDeflator, pSrcData, &uSrcLength, pDstData, &uDstLength, TDEFL_FINISH); - - //Check whether the compression was successful. - if (status != TDEFL_STATUS_DONE) - { - std::stringstream ss; - ss << "tdefl_compress() failed with return code '" << status << "'"; - POLYVOX_THROW(std::runtime_error, ss.str()); - } - - // The compression modifies 'ulDstLength' to hold the new length. - return uDstLength; - } - - template - uint32_t MinizBlockCompressor::decompressWithMiniz(const void* pSrcData, size_t uSrcLength, void* pDstData, size_t uDstLength) - { - // I don't know exactly why this limitation exists but it's an implementation detail of miniz. It shouldn't matter for our purposes - // as our destination is a Block and those are always a power of two. If you need to use this code for other purposes then you'll - // probably have to scale up your dst buffer to the nearest appropriate size. Alternatively you can use the mz_uncompress function, - // but that means enabling parts of the miniz API which are #defined out at the top of this file. - POLYVOX_THROW_IF(isPowerOf2(uDstLength) == false, std::invalid_argument, "Miniz decompressor requires the destination buffer to have a size which is a power of two."); - - // Create and initialise the decompressor (I believe this is much small than the compressor). - tinfl_decompressor inflator; - tinfl_init(&inflator); - - // Do the decompression. In some scenarios 'tinfl_decompress' would be called multiple times with the same dest buffer but - // different locations within it. In our scenario it's only called once so the start and the location are the same (both pDstData). - tinfl_status status = tinfl_decompress(&inflator, (const mz_uint8 *)pSrcData, &uSrcLength, (mz_uint8 *)pDstData, (mz_uint8 *)pDstData, &uDstLength, TINFL_FLAG_PARSE_ZLIB_HEADER); - - //Check whether the decompression was successful. - if (status != TINFL_STATUS_DONE) - { - std::stringstream ss; - ss << "tinfl_decompress() failed with return code '" << status << "'"; - POLYVOX_THROW(std::runtime_error, ss.str()); - } - - // The decompression modifies 'ulDstLength' to hold the new length. - return uDstLength; - } -} \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h deleted file mode 100644 index cb4fc38d..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_RLEBlockCompressor_H__ -#define __PolyVox_RLEBlockCompressor_H__ - -#include "PolyVoxCore/BlockCompressor.h" - -namespace PolyVox -{ - template - class Run - { - public: - typedef uint16_t LengthType; - VoxelType value; - LengthType length; - }; - - /** - * Provides an interface for performing paging of data. - */ - template - class RLEBlockCompressor : public BlockCompressor - { - - - public: - RLEBlockCompressor(); - ~RLEBlockCompressor(); - - void compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock); - void decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock); - }; -} - -#include "PolyVoxCore/RLEBlockCompressor.inl" - -#endif //__PolyVox_RLEBlockCompressor_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl b/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl deleted file mode 100644 index a8408059..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/RLEBlockCompressor.inl +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include - -namespace PolyVox -{ - template - RLEBlockCompressor::RLEBlockCompressor() - { - } - - template - RLEBlockCompressor::~RLEBlockCompressor() - { - } - - template - void RLEBlockCompressor::compressData(UncompressedBlock* pSrcBlock, CompressedBlock* pDstBlock) - { - void* pSrcData = reinterpret_cast(pSrcBlock->getData()); - uint32_t uSrcLength = pSrcBlock->getDataSizeInBytes(); - - if(uSrcLength % sizeof(VoxelType) != 0) - { - POLYVOX_THROW(std::length_error, "Source length must be a integer multiple of the ValueType size"); - } - - // Lengths provided are in bytes, so convert them to be in terms of our types. - uSrcLength /= sizeof(VoxelType); - //uDstLength /= sizeof(Run); - - // Get data pointers in the appropriate type - const VoxelType* pSrcDataAsType = reinterpret_cast(pSrcData); - //Run* pDstDataAsRun = reinterpret_cast(pDstData); - std::vector< Run > vecDstDataAsRuns; - - // Pointers to just past the end of the data - const VoxelType* pSrcDataEnd = pSrcDataAsType + uSrcLength; - //Run* pDstDataEnd = pDstDataAsRun + uDstLength; - - //Counter for the output length - //uint32_t uDstLengthInBytes = 0; - - // Read the first element of the source and set up the first run based on it. - /*pDstDataAsRun->value = *pSrcDataAsType; - pSrcDataAsType++; - pDstDataAsRun->length = 1; - uDstLengthInBytes += sizeof(Run);*/ - Run firstRun; - firstRun.value = *pSrcDataAsType; - firstRun.length = 1; - vecDstDataAsRuns.push_back(firstRun); - - pSrcDataAsType++; - - //Now process all remaining elements of the source. - while(pSrcDataAsType < pSrcDataEnd) - { - // If the value is the same as the current run (and we have not - // reached the maximum run length) then extend the current run. - typename std::vector< Run< VoxelType> >::iterator currentRun = (vecDstDataAsRuns.end() - 1); - if((*pSrcDataAsType == currentRun->value) && (currentRun->length < (std::numeric_limits::LengthType>::max)())) - { - currentRun->length++; - } - // Otherwise we need to start a new Run. - else - { - /*pDstDataAsRun++; - - // Check if we have enough space in the destination buffer. - if(pDstDataAsRun >= pDstDataEnd) - { - POLYVOX_THROW(std::runtime_error, "Insufficient space in destination buffer."); - }*/ - - // Create the new run. - /*pDstDataAsRun->value = *pSrcDataAsType; - pDstDataAsRun->length = 1; - uDstLengthInBytes += sizeof(Run);*/ - - Run newRun; - newRun.value = *pSrcDataAsType; - newRun.length = 1; - vecDstDataAsRuns.push_back(newRun); - } - - pSrcDataAsType++; - } - - //Now copy the data into the compressed block. - - pDstBlock->setData(reinterpret_cast(&(vecDstDataAsRuns[0])), vecDstDataAsRuns.size() * sizeof(Run)); - } - - template - void RLEBlockCompressor::decompress(CompressedBlock* pSrcBlock, UncompressedBlock* pDstBlock) - { - const void* pSrcData = reinterpret_cast(pSrcBlock->getData()); - uint32_t uSrcLength = pSrcBlock->getDataSizeInBytes(); - - void* pDstData = pDstBlock->getData(); - uint32_t uDstLength = pDstBlock->getDataSizeInBytes(); - - if(uSrcLength % sizeof(Run) != 0) - { - POLYVOX_THROW(std::length_error, "Source length must be a integer multiple of the Run size"); - } - - // Lengths provided are in bytes, so convert them to be in terms of our types. - uSrcLength /= sizeof(Run); - uDstLength /= sizeof(VoxelType); - - // Get data pointers in the appropriate type - const Run* pSrcDataAsRun = reinterpret_cast*>(pSrcData); - VoxelType* pDstDataAsType = reinterpret_cast(pDstData); - - // Pointers to just past the end of the data - const Run* pSrcDataEnd = pSrcDataAsRun + uSrcLength; - VoxelType* pDstDataEnd = pDstDataAsType + uDstLength; - - //Counter for the output length - uint32_t uDstLengthInBytes = 0; - - while(pSrcDataAsRun < pSrcDataEnd) - { - // Check if we have enough space in the destination buffer. - if(pDstDataAsType + pSrcDataAsRun->length > pDstDataEnd) - { - POLYVOX_THROW(std::runtime_error, "Insufficient space in destination buffer."); - } - else - { - - // Write the run into the destination - std::fill(pDstDataAsType, pDstDataAsType + pSrcDataAsRun->length, pSrcDataAsRun->value); - pDstDataAsType += pSrcDataAsRun->length; - - uDstLengthInBytes += pSrcDataAsRun->length * sizeof(VoxelType); - } - pSrcDataAsRun++; - } - - POLYVOX_ASSERT(uDstLengthInBytes == pDstBlock->getDataSizeInBytes(), "Uncompressed data does not have the correct length."); - } -} \ No newline at end of file diff --git a/library/PolyVoxCore/source/Impl/MinizWrapper.cpp b/library/PolyVoxCore/source/Impl/MinizWrapper.cpp deleted file mode 100644 index 6dc6656f..00000000 --- a/library/PolyVoxCore/source/Impl/MinizWrapper.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -// Please see this header file for comment about the purpose of MinizWrapper.h/cpp -#include "PolyVoxCore/Impl/MinizWrapper.h" - -// Get the full definitions, not just the declarations. -#undef MINIZ_HEADER_FILE_ONLY -#include "PolyVoxCore/Impl/miniz.c" \ No newline at end of file diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 71e74d70..fc7f92ba 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -25,7 +25,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Density.h" #include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MinizBlockCompressor.h" #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" @@ -102,8 +101,7 @@ template VolumeType* createAndFillVolume(void) { const int32_t uVolumeSideLength = 64; - - MinizBlockCompressor* compressor = new MinizBlockCompressor(); + FilePager* pager = new FilePager("./"); //Create empty volume @@ -140,8 +138,7 @@ float randomFloat(float a, float b) template VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) -{ - MinizBlockCompressor* compressor = new MinizBlockCompressor(); +{ FilePager* pager = new FilePager("./"); //Create empty volume diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index c3090f2c..3d737c0d 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -25,7 +25,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/FilePager.h" #include "PolyVoxCore/LargeVolume.h" -#include "PolyVoxCore/MinizBlockCompressor.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/SimpleVolume.h" @@ -271,8 +270,6 @@ TestVolume::TestVolume() { Region region(-57, -31, 12, 64, 96, 131); // Deliberatly awkward size - //m_pCompressor = new RLECompressor; - m_pBlockCompressor = new MinizBlockCompressor; m_pFilePager = new FilePager("./"); //Create the volumes From 5ff54c041fcf754bf563df21f0e58819648fe53c Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 13 Sep 2014 23:14:07 +0200 Subject: [PATCH 196/259] Renamed variable. --- .../include/PolyVoxCore/LargeVolume.h | 4 +- .../include/PolyVoxCore/LargeVolume.inl | 41 ++++++------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 543906eb..f4a0d67e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -302,8 +302,6 @@ namespace PolyVox typedef std::map*, BlockPositionCompare> UncompressedBlockMap; - uint32_t calculateBlockMemoryUsage(void) const; - void ensureUncompressedBlockMapHasFreeSpace(void) const; void initialise(); @@ -321,7 +319,7 @@ namespace PolyVox void eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const; // The block data - mutable UncompressedBlockMap m_pUncompressedBlockCache; + mutable UncompressedBlockMap m_pBlocks; mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 5e3ab738..a7bd07a7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -391,9 +391,9 @@ namespace PolyVox //Replaced the for loop here as the call to //eraseBlock was invalidating the iterator. - while(m_pUncompressedBlockCache.size() > 0) + while(m_pBlocks.size() > 0) { - eraseBlock(m_pUncompressedBlockCache.begin()); + eraseBlock(m_pBlocks.begin()); } } @@ -422,8 +422,8 @@ namespace PolyVox for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { Vector3DInt32 pos(x,y,z); - typename UncompressedBlockMap::iterator itBlock = m_pUncompressedBlockCache.find(pos); - if (itBlock == m_pUncompressedBlockCache.end()) + typename UncompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); + if (itBlock == m_pBlocks.end()) { // not loaded, not unloading continue; @@ -475,7 +475,7 @@ namespace PolyVox //setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks); //Clear the previous data - m_pUncompressedBlockCache.clear(); + m_pBlocks.clear(); //Other properties we might find useful later this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); @@ -514,7 +514,7 @@ namespace PolyVox delete itUncompressedBlock->second; // We can now remove the block data from memory. - m_pUncompressedBlockCache.erase(itUncompressedBlock); + m_pBlocks.erase(itUncompressedBlock); } template @@ -533,9 +533,9 @@ namespace PolyVox UncompressedBlock* pUncompressedBlock = 0; - typename UncompressedBlockMap::iterator itUncompressedBlock = m_pUncompressedBlockCache.find(v3dBlockPos); + typename UncompressedBlockMap::iterator itUncompressedBlock = m_pBlocks.find(v3dBlockPos); // check whether the block is already loaded - if(itUncompressedBlock != m_pUncompressedBlockCache.end()) + if(itUncompressedBlock != m_pBlocks.end()) { pUncompressedBlock = itUncompressedBlock->second; } @@ -565,7 +565,7 @@ namespace PolyVox m_pPager->pageIn(reg, pUncompressedBlock); // Add our new block to the map. - m_pUncompressedBlockCache.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; @@ -585,7 +585,7 @@ namespace PolyVox //Memory used by the blocks typename UncompressedBlockMap::iterator i; - for (i = m_pUncompressedBlockCache.begin(); i != m_pUncompressedBlockCache.end(); i++) + for (i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) { //Inaccurate - account for rest of loaded block. uSizeInBytes += i->second->calculateSizeInBytes(); @@ -598,31 +598,16 @@ namespace PolyVox return uSizeInBytes; } - template - uint32_t LargeVolume::calculateBlockMemoryUsage(void) const - { - uint32_t uMemoryUsage = 0; - - typename CompressedBlockMap::iterator i; - for(i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) - { - //Inaccurate - account for rest of loaded block. - uMemoryUsage += i->second->calculateSizeInBytes(); - } - - return uMemoryUsage; - } - template void LargeVolume::ensureUncompressedBlockMapHasFreeSpace(void) const { - while(m_pUncompressedBlockCache.size() > m_uMaxNumberOfUncompressedBlocks) + while(m_pBlocks.size() > m_uMaxNumberOfUncompressedBlocks) { // Find the least recently used block. The uncompressed block cache should be // much smaller than the total number of blocks, so hopefully this isn't too slow. typename UncompressedBlockMap::iterator i; - typename UncompressedBlockMap::iterator itUnloadBlock = m_pUncompressedBlockCache.begin(); - for(i = m_pUncompressedBlockCache.begin(); i != m_pUncompressedBlockCache.end(); i++) + typename UncompressedBlockMap::iterator itUnloadBlock = m_pBlocks.begin(); + for(i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) { if(i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) { From 3cf8f38793bfc972bcd7dd14fb03e7e0a68c1882 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 13 Sep 2014 23:38:11 +0200 Subject: [PATCH 197/259] Merged Block and UncompressedBlock classes. --- library/PolyVoxCore/CMakeLists.txt | 1 - .../PolyVoxCore/include/PolyVoxCore/Block.h | 66 ------------------- .../include/PolyVoxCore/FilePager.h | 1 + .../include/PolyVoxCore/LargeVolume.h | 2 +- .../include/PolyVoxCore/UncompressedBlock.h | 12 +++- .../include/PolyVoxCore/UncompressedBlock.inl | 4 +- 6 files changed, 15 insertions(+), 71 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Block.h diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index c8b13071..486cdf97 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -38,7 +38,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/BaseVolume.h include/PolyVoxCore/BaseVolume.inl include/PolyVoxCore/BaseVolumeSampler.inl - include/PolyVoxCore/Block.h include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl include/PolyVoxCore/DefaultIsQuadNeeded.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Block.h b/library/PolyVoxCore/include/PolyVoxCore/Block.h deleted file mode 100644 index e2bb16cb..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Block.h +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Block_H__ -#define __PolyVox_Block_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/Vector.h" - -#include -#include - -namespace PolyVox -{ - template - class Block - { - friend class LargeVolume; - - public: - Block() - :m_uBlockLastAccessed(0) - ,m_bDataModified(true) - { - } - - protected: - // This is updated by the LargeVolume and used to discard the least recently used blocks. - uint32_t m_uBlockLastAccessed; - - // This is so we can tell whether a uncompressed block has to be recompressed and whether - // a compressed block has to be paged back to disk, or whether they can just be discarded. - bool m_bDataModified; - - private: - /// Private copy constructor to prevent accisdental copying - Block(const Block& /*rhs*/) {}; - - /// Private assignment operator to prevent accisdental copying - Block& operator=(const Block& /*rhs*/) {}; - }; -} - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 5e0a6081..8e3e36ed 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -34,6 +34,7 @@ freely, subject to the following restrictions: #include #include #include +#include namespace PolyVox { diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index f4a0d67e..57e90120 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -25,9 +25,9 @@ freely, subject to the following restrictions: #define __PolyVox_LargeVolume_H__ #include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Block.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" +#include "PolyVoxCore/UncompressedBlock.h" #include "PolyVoxCore/Vector.h" #include diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h index 54a1aacb..a0ed3c75 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h @@ -24,12 +24,13 @@ freely, subject to the following restrictions: #ifndef __PolyVox_UncompressedBlock_H__ #define __PolyVox_UncompressedBlock_H__ -#include "PolyVoxCore/Block.h" +#include "PolyVoxCore/PolyVoxForwardDeclarations.h" +#include "PolyVoxCore/Vector.h" namespace PolyVox { template - class UncompressedBlock : public Block + class UncompressedBlock { friend class LargeVolume; @@ -53,6 +54,13 @@ namespace PolyVox /// Private assignment operator to prevent accisdental copying UncompressedBlock& operator=(const UncompressedBlock& /*rhs*/) {}; + // This is updated by the LargeVolume and used to discard the least recently used blocks. + uint32_t m_uBlockLastAccessed; + + // This is so we can tell whether a uncompressed block has to be recompressed and whether + // a compressed block has to be paged back to disk, or whether they can just be discarded. + bool m_bDataModified; + // Made this private for consistancy with CompressedBlock. // Users shouldn't really need this for UncompressedBlock anyway. uint32_t calculateSizeInBytes(void); diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 2239b267..d5252d2c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -27,7 +27,9 @@ namespace PolyVox { template UncompressedBlock::UncompressedBlock(uint16_t uSideLength) - :m_tData(0) + :m_uBlockLastAccessed(0) + ,m_bDataModified(true) + ,m_tData(0) ,m_uSideLength(0) ,m_uSideLengthPower(0) { From 47ace554ccfdf870d38d1af75fc01a912e220c7b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 14 Sep 2014 11:47:17 +0200 Subject: [PATCH 198/259] Making use of shared_ptr to track blocks. --- examples/Paging/main.cpp | 4 ++-- .../include/PolyVoxCore/FilePager.h | 4 ++-- .../include/PolyVoxCore/LargeVolume.h | 6 +++--- .../include/PolyVoxCore/LargeVolume.inl | 19 ++++++++++--------- .../PolyVoxCore/LargeVolumeSampler.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 6 ++++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index a01779fb..04d20067 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,7 +90,7 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock > pBlockData) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... @@ -143,7 +143,7 @@ public: //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, UncompressedBlock* /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock > /*pBlockData*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 8e3e36ed..8da3adcf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -69,7 +69,7 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); @@ -113,7 +113,7 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) + virtual void pageOut(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 57e90120..ca4f60d6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -300,7 +300,7 @@ namespace PolyVox } }; - typedef std::map*, BlockPositionCompare> UncompressedBlockMap; + typedef std::map >, BlockPositionCompare> UncompressedBlockMap; void ensureUncompressedBlockMapHasFreeSpace(void) const; @@ -314,7 +314,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - UncompressedBlock* getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; void eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const; @@ -323,7 +323,7 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; - mutable UncompressedBlock* m_pLastAccessedBlock; + mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; uint32_t m_uMaxNumberOfUncompressedBlocks; // The size of the volume diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index a7bd07a7..4cbeb632 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -186,7 +186,7 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - const UncompressedBlock* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); } @@ -262,7 +262,7 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - UncompressedBlock* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); } @@ -299,7 +299,7 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - UncompressedBlock* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); @@ -486,7 +486,7 @@ namespace PolyVox template void LargeVolume::eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const { - UncompressedBlock* pUncompressedBlock = itUncompressedBlock->second; + std::shared_ptr< UncompressedBlock > pUncompressedBlock = itUncompressedBlock->second; // This should never happen as blocks are deleted based on being least recently used. // I the case that we are flushing we delete all blocks, but the flush function will @@ -511,14 +511,14 @@ namespace PolyVox pUncompressedBlock->m_bDataModified = false; } - delete itUncompressedBlock->second; + //delete itUncompressedBlock->second; // We can now remove the block data from memory. m_pBlocks.erase(itUncompressedBlock); } template - UncompressedBlock* LargeVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const + std::shared_ptr< UncompressedBlock > LargeVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const { Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); @@ -531,7 +531,7 @@ namespace PolyVox return m_pLastAccessedBlock; } - UncompressedBlock* pUncompressedBlock = 0; + std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; typename UncompressedBlockMap::iterator itUncompressedBlock = m_pBlocks.find(v3dBlockPos); // check whether the block is already loaded @@ -546,7 +546,8 @@ namespace PolyVox ensureUncompressedBlockMapHasFreeSpace(); // We can now create a new block. - pUncompressedBlock = new UncompressedBlock(m_uBlockSideLength); + //pUncompressedBlock = new UncompressedBlock(m_uBlockSideLength); + pUncompressedBlock = std::make_shared< UncompressedBlock >(m_uBlockSideLength); // An uncompressed bock is always backed by a compressed one, and this is created by getCompressedBlock() if it doesn't // already exist. If it does already exist and has data then we bring this across into the ucompressed version. @@ -677,7 +678,7 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - UncompressedBlock* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl index c5e4e12c..df07bb77 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl @@ -119,7 +119,7 @@ namespace PolyVox uYPosInBlock * this->mVolume->m_uBlockSideLength + uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - UncompressedBlock* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); + auto pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index c11d8afd..0970c943 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -27,6 +27,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/UncompressedBlock.h" #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { /** @@ -41,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) = 0; - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) = 0; + virtual void pageIn(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) = 0; + virtual void pageOut(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) = 0; }; } From 704eeaf94829842b91e5a37ea5c2d56fd7b65250 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 16 Sep 2014 17:02:53 +0200 Subject: [PATCH 199/259] Work on supporting no pager being attached. --- .../include/PolyVoxCore/LargeVolume.h | 7 ---- .../include/PolyVoxCore/LargeVolume.inl | 32 ++++++++++++------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index ca4f60d6..1f080523 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -334,13 +334,6 @@ namespace PolyVox uint8_t m_uBlockSideLengthPower; Pager* m_pPager; - - // Compressed data for an empty block (sometimes needed for initialisation). - //CompressedBlock* m_pCompressedEmptyBlock; - - // Whether we created the compressor or whether it was provided - // by the user. This controls whether we delete it on destruction. - //bool m_bIsOurCompressor; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 4cbeb632..44116cd5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -24,6 +24,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/ErrorHandling.h" #include +#include namespace PolyVox { @@ -46,9 +47,20 @@ namespace PolyVox :BaseVolume(regValid) { m_uBlockSideLength = uBlockSideLength; - m_pPager = pPager; + if (m_pPager) + { + // If a pager is available then we can set a sensible limit on our memory usage. + m_uMaxNumberOfUncompressedBlocks = 256; + } + else + { + // If there is no pager provided then we set the block limit to the maximum + // value to ensure the system never attempts to page blocks out of memory. + m_uMaxNumberOfUncompressedBlocks = (std::numeric_limits::max)(); + } + initialise(); } @@ -215,6 +227,8 @@ namespace PolyVox template void LargeVolume::setMaxNumberOfUncompressedBlocks(uint32_t uMaxNumberOfUncompressedBlocks) { + POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); + //clearBlockCache(); /*if (m_pBlocks.size() > uMaxNumberOfBlocksInMemory) @@ -386,6 +400,8 @@ namespace PolyVox template void LargeVolume::flushAll() { + POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); + // Flushing will remove the most accessed block, so invalidate the pointer. m_pLastAccessedBlock = 0; @@ -403,6 +419,8 @@ namespace PolyVox template void LargeVolume::flush(Region regFlush) { + POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); + Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { @@ -486,6 +504,8 @@ namespace PolyVox template void LargeVolume::eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const { + POLYVOX_ASSERT(m_pPager, "A block should never be erased if there is no pager attached to handle it"); + std::shared_ptr< UncompressedBlock > pUncompressedBlock = itUncompressedBlock->second; // This should never happen as blocks are deleted based on being least recently used. @@ -549,16 +569,6 @@ namespace PolyVox //pUncompressedBlock = new UncompressedBlock(m_uBlockSideLength); pUncompressedBlock = std::make_shared< UncompressedBlock >(m_uBlockSideLength); - // An uncompressed bock is always backed by a compressed one, and this is created by getCompressedBlock() if it doesn't - // already exist. If it does already exist and has data then we bring this across into the ucompressed version. - /*if(getCompressedBlock(uBlockX, uBlockY, uBlockZ)->getData() != 0) - { - // FIXME - multiple getCompressedBlock() calls (including the one above) - CompressedBlock* pBlock = getCompressedBlock(uBlockX, uBlockY, ); - - m_pBlockCompressor->decompress(pBlock, pUncompressedBlock); - }*/ - // Pass the block to the Pager to give it a chance to initialise it with any data Vector3DInt32 v3dLower(uBlockX << m_uBlockSideLengthPower, uBlockY << m_uBlockSideLengthPower, uBlockZ << m_uBlockSideLengthPower); Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); From 2b47c959a56e03bd2be702c38b23072b1bcd9e90 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 16 Sep 2014 21:39:55 +0200 Subject: [PATCH 200/259] Work on getUncompressedVoxel(). --- .../include/PolyVoxCore/LargeVolume.h | 2 - .../include/PolyVoxCore/LargeVolume.inl | 67 +++++++++---------- 2 files changed, 31 insertions(+), 38 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 1f080523..17954659 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -302,8 +302,6 @@ namespace PolyVox typedef std::map >, BlockPositionCompare> UncompressedBlockMap; - void ensureUncompressedBlockMapHasFreeSpace(void) const; - void initialise(); // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 44116cd5..47068b36 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -551,32 +551,49 @@ namespace PolyVox return m_pLastAccessedBlock; } + // Try to find the required block in our block list. std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; - typename UncompressedBlockMap::iterator itUncompressedBlock = m_pBlocks.find(v3dBlockPos); - // check whether the block is already loaded + + // Check whether the block was found. if(itUncompressedBlock != m_pBlocks.end()) { + // The block was found so we can use it. pUncompressedBlock = itUncompressedBlock->second; } else { - // At this point we know that the uncompresed block did not exist in the cache. We will - // create it and add it to the cache, which means we need to make sure there is space. - ensureUncompressedBlockMapHasFreeSpace(); - - // We can now create a new block. - //pUncompressedBlock = new UncompressedBlock(m_uBlockSideLength); + // The blcok was not found so we will create a new one. pUncompressedBlock = std::make_shared< UncompressedBlock >(m_uBlockSideLength); // Pass the block to the Pager to give it a chance to initialise it with any data - Vector3DInt32 v3dLower(uBlockX << m_uBlockSideLengthPower, uBlockY << m_uBlockSideLengthPower, uBlockZ << m_uBlockSideLengthPower); - Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); - Region reg(v3dLower, v3dUpper); - m_pPager->pageIn(reg, pUncompressedBlock); - + if (m_pPager) + { + Vector3DInt32 v3dLower(uBlockX << m_uBlockSideLengthPower, uBlockY << m_uBlockSideLengthPower, uBlockZ << m_uBlockSideLengthPower); + Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); + Region reg(v3dLower, v3dUpper); + m_pPager->pageIn(reg, pUncompressedBlock); + } + + while (m_pBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. + { + // Find the least recently used block. Hopefully this isn't too slow. + typename UncompressedBlockMap::iterator i; + typename UncompressedBlockMap::iterator itUnloadBlock = m_pBlocks.begin(); + for (i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) + { + if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) + { + itUnloadBlock = i; + } + } + + // Erase the least recently used block + eraseBlock(itUnloadBlock); + } + // Add our new block to the map. - m_pBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; @@ -609,28 +626,6 @@ namespace PolyVox return uSizeInBytes; } - template - void LargeVolume::ensureUncompressedBlockMapHasFreeSpace(void) const - { - while(m_pBlocks.size() > m_uMaxNumberOfUncompressedBlocks) - { - // Find the least recently used block. The uncompressed block cache should be - // much smaller than the total number of blocks, so hopefully this isn't too slow. - typename UncompressedBlockMap::iterator i; - typename UncompressedBlockMap::iterator itUnloadBlock = m_pBlocks.begin(); - for(i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) - { - if(i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) - { - itUnloadBlock = i; - } - } - - // Erase the least recently used block - eraseBlock(itUnloadBlock); - } - } - template template VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const From 5b59bc2d8c07fe0455eafced9d86462daa91d4c3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 13:35:43 +0200 Subject: [PATCH 201/259] Moved paging code into block constructor/destructor. --- examples/Paging/main.cpp | 4 +-- .../include/PolyVoxCore/FilePager.h | 4 +-- .../include/PolyVoxCore/LargeVolume.inl | 27 ++-------------- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 4 +-- .../include/PolyVoxCore/UncompressedBlock.h | 6 ++-- .../include/PolyVoxCore/UncompressedBlock.inl | 31 +++++++++++++++++-- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 04d20067..a01779fb 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,7 +90,7 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock > pBlockData) + virtual void pageIn(const PolyVox::Region& region, UncompressedBlock* pBlockData) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... @@ -143,7 +143,7 @@ public: //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock > /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, UncompressedBlock* /*pBlockData*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 8da3adcf..8e3e36ed 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -69,7 +69,7 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) + virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); @@ -113,7 +113,7 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) + virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 47068b36..218bff10 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -515,21 +515,7 @@ namespace PolyVox // Before deleting the block we may need to recompress its data. We // only do this if the data has been modified since it was decompressed. - if(pUncompressedBlock->m_bDataModified) - { - // Get the compressed block which we will copy the data back in to. - Vector3DInt32 v3dBlockPos = itUncompressedBlock->first; - - // From the coordinates of the block we deduce the coordinates of the contained voxels. - Vector3DInt32 v3dLower(v3dBlockPos.getX() << m_uBlockSideLengthPower, v3dBlockPos.getY() << m_uBlockSideLengthPower, v3dBlockPos.getZ() << m_uBlockSideLengthPower); - Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); - - // Page the data out - m_pPager->pageOut(Region(v3dLower, v3dUpper), itUncompressedBlock->second); - - // The compressed data has been updated, so the uncompressed data is no longer modified with respect to it. - pUncompressedBlock->m_bDataModified = false; - } + //delete itUncompressedBlock->second; @@ -564,16 +550,7 @@ namespace PolyVox else { // The blcok was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(m_uBlockSideLength); - - // Pass the block to the Pager to give it a chance to initialise it with any data - if (m_pPager) - { - Vector3DInt32 v3dLower(uBlockX << m_uBlockSideLengthPower, uBlockY << m_uBlockSideLengthPower, uBlockZ << m_uBlockSideLengthPower); - Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uBlockSideLength - 1, m_uBlockSideLength - 1, m_uBlockSideLength - 1); - Region reg(v3dLower, v3dUpper); - m_pPager->pageIn(reg, pUncompressedBlock); - } + pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); while (m_pBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. { diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index 0970c943..6b670302 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -43,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) = 0; - virtual void pageOut(const Region& region, std::shared_ptr< UncompressedBlock > pBlockData) = 0; + virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) = 0; + virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) = 0; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h index a0ed3c75..c8479322 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h @@ -35,7 +35,7 @@ namespace PolyVox friend class LargeVolume; public: - UncompressedBlock(uint16_t uSideLength); + UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); ~UncompressedBlock(); VoxelType* getData(void) const; @@ -67,7 +67,9 @@ namespace PolyVox VoxelType* m_tData; uint16_t m_uSideLength; - uint8_t m_uSideLengthPower; + uint8_t m_uSideLengthPower; + Pager* m_pPager; + Vector3DInt32 m_v3dBlockSpacePosition; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index d5252d2c..401ff40e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -26,12 +26,14 @@ freely, subject to the following restrictions: namespace PolyVox { template - UncompressedBlock::UncompressedBlock(uint16_t uSideLength) + UncompressedBlock::UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) :m_uBlockLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) ,m_uSideLength(0) ,m_uSideLengthPower(0) + ,m_pPager(pPager) + ,m_v3dBlockSpacePosition(v3dPosition) { // Compute the side length m_uSideLength = uSideLength; @@ -39,12 +41,37 @@ namespace PolyVox // Allocate the data const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength; - m_tData = new VoxelType[uNoOfVoxels]; + m_tData = new VoxelType[uNoOfVoxels]; + + // Pass the block to the Pager to give it a chance to initialise it with any data + if (m_pPager) + { + // From the coordinates of the block we deduce the coordinates of the contained voxels. + Vector3DInt32 v3dLower = m_v3dBlockSpacePosition * static_cast(m_uSideLength); + Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); + Region reg(v3dLower, v3dUpper); + + // Page the data in + m_pPager->pageIn(reg, this); + } + + // We'll use this later to decide if data needs to be paged out again. + m_bDataModified = false; } template UncompressedBlock::~UncompressedBlock() { + if (m_pPager && m_bDataModified) + { + // From the coordinates of the block we deduce the coordinates of the contained voxels. + Vector3DInt32 v3dLower = m_v3dBlockSpacePosition * static_cast(m_uSideLength); + Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); + + // Page the data out + m_pPager->pageOut(Region(v3dLower, v3dUpper), this); + } + delete[] m_tData; m_tData = 0; } From 37f1ddaed21fe7a48193cda832ac2917eb60aa4e Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 17:10:13 +0200 Subject: [PATCH 202/259] Work on block storage. --- .../include/PolyVoxCore/LargeVolume.h | 8 +- .../include/PolyVoxCore/LargeVolume.inl | 77 ++++++++++++------- 2 files changed, 53 insertions(+), 32 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 17954659..df966f6f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -300,7 +300,8 @@ namespace PolyVox } }; - typedef std::map >, BlockPositionCompare> UncompressedBlockMap; + typedef std::map >, BlockPositionCompare> SharedPtrBlockMap; + typedef std::map >, BlockPositionCompare> WeakPtrBlockMap; void initialise(); @@ -314,10 +315,11 @@ namespace PolyVox std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - void eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const; + void eraseBlock(typename SharedPtrBlockMap::iterator itUncompressedBlock) const; // The block data - mutable UncompressedBlockMap m_pBlocks; + mutable WeakPtrBlockMap m_pAllBlocks; + mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 218bff10..0c7335d7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -231,7 +231,7 @@ namespace PolyVox //clearBlockCache(); - /*if (m_pBlocks.size() > uMaxNumberOfBlocksInMemory) + /*if (m_pRecentlyUsedBlocks.size() > uMaxNumberOfBlocksInMemory) { flushAll(); }*/ @@ -369,9 +369,9 @@ namespace PolyVox for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { Vector3DInt32 pos(x,y,z); - /*typename CompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); + /*typename CompressedBlockMap::iterator itBlock = m_pRecentlyUsedBlocks.find(pos); - if(itBlock != m_pBlocks.end()) + if(itBlock != m_pRecentlyUsedBlocks.end()) { // If the block is already loaded then we don't load it again. This means it does not get uncompressed, // whereas if we were to call getUncompressedBlock() regardless then it would also get uncompressed. @@ -407,9 +407,9 @@ namespace PolyVox //Replaced the for loop here as the call to //eraseBlock was invalidating the iterator. - while(m_pBlocks.size() > 0) + while (m_pRecentlyUsedBlocks.size() > 0) { - eraseBlock(m_pBlocks.begin()); + eraseBlock(m_pRecentlyUsedBlocks.begin()); } } @@ -440,8 +440,8 @@ namespace PolyVox for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { Vector3DInt32 pos(x,y,z); - typename UncompressedBlockMap::iterator itBlock = m_pBlocks.find(pos); - if (itBlock == m_pBlocks.end()) + typename SharedPtrBlockMap::iterator itBlock = m_pRecentlyUsedBlocks.find(pos); + if (itBlock == m_pRecentlyUsedBlocks.end()) { // not loaded, not unloading continue; @@ -493,7 +493,7 @@ namespace PolyVox //setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks); //Clear the previous data - m_pBlocks.clear(); + m_pRecentlyUsedBlocks.clear(); //Other properties we might find useful later this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); @@ -502,7 +502,7 @@ namespace PolyVox } template - void LargeVolume::eraseBlock(typename UncompressedBlockMap::iterator itUncompressedBlock) const + void LargeVolume::eraseBlock(typename SharedPtrBlockMap::iterator itUncompressedBlock) const { POLYVOX_ASSERT(m_pPager, "A block should never be erased if there is no pager attached to handle it"); @@ -520,7 +520,7 @@ namespace PolyVox //delete itUncompressedBlock->second; // We can now remove the block data from memory. - m_pBlocks.erase(itUncompressedBlock); + m_pRecentlyUsedBlocks.erase(itUncompressedBlock); } template @@ -539,38 +539,57 @@ namespace PolyVox // Try to find the required block in our block list. std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; - typename UncompressedBlockMap::iterator itUncompressedBlock = m_pBlocks.find(v3dBlockPos); + typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); // Check whether the block was found. - if(itUncompressedBlock != m_pBlocks.end()) + if (itUncompressedBlock != m_pRecentlyUsedBlocks.end()) { // The block was found so we can use it. pUncompressedBlock = itUncompressedBlock->second; } else { - // The blcok was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); - - while (m_pBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. + // There's some (slim) chance that it exists in the list of all blocks, because a sampler may be holding on to it. + typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); + if (itWeakUncompressedBlock != m_pAllBlocks.end()) { - // Find the least recently used block. Hopefully this isn't too slow. - typename UncompressedBlockMap::iterator i; - typename UncompressedBlockMap::iterator itUnloadBlock = m_pBlocks.begin(); - for (i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) + if (!itWeakUncompressedBlock->second.expired()) { - if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) + // The block was found so we can use it. + pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + } + else + { + m_pAllBlocks.erase(itWeakUncompressedBlock); + } + } + else + { + // The block was not found so we will create a new one. + pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + + while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. + { + // Find the least recently used block. Hopefully this isn't too slow. + typename SharedPtrBlockMap::iterator i; + typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); + for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) { - itUnloadBlock = i; + if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) + { + itUnloadBlock = i; + } } + + // Erase the least recently used block + eraseBlock(itUnloadBlock); } - // Erase the least recently used block - eraseBlock(itUnloadBlock); + // Add our new block to the map. + m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } - - // Add our new block to the map. - m_pBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; @@ -589,8 +608,8 @@ namespace PolyVox uint32_t uSizeInBytes = sizeof(LargeVolume); //Memory used by the blocks - typename UncompressedBlockMap::iterator i; - for (i = m_pBlocks.begin(); i != m_pBlocks.end(); i++) + typename SharedPtrBlockMap::iterator i; + for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) { //Inaccurate - account for rest of loaded block. uSizeInBytes += i->second->calculateSizeInBytes(); From 98526d38d35ccbac2dbb241c84074e50ddd14664 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 21:04:47 +0200 Subject: [PATCH 203/259] Crash fix. --- .../include/PolyVoxCore/LargeVolume.inl | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 0c7335d7..86fb8244 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -547,7 +547,8 @@ namespace PolyVox // The block was found so we can use it. pUncompressedBlock = itUncompressedBlock->second; } - else + + if (!pUncompressedBlock) { // There's some (slim) chance that it exists in the list of all blocks, because a sampler may be holding on to it. typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); @@ -564,32 +565,33 @@ namespace PolyVox m_pAllBlocks.erase(itWeakUncompressedBlock); } } - else + } + + if (!pUncompressedBlock) + { + // The block was not found so we will create a new one. + pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + + while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. { - // The block was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); - - while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. + // Find the least recently used block. Hopefully this isn't too slow. + typename SharedPtrBlockMap::iterator i; + typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); + for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) { - // Find the least recently used block. Hopefully this isn't too slow. - typename SharedPtrBlockMap::iterator i; - typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); - for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) + if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) { - if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) - { - itUnloadBlock = i; - } + itUnloadBlock = i; } - - // Erase the least recently used block - eraseBlock(itUnloadBlock); } - // Add our new block to the map. - m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + // Erase the least recently used block + eraseBlock(itUnloadBlock); } + + // Add our new block to the map. + m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; From daa93aab199cd8c1510b81f18568f0ba67c21898 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 21:27:52 +0200 Subject: [PATCH 204/259] Tidying and commenting. --- .../include/PolyVoxCore/LargeVolume.inl | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 86fb8244..38f05adf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -537,36 +537,42 @@ namespace PolyVox return m_pLastAccessedBlock; } - // Try to find the required block in our block list. + // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); // Check whether the block was found. - if (itUncompressedBlock != m_pRecentlyUsedBlocks.end()) + if ((itUncompressedBlock) != m_pRecentlyUsedBlocks.end()) { // The block was found so we can use it. pUncompressedBlock = itUncompressedBlock->second; + POLYVOX_ASSERT(pUncompressedBlock, "Recent block list shold never contain a null pointer."); } if (!pUncompressedBlock) { - // There's some (slim) chance that it exists in the list of all blocks, because a sampler may be holding on to it. + // Although it's not in our recently use blocks, there's some (slim) chance that it + // exists in the list of all loaded blocks, because a sampler may be holding on to it. typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); if (itWeakUncompressedBlock != m_pAllBlocks.end()) { - if (!itWeakUncompressedBlock->second.expired()) + // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the + // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the + // list, and it will get added again soon when we pag e it in and fil it with valid data. + if (itWeakUncompressedBlock->second.expired()) { - // The block was found so we can use it. - pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pAllBlocks.erase(itWeakUncompressedBlock); } else { - m_pAllBlocks.erase(itWeakUncompressedBlock); + // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. + pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } } } + // If we still haven't found the block then it's time to create a new one and page it in from disk. if (!pUncompressedBlock) { // The block was not found so we will create a new one. @@ -589,7 +595,7 @@ namespace PolyVox eraseBlock(itUnloadBlock); } - // Add our new block to the map. + // Add our new block to the maps. m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); } From 177eb16becfd3c902ef98de946f94744fc7a0578 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 21:40:27 +0200 Subject: [PATCH 205/259] Tidying and commenting. --- .../include/PolyVoxCore/LargeVolume.h | 2 - .../include/PolyVoxCore/LargeVolume.inl | 40 +++++-------------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index df966f6f..f5b22a07 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -315,8 +315,6 @@ namespace PolyVox std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - void eraseBlock(typename SharedPtrBlockMap::iterator itUncompressedBlock) const; - // The block data mutable WeakPtrBlockMap m_pAllBlocks; mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 38f05adf..bb164054 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -407,10 +407,10 @@ namespace PolyVox //Replaced the for loop here as the call to //eraseBlock was invalidating the iterator. - while (m_pRecentlyUsedBlocks.size() > 0) + /*while (m_pRecentlyUsedBlocks.size() > 0) { eraseBlock(m_pRecentlyUsedBlocks.begin()); - } + }*/ } //////////////////////////////////////////////////////////////////////////////// @@ -419,7 +419,7 @@ namespace PolyVox template void LargeVolume::flush(Region regFlush) { - POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); + /*POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) @@ -454,7 +454,7 @@ namespace PolyVox } } // for z } // for y - } // for x + } // for x*/ } //////////////////////////////////////////////////////////////////////////////// @@ -501,28 +501,6 @@ namespace PolyVox this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); } - template - void LargeVolume::eraseBlock(typename SharedPtrBlockMap::iterator itUncompressedBlock) const - { - POLYVOX_ASSERT(m_pPager, "A block should never be erased if there is no pager attached to handle it"); - - std::shared_ptr< UncompressedBlock > pUncompressedBlock = itUncompressedBlock->second; - - // This should never happen as blocks are deleted based on being least recently used. - // I the case that we are flushing we delete all blocks, but the flush function will - // reset the 'm_pLastAccessedBlock' anyway to prevent it being accidentally reused. - //POLYVOX_ASSERT(pUncompressedBlock != m_pLastAccessedBlock, "Attempted to delete last accessed block."); - - // Before deleting the block we may need to recompress its data. We - // only do this if the data has been modified since it was decompressed. - - - //delete itUncompressedBlock->second; - - // We can now remove the block data from memory. - m_pRecentlyUsedBlocks.erase(itUncompressedBlock); - } - template std::shared_ptr< UncompressedBlock > LargeVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const { @@ -578,12 +556,16 @@ namespace PolyVox // The block was not found so we will create a new one. pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + // As we are loading a new block we should try to ensure we don't go over our target memory usage. while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. { + // This should never hit, because it should not have been possible for + // the user to limit the number of blocks if they did not provide a pager. + POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of blocks"); + // Find the least recently used block. Hopefully this isn't too slow. - typename SharedPtrBlockMap::iterator i; typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); - for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) + for (typename SharedPtrBlockMap::iterator i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) { if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) { @@ -592,7 +574,7 @@ namespace PolyVox } // Erase the least recently used block - eraseBlock(itUnloadBlock); + m_pRecentlyUsedBlocks.erase(itUnloadBlock); } // Add our new block to the maps. From 916fe310ad7da78a37eff3244e12e81f28dadfe8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 23:31:23 +0200 Subject: [PATCH 206/259] Added function to purge null blocks. --- .../include/PolyVoxCore/LargeVolume.h | 2 ++ .../include/PolyVoxCore/LargeVolume.inl | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index f5b22a07..2bd177ea 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -315,6 +315,8 @@ namespace PolyVox std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + void purgeNullPtrsFromAllBlocks(void) const; + // The block data mutable WeakPtrBlockMap m_pAllBlocks; mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index bb164054..0247f190 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -557,6 +557,7 @@ namespace PolyVox pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); // As we are loading a new block we should try to ensure we don't go over our target memory usage. + bool erasedBlock = false; while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. { // This should never hit, because it should not have been possible for @@ -575,6 +576,14 @@ namespace PolyVox // Erase the least recently used block m_pRecentlyUsedBlocks.erase(itUnloadBlock); + erasedBlock = true; + } + + // If we've deleted any blocks from the recently used list then this + // seems like a good place to purge the 'all blocks' list as well. + if (erasedBlock) + { + purgeNullPtrsFromAllBlocks(); } // Add our new block to the maps. @@ -612,6 +621,18 @@ namespace PolyVox return uSizeInBytes; } + template + void LargeVolume::purgeNullPtrsFromAllBlocks(void) const + { + for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end(); blockIter++) + { + if (blockIter->second.expired()) + { + blockIter = m_pAllBlocks.erase(blockIter); + } + } + } + template template VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const From 277b6c7b9bb736444a161f942631244159294533 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 17 Sep 2014 23:53:14 +0200 Subject: [PATCH 207/259] Tidying up. --- .../include/PolyVoxCore/LargeVolume.inl | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 0247f190..5be837b7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -400,17 +400,19 @@ namespace PolyVox template void LargeVolume::flushAll() { - POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); + POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); - // Flushing will remove the most accessed block, so invalidate the pointer. - m_pLastAccessedBlock = 0; + // Clear this pointer so it doesn't hang on to any blocks. + m_pLastAccessedBlock = nullptr; - //Replaced the for loop here as the call to - //eraseBlock was invalidating the iterator. - /*while (m_pRecentlyUsedBlocks.size() > 0) - { - eraseBlock(m_pRecentlyUsedBlocks.begin()); - }*/ + // Erase all the most recently used blocks. + m_pRecentlyUsedBlocks.clear(); + + // Remove deleted blocks from the list of all loaded blocks. + purgeNullPtrsFromAllBlocks(); + + // If there are still some blocks left then this is a cause for concern. Perhaps samplers are holding on to them? + POLYVOX_LOG_WARNING_IF(m_pAllBlocks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); } //////////////////////////////////////////////////////////////////////////////// @@ -419,7 +421,10 @@ namespace PolyVox template void LargeVolume::flush(Region regFlush) { - /*POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot flush data out of the volume because it was created without a pager attached."); + /*POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); + + // Clear this pointer so it doesn't hang on to any blocks. + m_pLastAccessedBlock = nullptr; Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) From e88466ad4d112db6835ae08fe2f3b96000b69806 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 14:14:08 +0200 Subject: [PATCH 208/259] Tidying flush function. --- .../include/PolyVoxCore/LargeVolume.inl | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 5be837b7..10973f35 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -421,11 +421,12 @@ namespace PolyVox template void LargeVolume::flush(Region regFlush) { - /*POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); + POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); // Clear this pointer so it doesn't hang on to any blocks. m_pLastAccessedBlock = nullptr; + // Convert the start and end positions into block space coordinates Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { @@ -438,28 +439,20 @@ namespace PolyVox v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); } + // Loops over the specified positions and delete the corresponding blocks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) { for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { - Vector3DInt32 pos(x,y,z); - typename SharedPtrBlockMap::iterator itBlock = m_pRecentlyUsedBlocks.find(pos); - if (itBlock == m_pRecentlyUsedBlocks.end()) - { - // not loaded, not unloading - continue; - } - eraseBlock(itBlock); - // eraseBlock might cause a call to getUncompressedBlock, which again sets m_pLastAccessedBlock - if(m_v3dLastAccessedBlockPos == pos) - { - m_pLastAccessedBlock = 0; - } - } // for z - } // for y - } // for x*/ + m_pRecentlyUsedBlocks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedBlock = 0; + } + } + } + + // We might now have so null pointers in the 'all blocks' list so clean them up. + purgeNullPtrsFromAllBlocks(); } //////////////////////////////////////////////////////////////////////////////// @@ -541,7 +534,7 @@ namespace PolyVox { // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the - // list, and it will get added again soon when we pag e it in and fil it with valid data. + // list, and it will get added again soon when we page it in and fill it with valid data. if (itWeakUncompressedBlock->second.expired()) { m_pAllBlocks.erase(itWeakUncompressedBlock); From 38b876412928db203508097d4571b36becbb9441 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 14:22:44 +0200 Subject: [PATCH 209/259] Tidying up prefetch function. --- .../include/PolyVoxCore/LargeVolume.inl | 42 ++++--------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 10973f35..fcf13e20 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -340,6 +340,7 @@ namespace PolyVox template void LargeVolume::prefetch(Region regPrefetch) { + // Convert the start and end positions into block space coordinates Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { @@ -352,46 +353,21 @@ namespace PolyVox v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); } - Vector3DInt32 v3dSize = v3dEnd - v3dStart + Vector3DInt32(1,1,1); - uint32_t numblocks = static_cast(v3dSize.getX() * v3dSize.getY() * v3dSize.getZ()); + Region region(v3dStart, v3dEnd); + uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); + POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uMaxNumberOfUncompressedBlocks, "Attempting to prefetch more than the maximum number of blocks."); + uNoOfBlocks = (std::min)(uNoOfBlocks, m_uMaxNumberOfUncompressedBlocks); - // FIXME - reinstate some logic to handle when the prefetched region is too large. - - /*if(numblocks > m_uMaxNumberOfBlocksInMemory) - { - // cannot support the amount of blocks... so only load the maximum possible - numblocks = m_uMaxNumberOfBlocksInMemory; - }*/ for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) { for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) - { - Vector3DInt32 pos(x,y,z); - /*typename CompressedBlockMap::iterator itBlock = m_pRecentlyUsedBlocks.find(pos); - - if(itBlock != m_pRecentlyUsedBlocks.end()) - { - // If the block is already loaded then we don't load it again. This means it does not get uncompressed, - // whereas if we were to call getUncompressedBlock() regardless then it would also get uncompressed. - // This might be nice, but on the prefetch region could be bigger than the uncompressed cache size. - // This would limit the amount of prefetching we could do. - continue; - }*/ - - if(numblocks == 0) - { - // Loading any more blocks would attempt to overflow the memory and therefore erase blocks - // we loaded in the beginning. This wouldn't cause logic problems but would be wasteful. - return; - } - // load a block - numblocks--; + { getUncompressedBlock(x,y,z); - } // for z - } // for y - } // for x + } + } + } } //////////////////////////////////////////////////////////////////////////////// From 8dd026e095d257a6852fd85adabb4728dbcd609d Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 14:51:43 +0200 Subject: [PATCH 210/259] Work on limiting maximum memory usage. --- examples/Paging/main.cpp | 4 +-- .../include/PolyVoxCore/LargeVolume.h | 2 +- .../include/PolyVoxCore/LargeVolume.inl | 30 ++++++++++++------- tests/testvolume.cpp | 3 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index a01779fb..1fd22aab 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -158,10 +158,8 @@ int main(int argc, char *argv[]) PerlinNoisePager* pager = new PerlinNoisePager(); LargeVolume volData(PolyVox::Region::MaxRegion, pager, 256); - //volData.setMaxNumberOfBlocksInMemory(4096); - volData.setMaxNumberOfUncompressedBlocks(64); + volData.setTargetMemoryUsage(2 * 1024 * 1024); // 2Mb - //volData.setMaxNumberOfUncompressedBlocks(4096); //createSphereInVolume(volData, 30); //createPerlinTerrain(volData); //createPerlinVolumeSlow(volData); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 2bd177ea..01008dcd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -256,7 +256,7 @@ namespace PolyVox POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; /// Sets the number of blocks for which uncompressed data is stored - void setMaxNumberOfUncompressedBlocks(uint32_t uMaxNumberOfUncompressedBlocks); + void setTargetMemoryUsage(uint32_t uTargetMemoryUsageInBytes); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); /// Sets the voxel at the position given by a 3D vector diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index fcf13e20..86461937 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -225,22 +225,26 @@ namespace PolyVox /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. //////////////////////////////////////////////////////////////////////////////// template - void LargeVolume::setMaxNumberOfUncompressedBlocks(uint32_t uMaxNumberOfUncompressedBlocks) + void LargeVolume::setTargetMemoryUsage(uint32_t uTargetMemoryUsageInBytes) { POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); - //clearBlockCache(); + uint32_t uUncompressedBlockSizeInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType); - /*if (m_pRecentlyUsedBlocks.size() > uMaxNumberOfBlocksInMemory) + m_uMaxNumberOfUncompressedBlocks = uTargetMemoryUsageInBytes / uUncompressedBlockSizeInBytes; + + const uint32_t uMinPracticalNoOfBlocks = 4; + POLYVOX_LOG_WARNING_IF(m_uMaxNumberOfUncompressedBlocks < uMinPracticalNoOfBlocks, "The target memory usage is set too low and cannot be adhered to."); + m_uMaxNumberOfUncompressedBlocks = (std::max)(m_uMaxNumberOfUncompressedBlocks, uMinPracticalNoOfBlocks); + + + if (m_pRecentlyUsedBlocks.size() > m_uMaxNumberOfUncompressedBlocks) { flushAll(); - }*/ + } - m_uMaxNumberOfUncompressedBlocks = uMaxNumberOfUncompressedBlocks; - - uint32_t uUncompressedBlockSizeInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType); - POLYVOX_LOG_DEBUG("The maximum number of uncompresed blocks has been set to " << m_uMaxNumberOfUncompressedBlocks - << ", which is " << m_uMaxNumberOfUncompressedBlocks * uUncompressedBlockSizeInBytes << " bytes"); + POLYVOX_LOG_DEBUG("Target memory usage for volume set to " << uTargetMemoryUsageInBytes << "bytes (" + << m_uMaxNumberOfUncompressedBlocks << " blocks of " << uUncompressedBlockSizeInBytes << "bytes each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -353,11 +357,13 @@ namespace PolyVox v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); } + // Ensure we don't page in more blocks than the volume can hold. Region region(v3dStart, v3dEnd); uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uMaxNumberOfUncompressedBlocks, "Attempting to prefetch more than the maximum number of blocks."); uNoOfBlocks = (std::min)(uNoOfBlocks, m_uMaxNumberOfUncompressedBlocks); + // Loops over the specified positions and touch the corresponding blocks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) { for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) @@ -598,12 +604,16 @@ namespace PolyVox template void LargeVolume::purgeNullPtrsFromAllBlocks(void) const { - for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end(); blockIter++) + for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end();) { if (blockIter->second.expired()) { blockIter = m_pAllBlocks.erase(blockIter); } + else + { + blockIter++; + } } } diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 3d737c0d..ae4df9e8 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -277,8 +277,7 @@ TestVolume::TestVolume() m_pSimpleVolume = new SimpleVolume(region); m_pLargeVolume = new LargeVolume(region, m_pFilePager, 32); - //m_pLargeVolume->setMaxNumberOfBlocksInMemory(32); - m_pLargeVolume->setMaxNumberOfUncompressedBlocks(64); + m_pLargeVolume->setTargetMemoryUsage(1 * 1024 * 1024); //Fill the volume with some data for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) From d2bbd6beba36fe4fbda3250a016f6fdc1317b75f Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 14:58:17 +0200 Subject: [PATCH 211/259] Some renaming. --- examples/Paging/main.cpp | 2 +- .../include/PolyVoxCore/LargeVolume.h | 4 +-- .../include/PolyVoxCore/LargeVolume.inl | 28 +++++++++---------- tests/testvolume.cpp | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 1fd22aab..886764d3 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) PerlinNoisePager* pager = new PerlinNoisePager(); LargeVolume volData(PolyVox::Region::MaxRegion, pager, 256); - volData.setTargetMemoryUsage(2 * 1024 * 1024); // 2Mb + volData.setMemoryUsageLimit(2 * 1024 * 1024); // 2Mb //createSphereInVolume(volData, 30); //createPerlinTerrain(volData); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 01008dcd..fc8f94c2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -256,7 +256,7 @@ namespace PolyVox POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; /// Sets the number of blocks for which uncompressed data is stored - void setTargetMemoryUsage(uint32_t uTargetMemoryUsageInBytes); + void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); /// Sets the voxel at the position given by a 3D vector @@ -324,7 +324,7 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; - uint32_t m_uMaxNumberOfUncompressedBlocks; + uint32_t m_uBlockCountLimit; // The size of the volume Region m_regValidRegionInBlocks; diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 86461937..425fac7c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -52,13 +52,13 @@ namespace PolyVox if (m_pPager) { // If a pager is available then we can set a sensible limit on our memory usage. - m_uMaxNumberOfUncompressedBlocks = 256; + m_uBlockCountLimit = 256; } else { // If there is no pager provided then we set the block limit to the maximum // value to ensure the system never attempts to page blocks out of memory. - m_uMaxNumberOfUncompressedBlocks = (std::numeric_limits::max)(); + m_uBlockCountLimit = (std::numeric_limits::max)(); } initialise(); @@ -225,26 +225,26 @@ namespace PolyVox /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. //////////////////////////////////////////////////////////////////////////////// template - void LargeVolume::setTargetMemoryUsage(uint32_t uTargetMemoryUsageInBytes) + void LargeVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) { POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); uint32_t uUncompressedBlockSizeInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType); - m_uMaxNumberOfUncompressedBlocks = uTargetMemoryUsageInBytes / uUncompressedBlockSizeInBytes; + m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; const uint32_t uMinPracticalNoOfBlocks = 4; - POLYVOX_LOG_WARNING_IF(m_uMaxNumberOfUncompressedBlocks < uMinPracticalNoOfBlocks, "The target memory usage is set too low and cannot be adhered to."); - m_uMaxNumberOfUncompressedBlocks = (std::max)(m_uMaxNumberOfUncompressedBlocks, uMinPracticalNoOfBlocks); + POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "The memory usage limit is set too low and cannot be adhered to."); + m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); - if (m_pRecentlyUsedBlocks.size() > m_uMaxNumberOfUncompressedBlocks) + if (m_pRecentlyUsedBlocks.size() > m_uBlockCountLimit) { flushAll(); } - POLYVOX_LOG_DEBUG("Target memory usage for volume set to " << uTargetMemoryUsageInBytes << "bytes (" - << m_uMaxNumberOfUncompressedBlocks << " blocks of " << uUncompressedBlockSizeInBytes << "bytes each)."); + POLYVOX_LOG_DEBUG("Target memory usage for volume set to " << uMemoryUsageInBytes << "bytes (" + << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes << "bytes each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -360,8 +360,8 @@ namespace PolyVox // Ensure we don't page in more blocks than the volume can hold. Region region(v3dStart, v3dEnd); uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); - POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uMaxNumberOfUncompressedBlocks, "Attempting to prefetch more than the maximum number of blocks."); - uNoOfBlocks = (std::min)(uNoOfBlocks, m_uMaxNumberOfUncompressedBlocks); + POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of blocks."); + uNoOfBlocks = (std::min)(uNoOfBlocks, m_uBlockCountLimit); // Loops over the specified positions and touch the corresponding blocks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) @@ -455,7 +455,7 @@ namespace PolyVox } m_uTimestamper = 0; - //m_uMaxNumberOfUncompressedBlocks = 16; + //m_uBlockCountLimit = 16; //m_uMaxNumberOfBlocksInMemory = 1024; m_v3dLastAccessedBlockPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedBlock pointer will be null; m_pLastAccessedBlock = 0; @@ -470,7 +470,7 @@ namespace PolyVox m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); - //setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks); + //setMaxNumberOfUncompressedBlocks(m_uBlockCountLimit); //Clear the previous data m_pRecentlyUsedBlocks.clear(); @@ -538,7 +538,7 @@ namespace PolyVox // As we are loading a new block we should try to ensure we don't go over our target memory usage. bool erasedBlock = false; - while (m_pRecentlyUsedBlocks.size() + 1 > m_uMaxNumberOfUncompressedBlocks) // +1 ready for new block we will add next. + while (m_pRecentlyUsedBlocks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. { // This should never hit, because it should not have been possible for // the user to limit the number of blocks if they did not provide a pager. diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index ae4df9e8..28703eb3 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -277,7 +277,7 @@ TestVolume::TestVolume() m_pSimpleVolume = new SimpleVolume(region); m_pLargeVolume = new LargeVolume(region, m_pFilePager, 32); - m_pLargeVolume->setTargetMemoryUsage(1 * 1024 * 1024); + m_pLargeVolume->setMemoryUsageLimit(1 * 1024 * 1024); //Fill the volume with some data for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) From b08974c197a77da83ec828ece17a2881b65bd156 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 16:26:47 +0200 Subject: [PATCH 212/259] Work on limiting memory usage. --- examples/Paging/main.cpp | 4 +- .../include/PolyVoxCore/LargeVolume.h | 5 ++ .../include/PolyVoxCore/LargeVolume.inl | 64 +++++++++++++------ .../include/PolyVoxCore/UncompressedBlock.h | 1 + .../include/PolyVoxCore/UncompressedBlock.inl | 9 ++- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 886764d3..d9359087 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -157,8 +157,8 @@ int main(int argc, char *argv[]) openGLWidget.show(); PerlinNoisePager* pager = new PerlinNoisePager(); - LargeVolume volData(PolyVox::Region::MaxRegion, pager, 256); - volData.setMemoryUsageLimit(2 * 1024 * 1024); // 2Mb + LargeVolume volData(PolyVox::Region::MaxRegion, pager, 64); + volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb //createSphereInVolume(volData, 30); //createPerlinTerrain(volData); diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index fc8f94c2..1fa9a5b6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -334,6 +334,11 @@ namespace PolyVox uint8_t m_uBlockSideLengthPower; Pager* m_pPager; + + // Enough to make sure a blocks and it's neighbours can be loaded, with a few to spare. + static const uint32_t uMinPracticalNoOfBlocks = 32; + // Should preent multi-gigabyte volumes with reasonable block sizes. + static const uint32_t uMaxPracticalNoOfBlocks = 32768; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 425fac7c..b4ee5feb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -51,8 +51,25 @@ namespace PolyVox if (m_pPager) { - // If a pager is available then we can set a sensible limit on our memory usage. - m_uBlockCountLimit = 256; + // If the user is creating a vast (almost infinite) volume then we can bet they will be + // expecting a high memory usage and will want a fair number of blocks to play around with. + if (regValid == Region::MaxRegion) + { + m_uBlockCountLimit = 1024; + } + else + { + // Otherwise we try to choose a block count to avoid too much thrashing, particularly when iterating + // over the whole volume. This means at least enough blocks to cover one edge of the volume, and ideally + // enough for a whole face. Which face? Longest edge by shortest edge seems like a reasonable guess. + uint32_t longestSide = (std::max)(regValid.getWidthInVoxels(), (std::max)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); + uint32_t shortestSide = (std::min)(regValid.getWidthInVoxels(), (std::min)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); + + longestSide /= m_uBlockSideLength; + shortestSide /= m_uBlockSideLength; + + m_uBlockCountLimit = longestSide * shortestSide; + } } else { @@ -61,6 +78,14 @@ namespace PolyVox m_uBlockCountLimit = (std::numeric_limits::max)(); } + // Make sure the calculated block limit is within practical bounds + m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); + m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); + + uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); + POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + initialise(); } @@ -229,22 +254,24 @@ namespace PolyVox { POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); - uint32_t uUncompressedBlockSizeInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType); - + // Calculate the number of blocks based on the memory limit and the size of each block. + uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; - const uint32_t uMinPracticalNoOfBlocks = 4; - POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "The memory usage limit is set too low and cannot be adhered to."); + // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. + POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " + << uMemoryUsageInBytes / (1024 * 1024) << "Mb is too low and cannot be adhered to."); m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); + m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - + // If the new limit is less than the number of blocks already loaded then the easiest solution is to flush and start loading again. if (m_pRecentlyUsedBlocks.size() > m_uBlockCountLimit) { flushAll(); } - POLYVOX_LOG_DEBUG("Target memory usage for volume set to " << uMemoryUsageInBytes << "bytes (" - << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes << "bytes each)."); + POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -579,24 +606,19 @@ namespace PolyVox } //////////////////////////////////////////////////////////////////////////////// - /// Note: This function needs reviewing for accuracy... + /// Calculate the memory usage of the volume. //////////////////////////////////////////////////////////////////////////////// template uint32_t LargeVolume::calculateSizeInBytes(void) { + // Purge null blocks so we know that all blocks are used. + purgeNullPtrsFromAllBlocks(); + + // We include the size of the LargeVolume class but it should be insignificant. uint32_t uSizeInBytes = sizeof(LargeVolume); - //Memory used by the blocks - typename SharedPtrBlockMap::iterator i; - for (i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) - { - //Inaccurate - account for rest of loaded block. - uSizeInBytes += i->second->calculateSizeInBytes(); - } - - //Memory used by the block cache. - //uSizeInBytes += m_vecBlocksWithUncompressedData.capacity() * sizeof(Block); - //uSizeInBytes += m_vecBlocksWithUncompressedData.size() * m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType); + // Memory used by the blocks + uSizeInBytes += UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); return uSizeInBytes; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h index c8479322..f65b0dc2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h @@ -64,6 +64,7 @@ namespace PolyVox // Made this private for consistancy with CompressedBlock. // Users shouldn't really need this for UncompressedBlock anyway. uint32_t calculateSizeInBytes(void); + static uint32_t calculateSizeInBytes(uint32_t uSideLength); VoxelType* m_tData; uint16_t m_uSideLength; diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 401ff40e..6f73d2f1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -140,9 +140,16 @@ namespace PolyVox template uint32_t UncompressedBlock::calculateSizeInBytes(void) + { + // Call through to the static version + return calculateSizeInBytes(m_uSideLength); + } + + template + uint32_t UncompressedBlock::calculateSizeInBytes(uint32_t uSideLength) { // Returns the size of this class plus the size of the uncompressed data. - uint32_t uSizeInBytes = sizeof(UncompressedBlock) + (m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType)); + uint32_t uSizeInBytes = sizeof(UncompressedBlock) + (uSideLength * uSideLength * uSideLength * sizeof(VoxelType)); return uSizeInBytes; } } From 2602b0010347b383bffb00f6c0c6c4b133d190af Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 16:54:14 +0200 Subject: [PATCH 213/259] Simplifying code. --- .../PolyVoxCore/include/PolyVoxCore/LargeVolume.inl | 10 +++------- .../include/PolyVoxCore/UncompressedBlock.inl | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index b4ee5feb..25588e69 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -614,13 +614,9 @@ namespace PolyVox // Purge null blocks so we know that all blocks are used. purgeNullPtrsFromAllBlocks(); - // We include the size of the LargeVolume class but it should be insignificant. - uint32_t uSizeInBytes = sizeof(LargeVolume); - - // Memory used by the blocks - uSizeInBytes += UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); - - return uSizeInBytes; + // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the + // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. + return UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); } template diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 6f73d2f1..083d763e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -148,8 +148,9 @@ namespace PolyVox template uint32_t UncompressedBlock::calculateSizeInBytes(uint32_t uSideLength) { - // Returns the size of this class plus the size of the uncompressed data. - uint32_t uSizeInBytes = sizeof(UncompressedBlock) + (uSideLength * uSideLength * uSideLength * sizeof(VoxelType)); + // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the + // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. + uint32_t uSizeInBytes = uSideLength * uSideLength * uSideLength * sizeof(VoxelType); return uSizeInBytes; } } From 3a08487dc22c0c1f0c16b87e4605209c683fd8de Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Sep 2014 23:35:16 +0200 Subject: [PATCH 214/259] Blocks now stored in an unordered_map (hash based) rather than a map. --- .../include/PolyVoxCore/LargeVolume.h | 21 +++---------------- .../PolyVoxCore/include/PolyVoxCore/Vector.h | 14 +++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 1fa9a5b6..968f82da 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -33,6 +33,7 @@ freely, subject to the following restrictions: #include #include //For abort() #include //For memcpy +#include #include #include #include @@ -284,24 +285,8 @@ namespace PolyVox private: - struct BlockPositionCompare - { - bool operator() (const PolyVox::Vector3DInt32& a, const PolyVox::Vector3DInt32& b) const - { - const uint32_t size = 3; - for(uint32_t ct = 0; ct < size; ++ct) - { - if (a.getElement(ct) < b.getElement(ct)) - return true; - if (b.getElement(ct) < a.getElement(ct)) - return false; - } - return false; - } - }; - - typedef std::map >, BlockPositionCompare> SharedPtrBlockMap; - typedef std::map >, BlockPositionCompare> WeakPtrBlockMap; + typedef std::unordered_map > > SharedPtrBlockMap; + typedef std::unordered_map > > WeakPtrBlockMap; void initialise(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.h b/library/PolyVoxCore/include/PolyVoxCore/Vector.h index db3da0f8..7a7ff7ed 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.h @@ -31,6 +31,7 @@ freely, subject to the following restrictions: #include #include +#include #include namespace PolyVox @@ -228,6 +229,19 @@ namespace PolyVox }//namespace PolyVox +namespace std +{ + template <> + struct hash + { + std::size_t operator()(const PolyVox::Vector3DInt32& vec) const + { + return ((vec.getX() & 0xFF)) | ((vec.getY() & 0xFF) << 8) | ((vec.getZ() & 0xFF) << 16); + } + }; +} + + #include "PolyVoxCore/Vector.inl" #endif From 25a1d953875883e33462444664573d436a4d637f Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 19 Sep 2014 16:50:24 +0200 Subject: [PATCH 215/259] Renamed LargeVolume to PagedVolume, deleted SimpleVolume, and set up typedefs pointing LargeVolume and SimpleVolume to PagedVolume for backwards compatibility. --- library/PolyVoxCore/CMakeLists.txt | 8 +- .../include/PolyVoxCore/BaseVolume.h | 2 +- .../include/PolyVoxCore/BaseVolume.inl | 2 +- .../include/PolyVoxCore/LargeVolume.h | 332 +--- .../include/PolyVoxCore/PagedVolume.h | 333 ++++ .../{LargeVolume.inl => PagedVolume.inl} | 1398 ++++++++--------- ...lumeSampler.inl => PagedVolumeSampler.inl} | 1124 ++++++------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 19 +- .../include/PolyVoxCore/SimpleVolume.h | 228 +-- .../include/PolyVoxCore/SimpleVolume.inl | 441 ------ .../include/PolyVoxCore/SimpleVolumeBlock.inl | 130 -- .../PolyVoxCore/SimpleVolumeSampler.inl | 581 ------- .../include/PolyVoxCore/UncompressedBlock.h | 4 +- 13 files changed, 1616 insertions(+), 2986 deletions(-) create mode 100644 library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h rename library/PolyVoxCore/include/PolyVoxCore/{LargeVolume.inl => PagedVolume.inl} (92%) rename library/PolyVoxCore/include/PolyVoxCore/{LargeVolumeSampler.inl => PagedVolumeSampler.inl} (84%) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 486cdf97..4e18c75e 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -50,8 +50,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/IteratorController.h include/PolyVoxCore/IteratorController.inl include/PolyVoxCore/LargeVolume.h - include/PolyVoxCore/LargeVolume.inl - include/PolyVoxCore/LargeVolumeSampler.inl include/PolyVoxCore/LowPassFilter.h include/PolyVoxCore/LowPassFilter.inl include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -60,6 +58,9 @@ SET(CORE_INC_FILES include/PolyVoxCore/MaterialDensityPair.h include/PolyVoxCore/Mesh.h include/PolyVoxCore/Mesh.inl + include/PolyVoxCore/PagedVolume.h + include/PolyVoxCore/PagedVolume.inl + include/PolyVoxCore/PagedVolumeSampler.inl include/PolyVoxCore/Pager.h include/PolyVoxCore/PolyVoxForwardDeclarations.h include/PolyVoxCore/Picking.h @@ -71,9 +72,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/Raycast.inl include/PolyVoxCore/Region.h include/PolyVoxCore/SimpleVolume.h - include/PolyVoxCore/SimpleVolume.inl - include/PolyVoxCore/SimpleVolumeBlock.inl - include/PolyVoxCore/SimpleVolumeSampler.inl include/PolyVoxCore/UncompressedBlock.h include/PolyVoxCore/UncompressedBlock.inl include/PolyVoxCore/Vector.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h index eeb3c50d..3f5f1c0f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h @@ -32,7 +32,7 @@ freely, subject to the following restrictions: namespace PolyVox { /// The BaseVolume class provides common functionality and an interface for other volume classes to implement. You should not try to create an instance of this - /// class directly. Instead you should use RawVolume, SimpleVolume, or LargeVolume. + /// class directly. Instead you should use RawVolume, SimpleVolume, or PagedVolume. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// More details to come... //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl index dc280ee2..7669a4ca 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl @@ -26,7 +26,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// /// This is protected because you should never create a BaseVolume directly, you should instead use one of the derived classes. /// - /// \sa RawVolume, SimpleVolume, LargeVolume + /// \sa RawVolume, SimpleVolume, PagedVolume //////////////////////////////////////////////////////////////////////////////// template BaseVolume::BaseVolume(const Region& regValid) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 968f82da..ff60e49f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -1,333 +1,7 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - #ifndef __PolyVox_LargeVolume_H__ #define __PolyVox_LargeVolume_H__ -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Pager.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/UncompressedBlock.h" -#include "PolyVoxCore/Vector.h" +#include "PagedVolume.h" +#include "PolyVoxForwardDeclarations.h" -#include -#include //For abort() -#include //For memcpy -#include -#include -#include -#include -#include //For invalid_argument -#include - -namespace PolyVox -{ - /// The LargeVolume class provides a memory efficient method of storing voxel data while also allowing fast access and modification. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// A LargeVolume is essentially a 3D array in which each element (or voxel) is identified by a three dimensional (x,y,z) coordinate. - /// We use the LargeVolume class to store our data in an efficient way, and it is the input to many of the algorithms (such as the surface - /// extractors) which form the heart of PolyVox. The LargeVolume class is templatised so that different types of data can be stored within each voxel. - /// - /// Basic usage - /// ----------- - /// - /// The following code snippet shows how to construct a volume and demonstrates basic usage: - /// - /// \code - /// LargeVolume volume(Region(Vector3DInt32(0,0,0), Vector3DInt32(63,127,255))); - /// volume.setVoxelAt(15, 90, 42, Material8(5)); - /// std::cout << "Voxel at (15, 90, 42) has value: " << volume.getVoxelAt(15, 90, 42).getMaterial() << std::endl; - /// std::cout << "Width = " << volume.getWidth() << ", Height = " << volume.getHeight() << ", Depth = " << volume.getDepth() << std::endl; - /// \endcode - /// - /// In this particular example each voxel in the LargeVolume is of type 'Material8', as specified by the template parameter. This is one of several - /// predefined voxel types, and it is also possible to define your own. The Material8 type simply holds an integer value where zero represents - /// empty space and any other value represents a solid material. - /// - /// The LargeVolume constructor takes a Region as a parameter. This specifies the valid range of voxels which can be held in the volume, so in this - /// particular case the valid voxel positions are (0,0,0) to (63, 127, 255). Attempts to access voxels outside this range will result is accessing the - /// border value (see getBorderValue() and setBorderValue()). PolyVox also has support for near infinite volumes which will be discussed later. - /// - /// Access to individual voxels is provided via the setVoxelAt() and getVoxelAt() member functions. Advanced users may also be interested in - /// the Sampler class for faster read-only access to a large number of voxels. - /// - /// Lastly the example prints out some properties of the LargeVolume. Note that the dimentsions getWidth(), getHeight(), and getDepth() are inclusive, such - /// that the width is 64 when the range of valid x coordinates goes from 0 to 63. - /// - /// Data Representaion - /// ------------------ - /// If stored carelessly, volume data can take up a huge amount of memory. For example, a volume of dimensions 1024x1024x1024 with - /// 1 byte per voxel will require 1GB of memory if stored in an uncompressed form. Natuarally our LargeVolume class is much more efficient - /// than this and it is worth understanding (at least at a high level) the approach which is used. - /// - /// Essentially, the LargeVolume class stores its data as a collection of blocks. Each of these block is much smaller than the whole volume, - /// for example a typical size might be 32x32x32 voxels (though is is configurable by the user). In this case, a 256x512x1024 volume - /// would contain 8x16x32 = 4096 blocks. The data for each block is stored in a compressed form, which uses only a small amout of - /// memory but it is hard to modify the data. Therefore, before any given voxel can be modified, its corresponding block must be uncompressed. - /// - /// The compression and decompression of block is a relatively slow process and so we aim to do this as rarely as possible. In order - /// to achive this, the volume class stores a cache of recently used blocks and their associated uncompressed data. Each time a voxel - /// is touched a timestamp is updated on the corresponding block. When the cache becomes full the block with the oldest timestamp is - /// recompressed and moved out of the cache. - /// - /// Achieving high compression rates - /// -------------------------------- - /// The compression rates which can be achieved can vary significantly depending the nature of the data you are storing, but you can - /// encourage high compression rates by making your data as homogenous as possible. If you are simply storing a material with each - /// voxel then this will probably happen naturally. Games such as Minecraft which use this approach will typically involve large areas - /// of the same material which will compress down well. - /// - /// However, if you are storing density values then you may want to take some care. The advantage of storing smoothly changing values - /// is that you can get smooth surfaces extracted, but storing smoothly changing values inside or outside objects (rather than just - /// on the boundary) does not benefit the surface and is very hard to compress effectively. You may wish to apply some thresholding to - /// your density values to reduce this problem (this threasholding should only be applied to voxels who don't contribute to the surface). - /// - /// Paging large volumes - /// -------------------- - /// The compression scheme described previously will typically allow you to load several billion voxels into a few hundred megabytes of memory, - /// though as explained the exact compression rate is highly dependant on your data. If you have more data than this then PolyVox provides a - /// mechanism by which parts of the volume can be paged out of memory by calling user supplied callback functions. This mechanism allows a - /// potentially unlimited amount of data to be loaded, provided the user is able to take responsibility for storing any data which PolyVox - /// cannot fit in memory, and then returning it back to PolyVox on demand. For example, the user might choose to temporarily store this data - /// on disk or stream it to a remote database. - /// - /// You can construct such a LargeVolume as follows: - /// - /// \code - /// void myDataRequiredHandler(const ConstVolumeProxy& volume, const PolyVox::Region& reg) - /// { - /// //This function is being called because part of the data is missing from memory and needs to be supplied. The parameter - /// //'volume' provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need fill. - /// } - /// - /// void myDataOverflowHandler(const ConstVolumeProxy& vol, const PolyVox::Region& reg) - /// { - /// //This function is being called because part of the data is about to be removed from memory. The parameter 'volume' - /// //provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need to store. - /// } - /// - /// LargeVolumevolData(&myDataRequiredHandler, &myDataOverflowHandler); - /// \endcode - /// - /// Essentially you are providing an extension to the LargeVolume class - a way for data to be stored once PolyVox has run out of memory for it. Note - /// that you don't actually have to do anything with the data - you could simply decide that once it gets removed from memory it doesn't matter - /// anymore. But you still need to be ready to then provide something to PolyVox (even if it's just default data) in the event that it is requested. - /// - /// Cache-aware traversal - /// --------------------- - /// You might be suprised at just how many cache misses can occur when you traverse the volume in a naive manner. Consider a 1024x1024x1024 volume - /// with blocks of size 32x32x32. And imagine you iterate over this volume with a simple three-level for loop which iterates over x, the y, then z. - /// If you start at position (0,0,0) then ny the time you reach position (1023,0,0) you have touched 1024 voxels along one edge of the volume and - /// have pulled 32 blocks into the cache. By the time you reach (1023,1023,0) you have hit 1024x1024 voxels and pulled 32x32 blocks into the cache. - /// You are now ready to touch voxel (0,0,1) which is right nect to where you started, but unless your cache is at least 32x32 blocks large then this - /// initial block has already been cleared from the cache. - /// - /// Ensuring you have a large enough cache size can obviously help the above situation, but you might also consider iterating over the voxels in a - /// different order. For example, if you replace your three-level loop with a six-level loop then you can first process all the voxels between (0,0,0) - /// and (31,31,31), then process all the voxels between (32,0,0) and (63,0,0), and so forth. Using this approach you will have no cache misses even - /// is your cache sise is only one. Of course the logic is more complex, but writing code in such a cache-aware manner may be beneficial in some situations. - /// - /// Threading - /// --------- - /// The LargeVolume class does not make any guarentees about thread safety. You should ensure that all accesses are performed from the same thread. - /// This is true even if you are only reading data from the volume, as concurrently reading from different threads can invalidate the contents - /// of the block cache (amoung other problems). - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - template - class LargeVolume : public BaseVolume - { - public: - //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. - //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but - //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler - //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated - //in the future - //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. - //class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume > - #ifndef SWIG -#if defined(_MSC_VER) - class Sampler : public BaseVolume::Sampler< LargeVolume > //This line works on VS2010 -#else - class Sampler : public BaseVolume::template Sampler< LargeVolume > //This line works on GCC -#endif - { - public: - Sampler(LargeVolume* volume); - ~Sampler(); - - /// \deprecated - POLYVOX_DEPRECATED VoxelType getSubSampledVoxel(uint8_t uLevel) const; - inline VoxelType getVoxel(void) const; - - void setPosition(const Vector3DInt32& v3dNewPos); - void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); - inline bool setVoxel(VoxelType tValue); - - void movePositiveX(void); - void movePositiveY(void); - void movePositiveZ(void); - - void moveNegativeX(void); - void moveNegativeY(void); - void moveNegativeZ(void); - - inline VoxelType peekVoxel1nx1ny1nz(void) const; - inline VoxelType peekVoxel1nx1ny0pz(void) const; - inline VoxelType peekVoxel1nx1ny1pz(void) const; - inline VoxelType peekVoxel1nx0py1nz(void) const; - inline VoxelType peekVoxel1nx0py0pz(void) const; - inline VoxelType peekVoxel1nx0py1pz(void) const; - inline VoxelType peekVoxel1nx1py1nz(void) const; - inline VoxelType peekVoxel1nx1py0pz(void) const; - inline VoxelType peekVoxel1nx1py1pz(void) const; - - inline VoxelType peekVoxel0px1ny1nz(void) const; - inline VoxelType peekVoxel0px1ny0pz(void) const; - inline VoxelType peekVoxel0px1ny1pz(void) const; - inline VoxelType peekVoxel0px0py1nz(void) const; - inline VoxelType peekVoxel0px0py0pz(void) const; - inline VoxelType peekVoxel0px0py1pz(void) const; - inline VoxelType peekVoxel0px1py1nz(void) const; - inline VoxelType peekVoxel0px1py0pz(void) const; - inline VoxelType peekVoxel0px1py1pz(void) const; - - inline VoxelType peekVoxel1px1ny1nz(void) const; - inline VoxelType peekVoxel1px1ny0pz(void) const; - inline VoxelType peekVoxel1px1ny1pz(void) const; - inline VoxelType peekVoxel1px0py1nz(void) const; - inline VoxelType peekVoxel1px0py0pz(void) const; - inline VoxelType peekVoxel1px0py1pz(void) const; - inline VoxelType peekVoxel1px1py1nz(void) const; - inline VoxelType peekVoxel1px1py0pz(void) const; - inline VoxelType peekVoxel1px1py1pz(void) const; - - private: - //Other current position information - VoxelType* mCurrentVoxel; - }; - - #endif - - public: - /// Constructor for creating a fixed size volume. - LargeVolume - ( - const Region& regValid, - Pager* pPager = nullptr, - uint16_t uBlockSideLength = 32 - ); - /// Destructor - ~LargeVolume(); - - /// Gets a voxel at the position given by x,y,z coordinates - template - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - template - VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - /// Gets a voxel at the position given by a 3D vector - POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - - /// Sets the number of blocks for which uncompressed data is stored - void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); - /// Sets the voxel at the position given by x,y,z coordinates - void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by a 3D vector - void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); - /// Tries to ensure that the voxels within the specified Region are loaded into memory. - void prefetch(Region regPrefetch); - /// Ensures that any voxels within the specified Region are removed from memory. - void flush(Region regFlush); - /// Removes all voxels from memory - void flushAll(); - - /// Calculates approximatly how many bytes of memory the volume is currently using. - uint32_t calculateSizeInBytes(void); - - protected: - /// Copy constructor - LargeVolume(const LargeVolume& rhs); - - /// Assignment operator - LargeVolume& operator=(const LargeVolume& rhs); - - private: - - typedef std::unordered_map > > SharedPtrBlockMap; - typedef std::unordered_map > > WeakPtrBlockMap; - - void initialise(); - - // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 - template - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - - std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - - void purgeNullPtrsFromAllBlocks(void) const; - - // The block data - mutable WeakPtrBlockMap m_pAllBlocks; - mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; - - mutable uint32_t m_uTimestamper; - mutable Vector3DInt32 m_v3dLastAccessedBlockPos; - mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; - uint32_t m_uBlockCountLimit; - - // The size of the volume - Region m_regValidRegionInBlocks; - - // The size of the blocks - uint16_t m_uBlockSideLength; - uint8_t m_uBlockSideLengthPower; - - Pager* m_pPager; - - // Enough to make sure a blocks and it's neighbours can be loaded, with a few to spare. - static const uint32_t uMinPracticalNoOfBlocks = 32; - // Should preent multi-gigabyte volumes with reasonable block sizes. - static const uint32_t uMaxPracticalNoOfBlocks = 32768; - }; -} - -#include "PolyVoxCore/LargeVolume.inl" -#include "PolyVoxCore/LargeVolumeSampler.inl" - -#endif //__PolyVox_LargeVolume_H__ +#endif //__PolyVox_LargeVolume_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h new file mode 100644 index 00000000..4c08721c --- /dev/null +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -0,0 +1,333 @@ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_PagedVolume_H__ +#define __PolyVox_PagedVolume_H__ + +#include "PolyVoxCore/BaseVolume.h" +#include "PolyVoxCore/Pager.h" +#include "PolyVoxCore/Region.h" +#include "PolyVoxCore/UncompressedBlock.h" +#include "PolyVoxCore/Vector.h" + +#include +#include //For abort() +#include //For memcpy +#include +#include +#include +#include +#include //For invalid_argument +#include + +namespace PolyVox +{ + /// The PagedVolume class provides a memory efficient method of storing voxel data while also allowing fast access and modification. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// A PagedVolume is essentially a 3D array in which each element (or voxel) is identified by a three dimensional (x,y,z) coordinate. + /// We use the PagedVolume class to store our data in an efficient way, and it is the input to many of the algorithms (such as the surface + /// extractors) which form the heart of PolyVox. The PagedVolume class is templatised so that different types of data can be stored within each voxel. + /// + /// Basic usage + /// ----------- + /// + /// The following code snippet shows how to construct a volume and demonstrates basic usage: + /// + /// \code + /// PagedVolume volume(Region(Vector3DInt32(0,0,0), Vector3DInt32(63,127,255))); + /// volume.setVoxelAt(15, 90, 42, Material8(5)); + /// std::cout << "Voxel at (15, 90, 42) has value: " << volume.getVoxelAt(15, 90, 42).getMaterial() << std::endl; + /// std::cout << "Width = " << volume.getWidth() << ", Height = " << volume.getHeight() << ", Depth = " << volume.getDepth() << std::endl; + /// \endcode + /// + /// In this particular example each voxel in the PagedVolume is of type 'Material8', as specified by the template parameter. This is one of several + /// predefined voxel types, and it is also possible to define your own. The Material8 type simply holds an integer value where zero represents + /// empty space and any other value represents a solid material. + /// + /// The PagedVolume constructor takes a Region as a parameter. This specifies the valid range of voxels which can be held in the volume, so in this + /// particular case the valid voxel positions are (0,0,0) to (63, 127, 255). Attempts to access voxels outside this range will result is accessing the + /// border value (see getBorderValue() and setBorderValue()). PolyVox also has support for near infinite volumes which will be discussed later. + /// + /// Access to individual voxels is provided via the setVoxelAt() and getVoxelAt() member functions. Advanced users may also be interested in + /// the Sampler class for faster read-only access to a large number of voxels. + /// + /// Lastly the example prints out some properties of the PagedVolume. Note that the dimentsions getWidth(), getHeight(), and getDepth() are inclusive, such + /// that the width is 64 when the range of valid x coordinates goes from 0 to 63. + /// + /// Data Representaion + /// ------------------ + /// If stored carelessly, volume data can take up a huge amount of memory. For example, a volume of dimensions 1024x1024x1024 with + /// 1 byte per voxel will require 1GB of memory if stored in an uncompressed form. Natuarally our PagedVolume class is much more efficient + /// than this and it is worth understanding (at least at a high level) the approach which is used. + /// + /// Essentially, the PagedVolume class stores its data as a collection of blocks. Each of these block is much smaller than the whole volume, + /// for example a typical size might be 32x32x32 voxels (though is is configurable by the user). In this case, a 256x512x1024 volume + /// would contain 8x16x32 = 4096 blocks. The data for each block is stored in a compressed form, which uses only a small amout of + /// memory but it is hard to modify the data. Therefore, before any given voxel can be modified, its corresponding block must be uncompressed. + /// + /// The compression and decompression of block is a relatively slow process and so we aim to do this as rarely as possible. In order + /// to achive this, the volume class stores a cache of recently used blocks and their associated uncompressed data. Each time a voxel + /// is touched a timestamp is updated on the corresponding block. When the cache becomes full the block with the oldest timestamp is + /// recompressed and moved out of the cache. + /// + /// Achieving high compression rates + /// -------------------------------- + /// The compression rates which can be achieved can vary significantly depending the nature of the data you are storing, but you can + /// encourage high compression rates by making your data as homogenous as possible. If you are simply storing a material with each + /// voxel then this will probably happen naturally. Games such as Minecraft which use this approach will typically involve large areas + /// of the same material which will compress down well. + /// + /// However, if you are storing density values then you may want to take some care. The advantage of storing smoothly changing values + /// is that you can get smooth surfaces extracted, but storing smoothly changing values inside or outside objects (rather than just + /// on the boundary) does not benefit the surface and is very hard to compress effectively. You may wish to apply some thresholding to + /// your density values to reduce this problem (this threasholding should only be applied to voxels who don't contribute to the surface). + /// + /// Paging large volumes + /// -------------------- + /// The compression scheme described previously will typically allow you to load several billion voxels into a few hundred megabytes of memory, + /// though as explained the exact compression rate is highly dependant on your data. If you have more data than this then PolyVox provides a + /// mechanism by which parts of the volume can be paged out of memory by calling user supplied callback functions. This mechanism allows a + /// potentially unlimited amount of data to be loaded, provided the user is able to take responsibility for storing any data which PolyVox + /// cannot fit in memory, and then returning it back to PolyVox on demand. For example, the user might choose to temporarily store this data + /// on disk or stream it to a remote database. + /// + /// You can construct such a PagedVolume as follows: + /// + /// \code + /// void myDataRequiredHandler(const ConstVolumeProxy& volume, const PolyVox::Region& reg) + /// { + /// //This function is being called because part of the data is missing from memory and needs to be supplied. The parameter + /// //'volume' provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need fill. + /// } + /// + /// void myDataOverflowHandler(const ConstVolumeProxy& vol, const PolyVox::Region& reg) + /// { + /// //This function is being called because part of the data is about to be removed from memory. The parameter 'volume' + /// //provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need to store. + /// } + /// + /// PagedVolumevolData(&myDataRequiredHandler, &myDataOverflowHandler); + /// \endcode + /// + /// Essentially you are providing an extension to the PagedVolume class - a way for data to be stored once PolyVox has run out of memory for it. Note + /// that you don't actually have to do anything with the data - you could simply decide that once it gets removed from memory it doesn't matter + /// anymore. But you still need to be ready to then provide something to PolyVox (even if it's just default data) in the event that it is requested. + /// + /// Cache-aware traversal + /// --------------------- + /// You might be suprised at just how many cache misses can occur when you traverse the volume in a naive manner. Consider a 1024x1024x1024 volume + /// with blocks of size 32x32x32. And imagine you iterate over this volume with a simple three-level for loop which iterates over x, the y, then z. + /// If you start at position (0,0,0) then ny the time you reach position (1023,0,0) you have touched 1024 voxels along one edge of the volume and + /// have pulled 32 blocks into the cache. By the time you reach (1023,1023,0) you have hit 1024x1024 voxels and pulled 32x32 blocks into the cache. + /// You are now ready to touch voxel (0,0,1) which is right nect to where you started, but unless your cache is at least 32x32 blocks large then this + /// initial block has already been cleared from the cache. + /// + /// Ensuring you have a large enough cache size can obviously help the above situation, but you might also consider iterating over the voxels in a + /// different order. For example, if you replace your three-level loop with a six-level loop then you can first process all the voxels between (0,0,0) + /// and (31,31,31), then process all the voxels between (32,0,0) and (63,0,0), and so forth. Using this approach you will have no cache misses even + /// is your cache sise is only one. Of course the logic is more complex, but writing code in such a cache-aware manner may be beneficial in some situations. + /// + /// Threading + /// --------- + /// The PagedVolume class does not make any guarentees about thread safety. You should ensure that all accesses are performed from the same thread. + /// This is true even if you are only reading data from the volume, as concurrently reading from different threads can invalidate the contents + /// of the block cache (amoung other problems). + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template + class PagedVolume : public BaseVolume + { + public: + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. + //class Sampler : public VolumeOfVoxelType::template Sampler< PagedVolume > + #ifndef SWIG +#if defined(_MSC_VER) + class Sampler : public BaseVolume::Sampler< PagedVolume > //This line works on VS2010 +#else + class Sampler : public BaseVolume::template Sampler< PagedVolume > //This line works on GCC +#endif + { + public: + Sampler(PagedVolume* volume); + ~Sampler(); + + /// \deprecated + POLYVOX_DEPRECATED VoxelType getSubSampledVoxel(uint8_t uLevel) const; + inline VoxelType getVoxel(void) const; + + void setPosition(const Vector3DInt32& v3dNewPos); + void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); + inline bool setVoxel(VoxelType tValue); + + void movePositiveX(void); + void movePositiveY(void); + void movePositiveZ(void); + + void moveNegativeX(void); + void moveNegativeY(void); + void moveNegativeZ(void); + + inline VoxelType peekVoxel1nx1ny1nz(void) const; + inline VoxelType peekVoxel1nx1ny0pz(void) const; + inline VoxelType peekVoxel1nx1ny1pz(void) const; + inline VoxelType peekVoxel1nx0py1nz(void) const; + inline VoxelType peekVoxel1nx0py0pz(void) const; + inline VoxelType peekVoxel1nx0py1pz(void) const; + inline VoxelType peekVoxel1nx1py1nz(void) const; + inline VoxelType peekVoxel1nx1py0pz(void) const; + inline VoxelType peekVoxel1nx1py1pz(void) const; + + inline VoxelType peekVoxel0px1ny1nz(void) const; + inline VoxelType peekVoxel0px1ny0pz(void) const; + inline VoxelType peekVoxel0px1ny1pz(void) const; + inline VoxelType peekVoxel0px0py1nz(void) const; + inline VoxelType peekVoxel0px0py0pz(void) const; + inline VoxelType peekVoxel0px0py1pz(void) const; + inline VoxelType peekVoxel0px1py1nz(void) const; + inline VoxelType peekVoxel0px1py0pz(void) const; + inline VoxelType peekVoxel0px1py1pz(void) const; + + inline VoxelType peekVoxel1px1ny1nz(void) const; + inline VoxelType peekVoxel1px1ny0pz(void) const; + inline VoxelType peekVoxel1px1ny1pz(void) const; + inline VoxelType peekVoxel1px0py1nz(void) const; + inline VoxelType peekVoxel1px0py0pz(void) const; + inline VoxelType peekVoxel1px0py1pz(void) const; + inline VoxelType peekVoxel1px1py1nz(void) const; + inline VoxelType peekVoxel1px1py0pz(void) const; + inline VoxelType peekVoxel1px1py1pz(void) const; + + private: + //Other current position information + VoxelType* mCurrentVoxel; + }; + + #endif + + public: + /// Constructor for creating a fixed size volume. + PagedVolume + ( + const Region& regValid, + Pager* pPager = nullptr, + uint16_t uBlockSideLength = 32 + ); + /// Destructor + ~PagedVolume(); + + /// Gets a voxel at the position given by x,y,z coordinates + template + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + template + VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; + /// Gets a voxel at the position given by a 3D vector + POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; + + /// Sets the number of blocks for which uncompressed data is stored + void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); + /// Sets the voxel at the position given by x,y,z coordinates + void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by a 3D vector + void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by x,y,z coordinates + bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); + /// Sets the voxel at the position given by a 3D vector + bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); + /// Tries to ensure that the voxels within the specified Region are loaded into memory. + void prefetch(Region regPrefetch); + /// Ensures that any voxels within the specified Region are removed from memory. + void flush(Region regFlush); + /// Removes all voxels from memory + void flushAll(); + + /// Calculates approximatly how many bytes of memory the volume is currently using. + uint32_t calculateSizeInBytes(void); + + protected: + /// Copy constructor + PagedVolume(const PagedVolume& rhs); + + /// Assignment operator + PagedVolume& operator=(const PagedVolume& rhs); + + private: + + typedef std::unordered_map > > SharedPtrBlockMap; + typedef std::unordered_map > > WeakPtrBlockMap; + + void initialise(); + + // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 + template + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + + std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + + void purgeNullPtrsFromAllBlocks(void) const; + + // The block data + mutable WeakPtrBlockMap m_pAllBlocks; + mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; + + mutable uint32_t m_uTimestamper; + mutable Vector3DInt32 m_v3dLastAccessedBlockPos; + mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; + uint32_t m_uBlockCountLimit; + + // The size of the volume + Region m_regValidRegionInBlocks; + + // The size of the blocks + uint16_t m_uBlockSideLength; + uint8_t m_uBlockSideLengthPower; + + Pager* m_pPager; + + // Enough to make sure a blocks and it's neighbours can be loaded, with a few to spare. + static const uint32_t uMinPracticalNoOfBlocks = 32; + // Should preent multi-gigabyte volumes with reasonable block sizes. + static const uint32_t uMaxPracticalNoOfBlocks = 32768; + }; +} + +#include "PolyVoxCore/PagedVolume.inl" +#include "PolyVoxCore/PagedVolumeSampler.inl" + +#endif //__PolyVox_PagedVolume_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl similarity index 92% rename from library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl rename to library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 25588e69..07c0e23e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -1,699 +1,699 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -#include -#include - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// This constructor creates a volume with a fixed size which is specified as a parameter. By default this constructor will not enable paging but you can override this if desired. If you do wish to enable paging then you are required to provide the call back function (see the other LargeVolume constructor). - /// \param regValid Specifies the minimum and maximum valid voxel positions. - /// \param pBlockCompressor An implementation of the Compressor interface which is used to compress blocks in memory. - /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory. - /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. - /// \param bPagingEnabled Controls whether or not paging is enabled for this LargeVolume. - /// \param uBlockSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. - //////////////////////////////////////////////////////////////////////////////// - template - LargeVolume::LargeVolume - ( - const Region& regValid, - Pager* pPager, - uint16_t uBlockSideLength - ) - :BaseVolume(regValid) - { - m_uBlockSideLength = uBlockSideLength; - m_pPager = pPager; - - if (m_pPager) - { - // If the user is creating a vast (almost infinite) volume then we can bet they will be - // expecting a high memory usage and will want a fair number of blocks to play around with. - if (regValid == Region::MaxRegion) - { - m_uBlockCountLimit = 1024; - } - else - { - // Otherwise we try to choose a block count to avoid too much thrashing, particularly when iterating - // over the whole volume. This means at least enough blocks to cover one edge of the volume, and ideally - // enough for a whole face. Which face? Longest edge by shortest edge seems like a reasonable guess. - uint32_t longestSide = (std::max)(regValid.getWidthInVoxels(), (std::max)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); - uint32_t shortestSide = (std::min)(regValid.getWidthInVoxels(), (std::min)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); - - longestSide /= m_uBlockSideLength; - shortestSide /= m_uBlockSideLength; - - m_uBlockCountLimit = longestSide * shortestSide; - } - } - else - { - // If there is no pager provided then we set the block limit to the maximum - // value to ensure the system never attempts to page blocks out of memory. - m_uBlockCountLimit = (std::numeric_limits::max)(); - } - - // Make sure the calculated block limit is within practical bounds - m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); - m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); - - initialise(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the VolumeResampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - LargeVolume::LargeVolume(const LargeVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Destroys the volume The destructor will call flushAll() to ensure that a paging volume has the chance to save it's data via the dataOverflowHandler() if desired. - //////////////////////////////////////////////////////////////////////////////// - template - LargeVolume::~LargeVolume() - { - flushAll(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the Volumeresampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - LargeVolume& LargeVolume::operator=(const LargeVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType LargeVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType LargeVolume::getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType LargeVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode, VoxelType tBorder) const - { - switch(eWrapMode) - { - case WrapModes::Validate: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Clamp: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Border: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::AssumeValid: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - default: - // Should never happen - POLYVOX_ASSERT(false, "Invalid wrap mode"); - return VoxelType(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param v3dPos The 3D position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType LargeVolume::getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode, VoxelType tBorder) const - { - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType LargeVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); - } - else - { - return this->getBorderValue(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos The 3D position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType LargeVolume::getVoxelAt(const Vector3DInt32& v3dPos) const - { - return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Increasing the size of the block cache will increase memory but may improve performance. - /// You may want to set this to a large value (e.g. 1024) when you are first loading your - /// volume data and then set it to a smaller value (e.g.64) for general processing. - /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) - { - POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); - - // Calculate the number of blocks based on the memory limit and the size of each block. - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; - - // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. - POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " - << uMemoryUsageInBytes / (1024 * 1024) << "Mb is too low and cannot be adhered to."); - m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); - m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - - // If the new limit is less than the number of blocks already loaded then the easiest solution is to flush and start loading again. - if (m_pRecentlyUsedBlocks.size() > m_uBlockCountLimit) - { - flushAll(); - } - - POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode) - { - if((eWrapMode != WrapModes::Validate) && (eWrapMode != WrapModes::AssumeValid)) - { - POLYVOX_THROW(std::invalid_argument, "Invalid wrap mode in call to setVoxel(). It must be 'None' or 'DontCheck'."); - } - - // This validation is skipped if the wrap mode is 'DontCheck' - if(eWrapMode == WrapModes::Validate) - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - } - - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode) - { - setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool LargeVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) - { - // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. - POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); - - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); - - //Return true to indicate that we modified a voxel. - return true; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool LargeVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) - { - return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); - } - - - //////////////////////////////////////////////////////////////////////////////// - /// Note that if *NOTE - update docs - MaxNumberOfBlocksInMemory no longer exists* MaxNumberOfBlocksInMemory is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. - /// \param regPrefetch The Region of voxels to prefetch into memory. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::prefetch(Region regPrefetch) - { - // Convert the start and end positions into block space coordinates - Vector3DInt32 v3dStart; - for(int i = 0; i < 3; i++) - { - v3dStart.setElement(i, regPrefetch.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); - } - - Vector3DInt32 v3dEnd; - for(int i = 0; i < 3; i++) - { - v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); - } - - // Ensure we don't page in more blocks than the volume can hold. - Region region(v3dStart, v3dEnd); - uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); - POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of blocks."); - uNoOfBlocks = (std::min)(uNoOfBlocks, m_uBlockCountLimit); - - // Loops over the specified positions and touch the corresponding blocks. - for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) - { - for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) - { - for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) - { - getUncompressedBlock(x,y,z); - } - } - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// Removes all voxels from memory, and calls dataOverflowHandler() to ensure the application has a chance to store the data. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::flushAll() - { - POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); - - // Clear this pointer so it doesn't hang on to any blocks. - m_pLastAccessedBlock = nullptr; - - // Erase all the most recently used blocks. - m_pRecentlyUsedBlocks.clear(); - - // Remove deleted blocks from the list of all loaded blocks. - purgeNullPtrsFromAllBlocks(); - - // If there are still some blocks left then this is a cause for concern. Perhaps samplers are holding on to them? - POLYVOX_LOG_WARNING_IF(m_pAllBlocks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Removes all voxels in the specified Region from memory, and calls dataOverflowHandler() to ensure the application has a chance to store the data. It is possible that there are no voxels loaded in the Region, in which case the function will have no effect. - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::flush(Region regFlush) - { - POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); - - // Clear this pointer so it doesn't hang on to any blocks. - m_pLastAccessedBlock = nullptr; - - // Convert the start and end positions into block space coordinates - Vector3DInt32 v3dStart; - for(int i = 0; i < 3; i++) - { - v3dStart.setElement(i, regFlush.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); - } - - Vector3DInt32 v3dEnd; - for(int i = 0; i < 3; i++) - { - v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); - } - - // Loops over the specified positions and delete the corresponding blocks. - for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) - { - for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) - { - for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) - { - m_pRecentlyUsedBlocks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedBlock = 0; - } - } - } - - // We might now have so null pointers in the 'all blocks' list so clean them up. - purgeNullPtrsFromAllBlocks(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should probably be made internal... - //////////////////////////////////////////////////////////////////////////////// - template - void LargeVolume::initialise() - { - //Validate parameters - if(m_uBlockSideLength == 0) - { - POLYVOX_THROW(std::invalid_argument, "Block side length cannot be zero."); - } - - if(!isPowerOf2(m_uBlockSideLength)) - { - POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); - } - - m_uTimestamper = 0; - //m_uBlockCountLimit = 16; - //m_uMaxNumberOfBlocksInMemory = 1024; - m_v3dLastAccessedBlockPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedBlock pointer will be null; - m_pLastAccessedBlock = 0; - - //Compute the block side length - m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); - - m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); - - //setMaxNumberOfUncompressedBlocks(m_uBlockCountLimit); - - //Clear the previous data - m_pRecentlyUsedBlocks.clear(); - - //Other properties we might find useful later - this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); - } - - template - std::shared_ptr< UncompressedBlock > LargeVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const - { - Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); - - //Check if we have the same block as last time, if so there's no need to even update - //the time stamp. If we updated it everytime then that would be every time we touched - //a voxel, which would overflow a uint32_t and require us to use a uint64_t instead. - //This check should also provide a significant speed boost as usually it is true. - if((v3dBlockPos == m_v3dLastAccessedBlockPos) && (m_pLastAccessedBlock != 0)) - { - return m_pLastAccessedBlock; - } - - // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. - std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; - typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); - - // Check whether the block was found. - if ((itUncompressedBlock) != m_pRecentlyUsedBlocks.end()) - { - // The block was found so we can use it. - pUncompressedBlock = itUncompressedBlock->second; - POLYVOX_ASSERT(pUncompressedBlock, "Recent block list shold never contain a null pointer."); - } - - if (!pUncompressedBlock) - { - // Although it's not in our recently use blocks, there's some (slim) chance that it - // exists in the list of all loaded blocks, because a sampler may be holding on to it. - typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); - if (itWeakUncompressedBlock != m_pAllBlocks.end()) - { - // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the - // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the - // list, and it will get added again soon when we page it in and fill it with valid data. - if (itWeakUncompressedBlock->second.expired()) - { - m_pAllBlocks.erase(itWeakUncompressedBlock); - } - else - { - // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. - pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - } - } - } - - // If we still haven't found the block then it's time to create a new one and page it in from disk. - if (!pUncompressedBlock) - { - // The block was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); - - // As we are loading a new block we should try to ensure we don't go over our target memory usage. - bool erasedBlock = false; - while (m_pRecentlyUsedBlocks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. - { - // This should never hit, because it should not have been possible for - // the user to limit the number of blocks if they did not provide a pager. - POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of blocks"); - - // Find the least recently used block. Hopefully this isn't too slow. - typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); - for (typename SharedPtrBlockMap::iterator i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) - { - if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) - { - itUnloadBlock = i; - } - } - - // Erase the least recently used block - m_pRecentlyUsedBlocks.erase(itUnloadBlock); - erasedBlock = true; - } - - // If we've deleted any blocks from the recently used list then this - // seems like a good place to purge the 'all blocks' list as well. - if (erasedBlock) - { - purgeNullPtrsFromAllBlocks(); - } - - // Add our new block to the maps. - m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - } - - pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; - m_pLastAccessedBlock = pUncompressedBlock; - m_v3dLastAccessedBlockPos = v3dBlockPos; - - return pUncompressedBlock; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Calculate the memory usage of the volume. - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t LargeVolume::calculateSizeInBytes(void) - { - // Purge null blocks so we know that all blocks are used. - purgeNullPtrsFromAllBlocks(); - - // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the - // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. - return UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); - } - - template - void LargeVolume::purgeNullPtrsFromAllBlocks(void) const - { - for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end();) - { - if (blockIter->second.expired()) - { - blockIter = m_pAllBlocks.erase(blockIter); - } - else - { - blockIter++; - } - } - } - - template - template - VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - // This function should never be called because one of the specialisations should always match. - POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); - } - - template - VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - //Perform clamping - uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); - uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); - uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); - uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); - uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); - uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) - { - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - else - { - return tBorder; - } - } - - template - VoxelType LargeVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const - { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); - } -} - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/ErrorHandling.h" + +#include +#include + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////// + /// This constructor creates a volume with a fixed size which is specified as a parameter. By default this constructor will not enable paging but you can override this if desired. If you do wish to enable paging then you are required to provide the call back function (see the other PagedVolume constructor). + /// \param regValid Specifies the minimum and maximum valid voxel positions. + /// \param pBlockCompressor An implementation of the Compressor interface which is used to compress blocks in memory. + /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory. + /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. + /// \param bPagingEnabled Controls whether or not paging is enabled for this PagedVolume. + /// \param uBlockSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. + //////////////////////////////////////////////////////////////////////////////// + template + PagedVolume::PagedVolume + ( + const Region& regValid, + Pager* pPager, + uint16_t uBlockSideLength + ) + :BaseVolume(regValid) + { + m_uBlockSideLength = uBlockSideLength; + m_pPager = pPager; + + if (m_pPager) + { + // If the user is creating a vast (almost infinite) volume then we can bet they will be + // expecting a high memory usage and will want a fair number of blocks to play around with. + if (regValid == Region::MaxRegion) + { + m_uBlockCountLimit = 1024; + } + else + { + // Otherwise we try to choose a block count to avoid too much thrashing, particularly when iterating + // over the whole volume. This means at least enough blocks to cover one edge of the volume, and ideally + // enough for a whole face. Which face? Longest edge by shortest edge seems like a reasonable guess. + uint32_t longestSide = (std::max)(regValid.getWidthInVoxels(), (std::max)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); + uint32_t shortestSide = (std::min)(regValid.getWidthInVoxels(), (std::min)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); + + longestSide /= m_uBlockSideLength; + shortestSide /= m_uBlockSideLength; + + m_uBlockCountLimit = longestSide * shortestSide; + } + } + else + { + // If there is no pager provided then we set the block limit to the maximum + // value to ensure the system never attempts to page blocks out of memory. + m_uBlockCountLimit = (std::numeric_limits::max)(); + } + + // Make sure the calculated block limit is within practical bounds + m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); + m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); + + uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); + POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + + initialise(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the VolumeResampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + PagedVolume::PagedVolume(const PagedVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Destroys the volume The destructor will call flushAll() to ensure that a paging volume has the chance to save it's data via the dataOverflowHandler() if desired. + //////////////////////////////////////////////////////////////////////////////// + template + PagedVolume::~PagedVolume() + { + flushAll(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the Volumeresampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + PagedVolume& PagedVolume::operator=(const PagedVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType PagedVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const + { + // Simply call through to the real implementation + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType PagedVolume::getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder) const + { + // Simply call through to the real implementation + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode, VoxelType tBorder) const + { + switch(eWrapMode) + { + case WrapModes::Validate: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::Clamp: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::Border: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::AssumeValid: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + default: + // Should never happen + POLYVOX_ASSERT(false, "Invalid wrap mode"); + return VoxelType(); + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param v3dPos The 3D position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode, VoxelType tBorder) const + { + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) + { + const int32_t blockX = uXPos >> m_uBlockSideLengthPower; + const int32_t blockY = uYPos >> m_uBlockSideLengthPower; + const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + + return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + } + else + { + return this->getBorderValue(); + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos The 3D position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxelAt(const Vector3DInt32& v3dPos) const + { + return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Increasing the size of the block cache will increase memory but may improve performance. + /// You may want to set this to a large value (e.g. 1024) when you are first loading your + /// volume data and then set it to a smaller value (e.g.64) for general processing. + /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) + { + POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); + + // Calculate the number of blocks based on the memory limit and the size of each block. + uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); + m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; + + // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. + POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " + << uMemoryUsageInBytes / (1024 * 1024) << "Mb is too low and cannot be adhered to."); + m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); + m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); + + // If the new limit is less than the number of blocks already loaded then the easiest solution is to flush and start loading again. + if (m_pRecentlyUsedBlocks.size() > m_uBlockCountLimit) + { + flushAll(); + } + + POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode) + { + if((eWrapMode != WrapModes::Validate) && (eWrapMode != WrapModes::AssumeValid)) + { + POLYVOX_THROW(std::invalid_argument, "Invalid wrap mode in call to setVoxel(). It must be 'None' or 'DontCheck'."); + } + + // This validation is skipped if the wrap mode is 'DontCheck' + if(eWrapMode == WrapModes::Validate) + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) + { + POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); + } + } + + const int32_t blockX = uXPos >> m_uBlockSideLengthPower; + const int32_t blockY = uYPos >> m_uBlockSideLengthPower; + const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode) + { + setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool PagedVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) + { + // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. + POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); + + const int32_t blockX = uXPos >> m_uBlockSideLengthPower; + const int32_t blockY = uYPos >> m_uBlockSideLengthPower; + const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + + pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + + //Return true to indicate that we modified a voxel. + return true; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool PagedVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) + { + return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); + } + + + //////////////////////////////////////////////////////////////////////////////// + /// Note that if *NOTE - update docs - MaxNumberOfBlocksInMemory no longer exists* MaxNumberOfBlocksInMemory is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. + /// \param regPrefetch The Region of voxels to prefetch into memory. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::prefetch(Region regPrefetch) + { + // Convert the start and end positions into block space coordinates + Vector3DInt32 v3dStart; + for(int i = 0; i < 3; i++) + { + v3dStart.setElement(i, regPrefetch.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); + } + + Vector3DInt32 v3dEnd; + for(int i = 0; i < 3; i++) + { + v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); + } + + // Ensure we don't page in more blocks than the volume can hold. + Region region(v3dStart, v3dEnd); + uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); + POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of blocks."); + uNoOfBlocks = (std::min)(uNoOfBlocks, m_uBlockCountLimit); + + // Loops over the specified positions and touch the corresponding blocks. + for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) + { + for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) + { + for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) + { + getUncompressedBlock(x,y,z); + } + } + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// Removes all voxels from memory, and calls dataOverflowHandler() to ensure the application has a chance to store the data. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::flushAll() + { + POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); + + // Clear this pointer so it doesn't hang on to any blocks. + m_pLastAccessedBlock = nullptr; + + // Erase all the most recently used blocks. + m_pRecentlyUsedBlocks.clear(); + + // Remove deleted blocks from the list of all loaded blocks. + purgeNullPtrsFromAllBlocks(); + + // If there are still some blocks left then this is a cause for concern. Perhaps samplers are holding on to them? + POLYVOX_LOG_WARNING_IF(m_pAllBlocks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Removes all voxels in the specified Region from memory, and calls dataOverflowHandler() to ensure the application has a chance to store the data. It is possible that there are no voxels loaded in the Region, in which case the function will have no effect. + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::flush(Region regFlush) + { + POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); + + // Clear this pointer so it doesn't hang on to any blocks. + m_pLastAccessedBlock = nullptr; + + // Convert the start and end positions into block space coordinates + Vector3DInt32 v3dStart; + for(int i = 0; i < 3; i++) + { + v3dStart.setElement(i, regFlush.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); + } + + Vector3DInt32 v3dEnd; + for(int i = 0; i < 3; i++) + { + v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); + } + + // Loops over the specified positions and delete the corresponding blocks. + for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) + { + for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) + { + for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) + { + m_pRecentlyUsedBlocks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedBlock = 0; + } + } + } + + // We might now have so null pointers in the 'all blocks' list so clean them up. + purgeNullPtrsFromAllBlocks(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should probably be made internal... + //////////////////////////////////////////////////////////////////////////////// + template + void PagedVolume::initialise() + { + //Validate parameters + if(m_uBlockSideLength == 0) + { + POLYVOX_THROW(std::invalid_argument, "Block side length cannot be zero."); + } + + if(!isPowerOf2(m_uBlockSideLength)) + { + POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); + } + + m_uTimestamper = 0; + //m_uBlockCountLimit = 16; + //m_uMaxNumberOfBlocksInMemory = 1024; + m_v3dLastAccessedBlockPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedBlock pointer will be null; + m_pLastAccessedBlock = 0; + + //Compute the block side length + m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); + + m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); + + //setMaxNumberOfUncompressedBlocks(m_uBlockCountLimit); + + //Clear the previous data + m_pRecentlyUsedBlocks.clear(); + + //Other properties we might find useful later + this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); + this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); + this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); + } + + template + std::shared_ptr< UncompressedBlock > PagedVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const + { + Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); + + //Check if we have the same block as last time, if so there's no need to even update + //the time stamp. If we updated it everytime then that would be every time we touched + //a voxel, which would overflow a uint32_t and require us to use a uint64_t instead. + //This check should also provide a significant speed boost as usually it is true. + if((v3dBlockPos == m_v3dLastAccessedBlockPos) && (m_pLastAccessedBlock != 0)) + { + return m_pLastAccessedBlock; + } + + // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. + std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; + typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); + + // Check whether the block was found. + if ((itUncompressedBlock) != m_pRecentlyUsedBlocks.end()) + { + // The block was found so we can use it. + pUncompressedBlock = itUncompressedBlock->second; + POLYVOX_ASSERT(pUncompressedBlock, "Recent block list shold never contain a null pointer."); + } + + if (!pUncompressedBlock) + { + // Although it's not in our recently use blocks, there's some (slim) chance that it + // exists in the list of all loaded blocks, because a sampler may be holding on to it. + typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); + if (itWeakUncompressedBlock != m_pAllBlocks.end()) + { + // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the + // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the + // list, and it will get added again soon when we page it in and fill it with valid data. + if (itWeakUncompressedBlock->second.expired()) + { + m_pAllBlocks.erase(itWeakUncompressedBlock); + } + else + { + // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. + pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + } + } + } + + // If we still haven't found the block then it's time to create a new one and page it in from disk. + if (!pUncompressedBlock) + { + // The block was not found so we will create a new one. + pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + + // As we are loading a new block we should try to ensure we don't go over our target memory usage. + bool erasedBlock = false; + while (m_pRecentlyUsedBlocks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. + { + // This should never hit, because it should not have been possible for + // the user to limit the number of blocks if they did not provide a pager. + POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of blocks"); + + // Find the least recently used block. Hopefully this isn't too slow. + typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); + for (typename SharedPtrBlockMap::iterator i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) + { + if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) + { + itUnloadBlock = i; + } + } + + // Erase the least recently used block + m_pRecentlyUsedBlocks.erase(itUnloadBlock); + erasedBlock = true; + } + + // If we've deleted any blocks from the recently used list then this + // seems like a good place to purge the 'all blocks' list as well. + if (erasedBlock) + { + purgeNullPtrsFromAllBlocks(); + } + + // Add our new block to the maps. + m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + } + + pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; + m_pLastAccessedBlock = pUncompressedBlock; + m_v3dLastAccessedBlockPos = v3dBlockPos; + + return pUncompressedBlock; + } + + //////////////////////////////////////////////////////////////////////////////// + /// Calculate the memory usage of the volume. + //////////////////////////////////////////////////////////////////////////////// + template + uint32_t PagedVolume::calculateSizeInBytes(void) + { + // Purge null blocks so we know that all blocks are used. + purgeNullPtrsFromAllBlocks(); + + // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the + // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. + return UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); + } + + template + void PagedVolume::purgeNullPtrsFromAllBlocks(void) const + { + for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end();) + { + if (blockIter->second.expired()) + { + blockIter = m_pAllBlocks.erase(blockIter); + } + else + { + blockIter++; + } + } + } + + template + template + VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + // This function should never be called because one of the specialisations should always match. + POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); + } + + template + VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) + { + POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); + } + + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + + template + VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + //Perform clamping + uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); + uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); + uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); + uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); + uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); + uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); + + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + + template + VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) + { + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + else + { + return tBorder; + } + } + + template + VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const + { + const int32_t blockX = uXPos >> m_uBlockSideLengthPower; + const int32_t blockY = uYPos >> m_uBlockSideLengthPower; + const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + + auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + } +} + diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl similarity index 84% rename from library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl rename to library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index df07bb77..5c55e8ae 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -1,562 +1,562 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#define CAN_GO_NEG_X(val) ((val > this->mVolume->getEnclosingRegion().getLowerX()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_X(val) ((val < this->mVolume->getEnclosingRegion().getUpperX()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Y(val) ((val > this->mVolume->getEnclosingRegion().getLowerY()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Y(val) ((val < this->mVolume->getEnclosingRegion().getUpperY()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Z(val) ((val > this->mVolume->getEnclosingRegion().getLowerZ()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Z(val) ((val < this->mVolume->getEnclosingRegion().getUpperZ()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) - -namespace PolyVox -{ - template - LargeVolume::Sampler::Sampler(LargeVolume* volume) - :BaseVolume::template Sampler< LargeVolume >(volume) - { - } - - template - LargeVolume::Sampler::~Sampler() - { - } - - template - VoxelType LargeVolume::Sampler::getSubSampledVoxel(uint8_t uLevel) const - { - if(uLevel == 0) - { - return getVoxel(); - } - else if(uLevel == 1) - { - VoxelType tValue = getVoxel(); - tValue = (std::min)(tValue, peekVoxel1px0py0pz()); - tValue = (std::min)(tValue, peekVoxel0px1py0pz()); - tValue = (std::min)(tValue, peekVoxel1px1py0pz()); - tValue = (std::min)(tValue, peekVoxel0px0py1pz()); - tValue = (std::min)(tValue, peekVoxel1px0py1pz()); - tValue = (std::min)(tValue, peekVoxel0px1py1pz()); - tValue = (std::min)(tValue, peekVoxel1px1py1pz()); - return tValue; - } - else - { - const uint8_t uSize = 1 << uLevel; - - VoxelType tValue = (std::numeric_limits::max)(); - for(uint8_t z = 0; z < uSize; ++z) - { - for(uint8_t y = 0; y < uSize; ++y) - { - for(uint8_t x = 0; x < uSize; ++x) - { - tValue = (std::min)(tValue, this->mVolume->getVoxelAt(this->mXPosInVolume + x, this->mYPosInVolume + y, this->mZPosInVolume + z)); - } - } - } - return tValue; - } - } - - template - VoxelType LargeVolume::Sampler::getVoxel(void) const - { - if(this->isCurrentPositionValid()) - { - return *mCurrentVoxel; - } - else - { - return this->getVoxelImpl(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) - { - setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); - } - - template - void LargeVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) - { - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::setPosition(xPos, yPos, zPos); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid()) - { - const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - - const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower)); - - const uint32_t uVoxelIndexInBlock = uXPosInBlock + - uYPosInBlock * this->mVolume->m_uBlockSideLength + - uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - - auto pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); - - mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; - } - else - { - mCurrentVoxel = 0; - } - } - - template - bool LargeVolume::Sampler::setVoxel(VoxelType tValue) - { - /*if(m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ) - { - *mCurrentVoxel = tValue; - return true; - } - else - { - return false; - }*/ - - //Need to think what effect this has on any existing iterators. - POLYVOX_THROW(not_implemented, "This function cannot be used on LargeVolume samplers."); - return false; - } - - template - void LargeVolume::Sampler::movePositiveX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::movePositiveX(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - ++mCurrentVoxel; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::movePositiveY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::movePositiveY(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::movePositiveZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::movePositiveZ(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::moveNegativeX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::moveNegativeX(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - --mCurrentVoxel; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::moveNegativeY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::moveNegativeY(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void LargeVolume::Sampler::moveNegativeZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< LargeVolume >::moveNegativeZ(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel - 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1nx1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px0py0pz(void) const - { - if((this->isCurrentPositionValid())) - { - return *mCurrentVoxel; - } - return this->mVolume->getVoxel(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel0px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel + 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType LargeVolume::Sampler::peekVoxel1px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } -} - -#undef CAN_GO_NEG_X -#undef CAN_GO_POS_X -#undef CAN_GO_NEG_Y -#undef CAN_GO_POS_Y -#undef CAN_GO_NEG_Z -#undef CAN_GO_POS_Z +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#define CAN_GO_NEG_X(val) ((val > this->mVolume->getEnclosingRegion().getLowerX()) && (val % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_POS_X(val) ((val < this->mVolume->getEnclosingRegion().getUpperX()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_NEG_Y(val) ((val > this->mVolume->getEnclosingRegion().getLowerY()) && (val % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_POS_Y(val) ((val < this->mVolume->getEnclosingRegion().getUpperY()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_NEG_Z(val) ((val > this->mVolume->getEnclosingRegion().getLowerZ()) && (val % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_POS_Z(val) ((val < this->mVolume->getEnclosingRegion().getUpperZ()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) + +namespace PolyVox +{ + template + PagedVolume::Sampler::Sampler(PagedVolume* volume) + :BaseVolume::template Sampler< PagedVolume >(volume) + { + } + + template + PagedVolume::Sampler::~Sampler() + { + } + + template + VoxelType PagedVolume::Sampler::getSubSampledVoxel(uint8_t uLevel) const + { + if(uLevel == 0) + { + return getVoxel(); + } + else if(uLevel == 1) + { + VoxelType tValue = getVoxel(); + tValue = (std::min)(tValue, peekVoxel1px0py0pz()); + tValue = (std::min)(tValue, peekVoxel0px1py0pz()); + tValue = (std::min)(tValue, peekVoxel1px1py0pz()); + tValue = (std::min)(tValue, peekVoxel0px0py1pz()); + tValue = (std::min)(tValue, peekVoxel1px0py1pz()); + tValue = (std::min)(tValue, peekVoxel0px1py1pz()); + tValue = (std::min)(tValue, peekVoxel1px1py1pz()); + return tValue; + } + else + { + const uint8_t uSize = 1 << uLevel; + + VoxelType tValue = (std::numeric_limits::max)(); + for(uint8_t z = 0; z < uSize; ++z) + { + for(uint8_t y = 0; y < uSize; ++y) + { + for(uint8_t x = 0; x < uSize; ++x) + { + tValue = (std::min)(tValue, this->mVolume->getVoxelAt(this->mXPosInVolume + x, this->mYPosInVolume + y, this->mZPosInVolume + z)); + } + } + } + return tValue; + } + } + + template + VoxelType PagedVolume::Sampler::getVoxel(void) const + { + if(this->isCurrentPositionValid()) + { + return *mCurrentVoxel; + } + else + { + return this->getVoxelImpl(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) + { + setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); + } + + template + void PagedVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) + { + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::setPosition(xPos, yPos, zPos); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid()) + { + const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower; + const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower; + const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower; + + const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower)); + const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower)); + const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower)); + + const uint32_t uVoxelIndexInBlock = uXPosInBlock + + uYPosInBlock * this->mVolume->m_uBlockSideLength + + uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + + auto pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); + + mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; + } + else + { + mCurrentVoxel = 0; + } + } + + template + bool PagedVolume::Sampler::setVoxel(VoxelType tValue) + { + /*if(m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ) + { + *mCurrentVoxel = tValue; + return true; + } + else + { + return false; + }*/ + + //Need to think what effect this has on any existing iterators. + POLYVOX_THROW(not_implemented, "This function cannot be used on PagedVolume samplers."); + return false; + } + + template + void PagedVolume::Sampler::movePositiveX(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::movePositiveX(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + ++mCurrentVoxel; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::movePositiveY(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::movePositiveY(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + mCurrentVoxel += this->mVolume->m_uBlockSideLength; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::movePositiveZ(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::movePositiveZ(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::moveNegativeX(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::moveNegativeX(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + --mCurrentVoxel; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::moveNegativeY(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::moveNegativeY(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + mCurrentVoxel -= this->mVolume->m_uBlockSideLength; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void PagedVolume::Sampler::moveNegativeZ(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< PagedVolume >::moveNegativeZ(); + + // Then we update the voxel pointer + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + { + //No need to compute new block. + mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + } + else + { + //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx0py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) ) + { + return *(mCurrentVoxel - 1); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1nx1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + ////////////////////////////////////////////////////////////////////////// + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px0py0pz(void) const + { + if((this->isCurrentPositionValid())) + { + return *mCurrentVoxel; + } + return this->mVolume->getVoxel(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel0px1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + ////////////////////////////////////////////////////////////////////////// + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px0py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) ) + { + return *(mCurrentVoxel + 1); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType PagedVolume::Sampler::peekVoxel1px1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } +} + +#undef CAN_GO_NEG_X +#undef CAN_GO_POS_X +#undef CAN_GO_NEG_Y +#undef CAN_GO_POS_Y +#undef CAN_GO_NEG_Z +#undef CAN_GO_POS_Z diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 4c63906d..449ff4a9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -103,11 +103,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class FilePager; - //////////////////////////////////////////////////////////////////////////////// - // LargeVolume - //////////////////////////////////////////////////////////////////////////////// - template class LargeVolume; - //////////////////////////////////////////////////////////////////////////////// // MarchingCubesSurfaceExtractor //////////////////////////////////////////////////////////////////////////////// @@ -145,6 +140,15 @@ namespace PolyVox typedef uint32_t DefaultIndexType; template class Mesh; + //////////////////////////////////////////////////////////////////////////////// + // PagedVolume + //////////////////////////////////////////////////////////////////////////////// + template class PagedVolume; + template + using LargeVolume = PagedVolume; + template + using SimpleVolume = PagedVolume; + //////////////////////////////////////////////////////////////////////////////// // Pager //////////////////////////////////////////////////////////////////////////////// @@ -160,11 +164,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// class Region; - //////////////////////////////////////////////////////////////////////////////// - // SimpleVolume - //////////////////////////////////////////////////////////////////////////////// - template class SimpleVolume; - //////////////////////////////////////////////////////////////////////////////// // Vector //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index e8dda3e3..9967d874 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -1,229 +1,7 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - #ifndef __PolyVox_SimpleVolume_H__ #define __PolyVox_SimpleVolume_H__ -#include "Impl/Utility.h" +#include "PagedVolume.h" +#include "PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" - -#include //For abort() -#include //For memcpy -#include -#include -#include //For invalid_argument - -namespace PolyVox -{ - template - class SimpleVolume : public BaseVolume - { - public: - #ifndef SWIG - //Could be made private? - class Block - { - public: - Block(uint16_t uSideLength = 0); - ~Block(); - - uint16_t getSideLength(void) const; - VoxelType getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; - VoxelType getVoxelAt(const Vector3DUint16& v3dPos) const; - - void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); - void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); - - void fill(VoxelType tValue); - void initialise(uint16_t uSideLength); - uint32_t calculateSizeInBytes(void); - - public: - VoxelType* m_tUncompressedData; - uint16_t m_uSideLength; - uint8_t m_uSideLengthPower; - }; - - //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. - //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but - //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler - //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated - //in the future - //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. - //class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume > -#if defined(_MSC_VER) - class Sampler : public BaseVolume::Sampler< SimpleVolume > //This line works on VS2010 -#else - class Sampler : public BaseVolume::template Sampler< SimpleVolume > //This line works on GCC -#endif - { - public: - /// Construct a new Sampler - Sampler(SimpleVolume* volume); - ~Sampler(); - - /// \deprecated - POLYVOX_DEPRECATED VoxelType getSubSampledVoxel(uint8_t uLevel) const; - /// Get the value of the current voxel - inline VoxelType getVoxel(void) const; - - /// Set the current voxel position - void setPosition(const Vector3DInt32& v3dNewPos); - /// Set the current voxel position - void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); - /// Set the value of the current voxel - inline bool setVoxel(VoxelType tValue); - - /// Increase the \a x position by \a 1 - void movePositiveX(void); - /// Increase the \a y position by \a 1 - void movePositiveY(void); - /// Increase the \a z position by \a 1 - void movePositiveZ(void); - - /// Decrease the \a x position by \a 1 - void moveNegativeX(void); - /// Decrease the \a y position by \a 1 - void moveNegativeY(void); - /// Decrease the \a z position by \a 1 - void moveNegativeZ(void); - - inline VoxelType peekVoxel1nx1ny1nz(void) const; - inline VoxelType peekVoxel1nx1ny0pz(void) const; - inline VoxelType peekVoxel1nx1ny1pz(void) const; - inline VoxelType peekVoxel1nx0py1nz(void) const; - inline VoxelType peekVoxel1nx0py0pz(void) const; - inline VoxelType peekVoxel1nx0py1pz(void) const; - inline VoxelType peekVoxel1nx1py1nz(void) const; - inline VoxelType peekVoxel1nx1py0pz(void) const; - inline VoxelType peekVoxel1nx1py1pz(void) const; - - inline VoxelType peekVoxel0px1ny1nz(void) const; - inline VoxelType peekVoxel0px1ny0pz(void) const; - inline VoxelType peekVoxel0px1ny1pz(void) const; - inline VoxelType peekVoxel0px0py1nz(void) const; - inline VoxelType peekVoxel0px0py0pz(void) const; - inline VoxelType peekVoxel0px0py1pz(void) const; - inline VoxelType peekVoxel0px1py1nz(void) const; - inline VoxelType peekVoxel0px1py0pz(void) const; - inline VoxelType peekVoxel0px1py1pz(void) const; - - inline VoxelType peekVoxel1px1ny1nz(void) const; - inline VoxelType peekVoxel1px1ny0pz(void) const; - inline VoxelType peekVoxel1px1ny1pz(void) const; - inline VoxelType peekVoxel1px0py1nz(void) const; - inline VoxelType peekVoxel1px0py0pz(void) const; - inline VoxelType peekVoxel1px0py1pz(void) const; - inline VoxelType peekVoxel1px1py1nz(void) const; - inline VoxelType peekVoxel1px1py0pz(void) const; - inline VoxelType peekVoxel1px1py1pz(void) const; - - private: - //Other current position information - VoxelType* mCurrentVoxel; - }; - #endif - - public: - /// Constructor for creating a fixed size volume. - SimpleVolume(const Region& regValid, uint16_t uBlockSideLength = 32); - - /// Destructor - ~SimpleVolume(); - - /// Gets a voxel at the position given by x,y,z coordinates - template - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - template - VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - /// Gets a voxel at the position given by a 3D vector - POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - - /// Sets the voxel at the position given by x,y,z coordinates - void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by a 3D vector - void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); - - /// Calculates approximatly how many bytes of memory the volume is currently using. - uint32_t calculateSizeInBytes(void); - - protected: - /// Copy constructor - SimpleVolume(const SimpleVolume& rhs); - - /// Assignment operator - SimpleVolume& operator=(const SimpleVolume& rhs); - - private: - void initialise(const Region& regValidRegion, uint16_t uBlockSideLength); - - // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 - template - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - - Block* getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - - //The block data - Block* m_pBlocks; - - //The size of the volume in vlocks - Region m_regValidRegionInBlocks; - - //Volume size measured in blocks. - uint32_t m_uNoOfBlocksInVolume; - uint16_t m_uWidthInBlocks; - uint16_t m_uHeightInBlocks; - uint16_t m_uDepthInBlocks; - - //The size of the blocks - uint32_t m_uNoOfVoxelsPerBlock; - uint16_t m_uBlockSideLength; - uint8_t m_uBlockSideLengthPower; - }; -} - -#include "PolyVoxCore/SimpleVolumeBlock.inl" -#include "PolyVoxCore/SimpleVolume.inl" -#include "PolyVoxCore/SimpleVolumeSampler.inl" - -#endif //__PolyVox_SimpleVolume_H__ +#endif //__PolyVox_SimpleVolume_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl deleted file mode 100644 index f32aacdd..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl +++ /dev/null @@ -1,441 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// This constructor creates a volume with a fixed size which is specified as a parameter. - /// \param regValid Specifies the minimum and maximum valid voxel positions. - /// \param uBlockSideLength The size of the block to use within the volume - //////////////////////////////////////////////////////////////////////////////// - template - SimpleVolume::SimpleVolume(const Region& regValid, uint16_t uBlockSideLength) - :BaseVolume(regValid) - { - //Create a volume of the right size. - initialise(regValid,uBlockSideLength); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the Volumeresampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - SimpleVolume::SimpleVolume(const SimpleVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Destroys the volume - //////////////////////////////////////////////////////////////////////////////// - template - SimpleVolume::~SimpleVolume() - { - delete[] m_pBlocks; - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the Volumeresampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - SimpleVolume& SimpleVolume::operator=(const SimpleVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType SimpleVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType SimpleVolume::getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType SimpleVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode, VoxelType tBorder) const - { - switch(eWrapMode) - { - case WrapModes::Validate: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Clamp: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Border: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::AssumeValid: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - default: - // Should never happen - POLYVOX_ASSERT(false, "Invalid wrap mode"); - return VoxelType(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param v3dPos The 3D position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType SimpleVolume::getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode, VoxelType tBorder) const - { - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType SimpleVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - typename SimpleVolume::Block* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - return pUncompressedBlock->getVoxelAt(xOffset,yOffset,zOffset); - } - else - { - return this->getBorderValue(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos The 3D position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType SimpleVolume::getVoxelAt(const Vector3DInt32& v3dPos) const - { - return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void SimpleVolume::setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode) - { - if((eWrapMode != WrapModes::Validate) && (eWrapMode != WrapModes::AssumeValid)) - { - POLYVOX_THROW(std::invalid_argument, "Invalid wrap mode in call to setVoxel(). It must be 'None' or 'DontCheck'."); - } - - // This validation is skipped if the wrap mode is 'DontCheck' - if(eWrapMode == WrapModes::Validate) - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - } - - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = uXPos - (blockX << m_uBlockSideLengthPower); - const uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower); - const uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower); - - typename SimpleVolume::Block* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - pUncompressedBlock->setVoxelAt(xOffset,yOffset,zOffset, tValue); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void SimpleVolume::setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode) - { - setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool SimpleVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) - { - // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. - POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); - - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = uXPos - (blockX << m_uBlockSideLengthPower); - const uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower); - const uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower); - - typename SimpleVolume::Block* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - pUncompressedBlock->setVoxelAt(xOffset,yOffset,zOffset, tValue); - - //Return true to indicate that we modified a voxel. - return true; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool SimpleVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) - { - return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should probably be made internal... - //////////////////////////////////////////////////////////////////////////////// - template - void SimpleVolume::initialise(const Region& regValidRegion, uint16_t uBlockSideLength) - { - //Release mode validation - if(uBlockSideLength < 8) - { - POLYVOX_THROW(std::invalid_argument, "Block side length should be at least 8"); - } - if(uBlockSideLength > 256) - { - POLYVOX_THROW(std::invalid_argument, "Block side length should not be more than 256"); - } - if(!isPowerOf2(uBlockSideLength)) - { - POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); - } - - this->m_regValidRegion = regValidRegion; - - //Compute the block side length - m_uBlockSideLength = uBlockSideLength; - m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); - m_uNoOfVoxelsPerBlock = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength; - - m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); - - //Compute the size of the volume in blocks (and note +1 at the end) - m_uWidthInBlocks = m_regValidRegionInBlocks.getUpperX() - m_regValidRegionInBlocks.getLowerX() + 1; - m_uHeightInBlocks = m_regValidRegionInBlocks.getUpperY() - m_regValidRegionInBlocks.getLowerY() + 1; - m_uDepthInBlocks = m_regValidRegionInBlocks.getUpperZ() - m_regValidRegionInBlocks.getLowerZ() + 1; - m_uNoOfBlocksInVolume = m_uWidthInBlocks * m_uHeightInBlocks * m_uDepthInBlocks; - - //Allocate the data - m_pBlocks = new Block[m_uNoOfBlocksInVolume]; - for(uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i) - { - m_pBlocks[i].initialise(m_uBlockSideLength); - } - - //Other properties we might find useful later - this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); - } - - template - typename SimpleVolume::Block* SimpleVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const - { - //The lower left corner of the volume could be - //anywhere, but array indices need to start at zero. - uBlockX -= m_regValidRegionInBlocks.getLowerX(); - uBlockY -= m_regValidRegionInBlocks.getLowerY(); - uBlockZ -= m_regValidRegionInBlocks.getLowerZ(); - - POLYVOX_ASSERT(uBlockX >= 0, "Block coordinate must not be negative."); - POLYVOX_ASSERT(uBlockY >= 0, "Block coordinate must not be negative."); - POLYVOX_ASSERT(uBlockZ >= 0, "Block coordinate must not be negative."); - - //Compute the block index - uint32_t uBlockIndex = - uBlockX + - uBlockY * m_uWidthInBlocks + - uBlockZ * m_uWidthInBlocks * m_uHeightInBlocks; - - //Return the block - return &(m_pBlocks[uBlockIndex]); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \todo This function needs reviewing for accuracy... - /// - /// \return The number of bytes used - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t SimpleVolume::calculateSizeInBytes(void) - { - uint32_t uSizeInBytes = sizeof(SimpleVolume); - - uint32_t uSizeOfBlockInBytes = m_uNoOfVoxelsPerBlock * sizeof(VoxelType); - - //Memory used by the blocks - uSizeInBytes += uSizeOfBlockInBytes * (m_uNoOfBlocksInVolume); - - return uSizeInBytes; - } - - template - template - VoxelType SimpleVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - // This function should never be called because one of the specialisations should always match. - POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); - } - - template - VoxelType SimpleVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType SimpleVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - //Perform clamping - uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); - uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); - uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); - uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); - uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); - uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType SimpleVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) - { - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - else - { - return tBorder; - } - } - - template - VoxelType SimpleVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const - { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - - typename SimpleVolume::Block* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - - return pUncompressedBlock->getVoxelAt(xOffset,yOffset,zOffset); - } -} - diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl deleted file mode 100644 index 08e06c1e..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -namespace PolyVox -{ - template - SimpleVolume::Block::Block(uint16_t uSideLength) - :m_tUncompressedData(0) - ,m_uSideLength(0) - ,m_uSideLengthPower(0) - { - if(uSideLength != 0) - { - initialise(uSideLength); - } - } - - template - SimpleVolume::Block::~Block() - { - delete[] m_tUncompressedData; - } - - template - uint16_t SimpleVolume::Block::getSideLength(void) const - { - return m_uSideLength; - } - - template - VoxelType SimpleVolume::Block::getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const - { - // This is internal code not directly called by the user. For efficiency we assert rather than throwing. - POLYVOX_ASSERT(uXPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(uYPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(uZPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(m_tUncompressedData, "No uncompressed data available"); - - return m_tUncompressedData - [ - uXPos + - uYPos * m_uSideLength + - uZPos * m_uSideLength * m_uSideLength - ]; - } - - template - VoxelType SimpleVolume::Block::getVoxelAt(const Vector3DUint16& v3dPos) const - { - return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - - template - void SimpleVolume::Block::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) - { - // This is internal code not directly called by the user. For efficiency we assert rather than throwing. - POLYVOX_ASSERT(uXPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(uYPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(uZPos < m_uSideLength, "Position is outside of the block."); - POLYVOX_ASSERT(m_tUncompressedData, "No uncompressed data available"); - - m_tUncompressedData - [ - uXPos + - uYPos * m_uSideLength + - uZPos * m_uSideLength * m_uSideLength - ] = tValue; - } - - template - void SimpleVolume::Block::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) - { - setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); - } - - template - void SimpleVolume::Block::fill(VoxelType tValue) - { - const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength; - std::fill(m_tUncompressedData, m_tUncompressedData + uNoOfVoxels, tValue); - } - - template - void SimpleVolume::Block::initialise(uint16_t uSideLength) - { - //Release mode validation - if(!isPowerOf2(uSideLength)) - { - POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); - } - - //Compute the side length - m_uSideLength = uSideLength; - m_uSideLengthPower = logBase2(uSideLength); - - m_tUncompressedData = new VoxelType[m_uSideLength * m_uSideLength * m_uSideLength]; - - SimpleVolume::Block::fill(VoxelType()); - } - - template - uint32_t SimpleVolume::Block::calculateSizeInBytes(void) - { - uint32_t uSizeInBytes = sizeof(Block); - uSizeInBytes += sizeof(VoxelType) * m_uSideLength * m_uSideLength * m_uSideLength; - return uSizeInBytes; - } -} diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl deleted file mode 100644 index 6cf16bef..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl +++ /dev/null @@ -1,581 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#define CAN_GO_NEG_X(val) ((val > this->mVolume->getEnclosingRegion().getLowerX()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_X(val) ((val < this->mVolume->getEnclosingRegion().getUpperX()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Y(val) ((val > this->mVolume->getEnclosingRegion().getLowerY()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Y(val) ((val < this->mVolume->getEnclosingRegion().getUpperY()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Z(val) ((val > this->mVolume->getEnclosingRegion().getLowerZ()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Z(val) ((val < this->mVolume->getEnclosingRegion().getUpperZ()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) - -namespace PolyVox -{ - /** - * \param volume The SimpleVolume you want to sample - */ - template - SimpleVolume::Sampler::Sampler(SimpleVolume* volume) - :BaseVolume::template Sampler< SimpleVolume >(volume) - { - } - - template - SimpleVolume::Sampler::~Sampler() - { - } - - template - VoxelType SimpleVolume::Sampler::getSubSampledVoxel(uint8_t uLevel) const - { - if(uLevel == 0) - { - return getVoxel(); - } - else if(uLevel == 1) - { - VoxelType tValue = getVoxel(); - tValue = (std::min)(tValue, peekVoxel1px0py0pz()); - tValue = (std::min)(tValue, peekVoxel0px1py0pz()); - tValue = (std::min)(tValue, peekVoxel1px1py0pz()); - tValue = (std::min)(tValue, peekVoxel0px0py1pz()); - tValue = (std::min)(tValue, peekVoxel1px0py1pz()); - tValue = (std::min)(tValue, peekVoxel0px1py1pz()); - tValue = (std::min)(tValue, peekVoxel1px1py1pz()); - return tValue; - } - else - { - const uint8_t uSize = 1 << uLevel; - - VoxelType tValue = (std::numeric_limits::max)(); - for(uint8_t z = 0; z < uSize; ++z) - { - for(uint8_t y = 0; y < uSize; ++y) - { - for(uint8_t x = 0; x < uSize; ++x) - { - tValue = (std::min)(tValue, this->mVolume->getVoxelAt(this->mXPosInVolume + x, this->mYPosInVolume + y, this->mZPosInVolume + z)); - } - } - } - return tValue; - } - } - - /** - * \return The current voxel - */ - template - VoxelType SimpleVolume::Sampler::getVoxel(void) const - { - if(this->isCurrentPositionValid()) - { - return *mCurrentVoxel; - } - else - { - return this->getVoxelImpl(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - /** - * \param v3dNewPos The position to set to - */ - template - void SimpleVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) - { - setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); - } - - /** - * \param xPos The \a x position to set to - * \param yPos The \a y position to set to - * \param zPos The \a z position to set to - */ - template - void SimpleVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) - { - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::setPosition(xPos, yPos, zPos); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid()) - { - const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - - const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower)); - - const uint32_t uVoxelIndexInBlock = uXPosInBlock + - uYPosInBlock * this->mVolume->m_uBlockSideLength + - uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - - Block* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); - - mCurrentVoxel = pUncompressedCurrentBlock->m_tUncompressedData + uVoxelIndexInBlock; - } - else - { - mCurrentVoxel = 0; - } - } - - /** - * \details - * - * This function checks that the current voxel position that you're trying - * to set is not outside the volume. If it is, this function returns - * \a false, otherwise it will return \a true. - * - * \param tValue The value to set to voxel to - */ - template - bool SimpleVolume::Sampler::setVoxel(VoxelType tValue) - { - if(this->m_bIsCurrentPositionValidInX && this->m_bIsCurrentPositionValidInY && this->m_bIsCurrentPositionValidInZ) - { - *mCurrentVoxel = tValue; - return true; - } - else - { - return false; - } - } - - template - void SimpleVolume::Sampler::movePositiveX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::movePositiveX(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - ++mCurrentVoxel; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void SimpleVolume::Sampler::movePositiveY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::movePositiveY(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void SimpleVolume::Sampler::movePositiveZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::movePositiveZ(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void SimpleVolume::Sampler::moveNegativeX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::moveNegativeX(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - --mCurrentVoxel; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void SimpleVolume::Sampler::moveNegativeY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::moveNegativeY(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void SimpleVolume::Sampler::moveNegativeZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< SimpleVolume >::moveNegativeZ(); - - // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) - { - //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - } - else - { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel - 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1nx1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px0py0pz(void) const - { - if((this->isCurrentPositionValid())) - { - return *mCurrentVoxel; - } - return this->mVolume->getVoxel(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel0px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel + 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType SimpleVolume::Sampler::peekVoxel1px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } -} - -#undef CAN_GO_NEG_X -#undef CAN_GO_POS_X -#undef CAN_GO_NEG_Y -#undef CAN_GO_POS_Y -#undef CAN_GO_NEG_Z -#undef CAN_GO_POS_Z diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h index f65b0dc2..abc3ca63 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h @@ -32,7 +32,7 @@ namespace PolyVox template class UncompressedBlock { - friend class LargeVolume; + friend class PagedVolume; public: UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); @@ -54,7 +54,7 @@ namespace PolyVox /// Private assignment operator to prevent accisdental copying UncompressedBlock& operator=(const UncompressedBlock& /*rhs*/) {}; - // This is updated by the LargeVolume and used to discard the least recently used blocks. + // This is updated by the PagedVolume and used to discard the least recently used blocks. uint32_t m_uBlockLastAccessed; // This is so we can tell whether a uncompressed block has to be recompressed and whether From 6f08184fcbcff04ad0efa5401462947a537abb0a Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 19 Sep 2014 17:02:44 +0200 Subject: [PATCH 216/259] Fixed initialization of blocks. --- .../PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl index 083d763e..4e038024 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl @@ -54,6 +54,11 @@ namespace PolyVox // Page the data in m_pPager->pageIn(reg, this); } + else + { + // Just fill with zeros + std::fill(m_tData, m_tData + uNoOfVoxels, VoxelType()); + } // We'll use this later to decide if data needs to be paged out again. m_bDataModified = false; From 4779f917871562f585085a5a2dd30015d235775b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 14:49:12 +0200 Subject: [PATCH 217/259] TestVolume unit test now tests PagedVolume rather than SimpleVolume and LargeVolume. --- tests/testvolume.cpp | 141 ++++++++----------------------------------- tests/testvolume.h | 31 +++------- 2 files changed, 34 insertions(+), 138 deletions(-) diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 28703eb3..4007c6ed 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -24,9 +24,8 @@ freely, subject to the following restrictions: #include "testvolume.h" #include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/LargeVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/SimpleVolume.h" #include #include @@ -274,10 +273,9 @@ TestVolume::TestVolume() //Create the volumes m_pRawVolume = new RawVolume(region); - m_pSimpleVolume = new SimpleVolume(region); - m_pLargeVolume = new LargeVolume(region, m_pFilePager, 32); + m_pPagedVolume = new LargeVolume(region, m_pFilePager, 32); - m_pLargeVolume->setMemoryUsageLimit(1 * 1024 * 1024); + m_pPagedVolume->setMemoryUsageLimit(1 * 1024 * 1024); //Fill the volume with some data for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) @@ -288,8 +286,7 @@ TestVolume::TestVolume() { int32_t value = x + y + z; m_pRawVolume->setVoxelAt(x, y, z, value); - m_pSimpleVolume->setVoxelAt(x, y, z, value); - m_pLargeVolume->setVoxelAt(x, y, z, value); + m_pPagedVolume->setVoxelAt(x, y, z, value); } } } @@ -298,18 +295,16 @@ TestVolume::TestVolume() TestVolume::~TestVolume() { delete m_pRawVolume; - delete m_pSimpleVolume; - delete m_pLargeVolume; + delete m_pPagedVolume; delete m_pFilePager; - delete m_pBlockCompressor; } /* * RawVolume Tests */ -/*void TestVolume::testRawVolumeDirectAccessAllInternalForwards() +void TestVolume::testRawVolumeDirectAccessAllInternalForwards() { int32_t result = 0; @@ -395,176 +390,88 @@ void TestVolume::testRawVolumeSamplersWithExternalBackwards() result = testSamplersWithWrappingBackwards(m_pRawVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-769775893)); -}*/ +} /* - * SimpleVolume Tests + * PagedVolume Tests */ -/*void TestVolume::testSimpleVolumeDirectAccessAllInternalForwards() +void TestVolume::testPagedVolumeDirectAccessAllInternalForwards() { int32_t result = 0; QBENCHMARK { - result = testDirectAccessWithWrappingForwards(m_pSimpleVolume, 4, 2, 2, -3, -1, -2); + result = testDirectAccessWithWrappingForwards(m_pPagedVolume, 4, 2, 2, -3, -1, -2); } QCOMPARE(result, static_cast(1004598054)); } -void TestVolume::testSimpleVolumeSamplersAllInternalForwards() +void TestVolume::testPagedVolumeSamplersAllInternalForwards() { int32_t result = 0; QBENCHMARK { - result = testSamplersWithWrappingForwards(m_pSimpleVolume, 4, 2, 2, -3, -1, -2); + result = testSamplersWithWrappingForwards(m_pPagedVolume, 4, 2, 2, -3, -1, -2); } QCOMPARE(result, static_cast(1004598054)); } -void TestVolume::testSimpleVolumeDirectAccessWithExternalForwards() +void TestVolume::testPagedVolumeDirectAccessWithExternalForwards() { int32_t result = 0; QBENCHMARK { - result = testDirectAccessWithWrappingForwards(m_pSimpleVolume, -1, -3, -2, 2, 5, 4); + result = testDirectAccessWithWrappingForwards(m_pPagedVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-928601007)); } -void TestVolume::testSimpleVolumeSamplersWithExternalForwards() +void TestVolume::testPagedVolumeSamplersWithExternalForwards() { int32_t result = 0; QBENCHMARK { - result = testSamplersWithWrappingForwards(m_pSimpleVolume, -1, -3, -2, 2, 5, 4); + result = testSamplersWithWrappingForwards(m_pPagedVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-928601007)); } -void TestVolume::testSimpleVolumeDirectAccessAllInternalBackwards() +void TestVolume::testPagedVolumeDirectAccessAllInternalBackwards() { int32_t result = 0; QBENCHMARK { - result = testDirectAccessWithWrappingBackwards(m_pSimpleVolume, 4, 2, 2, -3, -1, -2); + result = testDirectAccessWithWrappingBackwards(m_pPagedVolume, 4, 2, 2, -3, -1, -2); } QCOMPARE(result, static_cast(-269366578)); } -void TestVolume::testSimpleVolumeSamplersAllInternalBackwards() +void TestVolume::testPagedVolumeSamplersAllInternalBackwards() { int32_t result = 0; QBENCHMARK { - result = testSamplersWithWrappingBackwards(m_pSimpleVolume, 4, 2, 2, -3, -1, -2); + result = testSamplersWithWrappingBackwards(m_pPagedVolume, 4, 2, 2, -3, -1, -2); } QCOMPARE(result, static_cast(-269366578)); } -void TestVolume::testSimpleVolumeDirectAccessWithExternalBackwards() +void TestVolume::testPagedVolumeDirectAccessWithExternalBackwards() { int32_t result = 0; QBENCHMARK { - result = testDirectAccessWithWrappingBackwards(m_pSimpleVolume, -1, -3, -2, 2, 5, 4); + result = testDirectAccessWithWrappingBackwards(m_pPagedVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-769775893)); } -void TestVolume::testSimpleVolumeSamplersWithExternalBackwards() +void TestVolume::testPagedVolumeSamplersWithExternalBackwards() { int32_t result = 0; QBENCHMARK { - result = testSamplersWithWrappingBackwards(m_pSimpleVolume, -1, -3, -2, 2, 5, 4); - } - QCOMPARE(result, static_cast(-769775893)); -}*/ - -/* - * LargeVolume Tests - */ - -void TestVolume::testLargeVolumeDirectAccessAllInternalForwards() -{ - int32_t result = 0; - QBENCHMARK - { - result = testDirectAccessWithWrappingForwards(m_pLargeVolume, 4, 2, 2, -3, -1, -2); - } - QCOMPARE(result, static_cast(1004598054)); -} - -void TestVolume::testLargeVolumeSamplersAllInternalForwards() -{ - int32_t result = 0; - - QBENCHMARK - { - result = testSamplersWithWrappingForwards(m_pLargeVolume, 4, 2, 2, -3, -1, -2); - } - QCOMPARE(result, static_cast(1004598054)); -} - -void TestVolume::testLargeVolumeDirectAccessWithExternalForwards() -{ - int32_t result = 0; - QBENCHMARK - { - result = testDirectAccessWithWrappingForwards(m_pLargeVolume, -1, -3, -2, 2, 5, 4); - } - QCOMPARE(result, static_cast(-928601007)); -} - -void TestVolume::testLargeVolumeSamplersWithExternalForwards() -{ - int32_t result = 0; - - QBENCHMARK - { - result = testSamplersWithWrappingForwards(m_pLargeVolume, -1, -3, -2, 2, 5, 4); - } - QCOMPARE(result, static_cast(-928601007)); -} - -void TestVolume::testLargeVolumeDirectAccessAllInternalBackwards() -{ - int32_t result = 0; - QBENCHMARK - { - result = testDirectAccessWithWrappingBackwards(m_pLargeVolume, 4, 2, 2, -3, -1, -2); - } - QCOMPARE(result, static_cast(-269366578)); -} - -void TestVolume::testLargeVolumeSamplersAllInternalBackwards() -{ - int32_t result = 0; - - QBENCHMARK - { - result = testSamplersWithWrappingBackwards(m_pLargeVolume, 4, 2, 2, -3, -1, -2); - } - QCOMPARE(result, static_cast(-269366578)); -} - -void TestVolume::testLargeVolumeDirectAccessWithExternalBackwards() -{ - int32_t result = 0; - QBENCHMARK - { - result = testDirectAccessWithWrappingBackwards(m_pLargeVolume, -1, -3, -2, 2, 5, 4); - } - QCOMPARE(result, static_cast(-769775893)); -} - -void TestVolume::testLargeVolumeSamplersWithExternalBackwards() -{ - int32_t result = 0; - - QBENCHMARK - { - result = testSamplersWithWrappingBackwards(m_pLargeVolume, -1, -3, -2, 2, 5, 4); + result = testSamplersWithWrappingBackwards(m_pPagedVolume, -1, -3, -2, 2, 5, 4); } QCOMPARE(result, static_cast(-769775893)); } diff --git a/tests/testvolume.h b/tests/testvolume.h index 57390641..ea1a1d0b 100644 --- a/tests/testvolume.h +++ b/tests/testvolume.h @@ -37,7 +37,7 @@ public: ~TestVolume(); private slots: - /*void testRawVolumeDirectAccessAllInternalForwards(); + void testRawVolumeDirectAccessAllInternalForwards(); void testRawVolumeSamplersAllInternalForwards(); void testRawVolumeDirectAccessWithExternalForwards(); void testRawVolumeSamplersWithExternalForwards(); @@ -46,31 +46,20 @@ private slots: void testRawVolumeDirectAccessWithExternalBackwards(); void testRawVolumeSamplersWithExternalBackwards(); - void testSimpleVolumeDirectAccessAllInternalForwards(); - void testSimpleVolumeSamplersAllInternalForwards(); - void testSimpleVolumeDirectAccessWithExternalForwards(); - void testSimpleVolumeSamplersWithExternalForwards(); - void testSimpleVolumeDirectAccessAllInternalBackwards(); - void testSimpleVolumeSamplersAllInternalBackwards(); - void testSimpleVolumeDirectAccessWithExternalBackwards(); - void testSimpleVolumeSamplersWithExternalBackwards();*/ - - void testLargeVolumeDirectAccessAllInternalForwards(); - void testLargeVolumeSamplersAllInternalForwards(); - void testLargeVolumeDirectAccessWithExternalForwards(); - void testLargeVolumeSamplersWithExternalForwards(); - void testLargeVolumeDirectAccessAllInternalBackwards(); - void testLargeVolumeSamplersAllInternalBackwards(); - void testLargeVolumeDirectAccessWithExternalBackwards(); - void testLargeVolumeSamplersWithExternalBackwards(); + void testPagedVolumeDirectAccessAllInternalForwards(); + void testPagedVolumeSamplersAllInternalForwards(); + void testPagedVolumeDirectAccessWithExternalForwards(); + void testPagedVolumeSamplersWithExternalForwards(); + void testPagedVolumeDirectAccessAllInternalBackwards(); + void testPagedVolumeSamplersAllInternalBackwards(); + void testPagedVolumeDirectAccessWithExternalBackwards(); + void testPagedVolumeSamplersWithExternalBackwards(); private: - PolyVox::BlockCompressor* m_pBlockCompressor; PolyVox::FilePager* m_pFilePager; PolyVox::RawVolume* m_pRawVolume; - PolyVox::SimpleVolume* m_pSimpleVolume; - PolyVox::LargeVolume* m_pLargeVolume; + PolyVox::PagedVolume* m_pPagedVolume; }; #endif From 880dcd8645f21eb9638c74bfc0ffceb01c5a50ba Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 17:17:18 +0200 Subject: [PATCH 218/259] Fixed incorrect messages about temp files not being deleted. --- examples/OpenGL/main.cpp | 2 +- library/PolyVoxCore/include/PolyVoxCore/FilePager.h | 11 +++++++++-- tests/TestSurfaceExtractor.cpp | 4 ++-- tests/testvolume.cpp | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 1c51f511..9a36fac8 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -50,7 +50,7 @@ const int32_t g_uVolumeSideLength = 128; int main(int argc, char *argv[]) { - FilePager* pager = new FilePager("./"); + FilePager* pager = new FilePager("."); LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); //Make our volume contain a sphere in the center. diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 8e3e36ed..6f466204 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -46,10 +46,17 @@ namespace PolyVox { public: /// Constructor - FilePager(const std::string& strFolderName) + FilePager(const std::string& strFolderName = ".") :Pager() ,m_strFolderName(strFolderName) { + // Add the trailing slash, assuming the user dind't already do it. + if ((m_strFolderName.back() != '/') && (m_strFolderName.back() != '\\')) + { + m_strFolderName.append("/"); + } + + // Build a unique prefix to avoid multiple pagers using the same filenames. srand(static_cast(time(0))); int iRandomValue = rand(); @@ -63,7 +70,7 @@ namespace PolyVox { for(std::vector::iterator iter = m_vecCreatedFiles.begin(); iter < m_vecCreatedFiles.end(); iter++) { - POLYVOX_LOG_WARNING_IF(!std::remove(iter->c_str()), "Failed to delete '" << *iter << "' when destroying FilePager"); + POLYVOX_LOG_WARNING_IF(std::remove(iter->c_str()) != 0, "Failed to delete '" << *iter << "' when destroying FilePager"); } m_vecCreatedFiles.clear(); diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index fc7f92ba..599281bb 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -102,7 +102,7 @@ VolumeType* createAndFillVolume(void) { const int32_t uVolumeSideLength = 64; - FilePager* pager = new FilePager("./"); + FilePager* pager = new FilePager("."); //Create empty volume VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); @@ -139,7 +139,7 @@ float randomFloat(float a, float b) template VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) { - FilePager* pager = new FilePager("./"); + FilePager* pager = new FilePager("."); //Create empty volume VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 4007c6ed..a8f8202b 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -269,7 +269,7 @@ TestVolume::TestVolume() { Region region(-57, -31, 12, 64, 96, 131); // Deliberatly awkward size - m_pFilePager = new FilePager("./"); + m_pFilePager = new FilePager("."); //Create the volumes m_pRawVolume = new RawVolume(region); From ede35435a0a8d046185b16215a3559352cdf7e8b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 17:26:57 +0200 Subject: [PATCH 219/259] Renamed UncompressedBlock to Chunk. --- examples/Paging/main.cpp | 6 +- library/PolyVoxCore/CMakeLists.txt | 4 +- .../{UncompressedBlock.h => Chunk.h} | 18 ++--- .../{UncompressedBlock.inl => Chunk.inl} | 20 ++--- .../include/PolyVoxCore/FilePager.h | 4 +- .../include/PolyVoxCore/PagedVolume.h | 10 +-- .../include/PolyVoxCore/PagedVolume.inl | 78 +++++++++---------- .../PolyVoxCore/PagedVolumeSampler.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 6 +- 9 files changed, 74 insertions(+), 74 deletions(-) rename library/PolyVoxCore/include/PolyVoxCore/{UncompressedBlock.h => Chunk.h} (83%) rename library/PolyVoxCore/include/PolyVoxCore/{UncompressedBlock.inl => Chunk.inl} (85%) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index d9359087..576bfb67 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,11 +90,11 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const PolyVox::Region& region, Chunk* pBlockData) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... - //UncompressedBlock block(256); + //Chunk block(256); Perlin perlin(2,2,1,234); @@ -143,7 +143,7 @@ public: //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, UncompressedBlock* /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, Chunk* /*pBlockData*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 4e18c75e..286f5e14 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -38,6 +38,8 @@ SET(CORE_INC_FILES include/PolyVoxCore/BaseVolume.h include/PolyVoxCore/BaseVolume.inl include/PolyVoxCore/BaseVolumeSampler.inl + include/PolyVoxCore/Chunk.h + include/PolyVoxCore/Chunk.inl include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -72,8 +74,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/Raycast.inl include/PolyVoxCore/Region.h include/PolyVoxCore/SimpleVolume.h - include/PolyVoxCore/UncompressedBlock.h - include/PolyVoxCore/UncompressedBlock.inl include/PolyVoxCore/Vector.h include/PolyVoxCore/Vector.inl include/PolyVoxCore/Vertex.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h similarity index 83% rename from library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h rename to library/PolyVoxCore/include/PolyVoxCore/Chunk.h index abc3ca63..4f92e458 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h @@ -21,8 +21,8 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#ifndef __PolyVox_UncompressedBlock_H__ -#define __PolyVox_UncompressedBlock_H__ +#ifndef __PolyVox_Chunk_H__ +#define __PolyVox_Chunk_H__ #include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxCore/Vector.h" @@ -30,13 +30,13 @@ freely, subject to the following restrictions: namespace PolyVox { template - class UncompressedBlock + class Chunk { friend class PagedVolume; public: - UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); - ~UncompressedBlock(); + Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); + ~Chunk(); VoxelType* getData(void) const; uint32_t getDataSizeInBytes(void) const; @@ -49,10 +49,10 @@ namespace PolyVox private: /// Private copy constructor to prevent accisdental copying - UncompressedBlock(const UncompressedBlock& /*rhs*/) {}; + Chunk(const Chunk& /*rhs*/) {}; /// Private assignment operator to prevent accisdental copying - UncompressedBlock& operator=(const UncompressedBlock& /*rhs*/) {}; + Chunk& operator=(const Chunk& /*rhs*/) {}; // This is updated by the PagedVolume and used to discard the least recently used blocks. uint32_t m_uBlockLastAccessed; @@ -62,7 +62,7 @@ namespace PolyVox bool m_bDataModified; // Made this private for consistancy with CompressedBlock. - // Users shouldn't really need this for UncompressedBlock anyway. + // Users shouldn't really need this for Chunk anyway. uint32_t calculateSizeInBytes(void); static uint32_t calculateSizeInBytes(uint32_t uSideLength); @@ -74,6 +74,6 @@ namespace PolyVox }; } -#include "PolyVoxCore/UncompressedBlock.inl" +#include "PolyVoxCore/Chunk.inl" #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl similarity index 85% rename from library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl rename to library/PolyVoxCore/include/PolyVoxCore/Chunk.inl index 4e038024..ad8e255a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - UncompressedBlock::UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) + Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) :m_uBlockLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) @@ -65,7 +65,7 @@ namespace PolyVox } template - UncompressedBlock::~UncompressedBlock() + Chunk::~Chunk() { if (m_pPager && m_bDataModified) { @@ -82,19 +82,19 @@ namespace PolyVox } template - VoxelType* UncompressedBlock::getData(void) const + VoxelType* Chunk::getData(void) const { return m_tData; } template - uint32_t UncompressedBlock::getDataSizeInBytes(void) const + uint32_t Chunk::getDataSizeInBytes(void) const { return m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType); } template - VoxelType UncompressedBlock::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const + VoxelType Chunk::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -112,13 +112,13 @@ namespace PolyVox } template - VoxelType UncompressedBlock::getVoxel(const Vector3DUint16& v3dPos) const + VoxelType Chunk::getVoxel(const Vector3DUint16& v3dPos) const { return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); } template - void UncompressedBlock::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) + void Chunk::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -138,20 +138,20 @@ namespace PolyVox } template - void UncompressedBlock::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) + void Chunk::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) { setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } template - uint32_t UncompressedBlock::calculateSizeInBytes(void) + uint32_t Chunk::calculateSizeInBytes(void) { // Call through to the static version return calculateSizeInBytes(m_uSideLength); } template - uint32_t UncompressedBlock::calculateSizeInBytes(uint32_t uSideLength) + uint32_t Chunk::calculateSizeInBytes(uint32_t uSideLength) { // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 6f466204..83ae5047 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -76,7 +76,7 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const Region& region, Chunk* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); @@ -120,7 +120,7 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) + virtual void pageOut(const Region& region, Chunk* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 4c08721c..215f2349 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" -#include "PolyVoxCore/UncompressedBlock.h" +#include "PolyVoxCore/Chunk.h" #include "PolyVoxCore/Vector.h" #include @@ -285,8 +285,8 @@ namespace PolyVox private: - typedef std::unordered_map > > SharedPtrBlockMap; - typedef std::unordered_map > > WeakPtrBlockMap; + typedef std::unordered_map > > SharedPtrBlockMap; + typedef std::unordered_map > > WeakPtrBlockMap; void initialise(); @@ -298,7 +298,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + std::shared_ptr< Chunk > getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; void purgeNullPtrsFromAllBlocks(void) const; @@ -308,7 +308,7 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; - mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; + mutable std::shared_ptr< Chunk > m_pLastAccessedBlock; uint32_t m_uBlockCountLimit; // The size of the volume diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 07c0e23e..56a8f36e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -82,9 +82,9 @@ namespace PolyVox m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); initialise(); } @@ -223,9 +223,9 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pChunk = getChunk(blockX, blockY, blockZ); - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + return pChunk->getVoxel(xOffset, yOffset, zOffset); } else { @@ -247,7 +247,7 @@ namespace PolyVox /// Increasing the size of the block cache will increase memory but may improve performance. /// You may want to set this to a large value (e.g. 1024) when you are first loading your /// volume data and then set it to a smaller value (e.g.64) for general processing. - /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. + /// \param uMaxNumberOfChunks The number of blocks for which uncompressed data can be cached. //////////////////////////////////////////////////////////////////////////////// template void PagedVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) @@ -255,8 +255,8 @@ namespace PolyVox POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); // Calculate the number of blocks based on the memory limit and the size of each block. - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + m_uBlockCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " @@ -270,8 +270,8 @@ namespace PolyVox flushAll(); } - POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -307,8 +307,8 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + auto pChunk = getChunk(blockX, blockY, blockZ); + pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); } //////////////////////////////////////////////////////////////////////////////// @@ -344,9 +344,9 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pChunk = getChunk(blockX, blockY, blockZ); - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); //Return true to indicate that we modified a voxel. return true; @@ -397,7 +397,7 @@ namespace PolyVox { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { - getUncompressedBlock(x,y,z); + getChunk(x,y,z); } } } @@ -497,7 +497,7 @@ namespace PolyVox m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); - //setMaxNumberOfUncompressedBlocks(m_uBlockCountLimit); + //setMaxNumberOfChunks(m_uBlockCountLimit); //Clear the previous data m_pRecentlyUsedBlocks.clear(); @@ -509,7 +509,7 @@ namespace PolyVox } template - std::shared_ptr< UncompressedBlock > PagedVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const + std::shared_ptr< Chunk > PagedVolume::getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const { Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); @@ -523,45 +523,45 @@ namespace PolyVox } // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. - std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; - typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); + std::shared_ptr< Chunk > pChunk = nullptr; + typename SharedPtrBlockMap::iterator itChunk = m_pRecentlyUsedBlocks.find(v3dBlockPos); // Check whether the block was found. - if ((itUncompressedBlock) != m_pRecentlyUsedBlocks.end()) + if ((itChunk) != m_pRecentlyUsedBlocks.end()) { // The block was found so we can use it. - pUncompressedBlock = itUncompressedBlock->second; - POLYVOX_ASSERT(pUncompressedBlock, "Recent block list shold never contain a null pointer."); + pChunk = itChunk->second; + POLYVOX_ASSERT(pChunk, "Recent block list shold never contain a null pointer."); } - if (!pUncompressedBlock) + if (!pChunk) { // Although it's not in our recently use blocks, there's some (slim) chance that it // exists in the list of all loaded blocks, because a sampler may be holding on to it. - typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); - if (itWeakUncompressedBlock != m_pAllBlocks.end()) + typename WeakPtrBlockMap::iterator itWeakChunk = m_pAllBlocks.find(v3dBlockPos); + if (itWeakChunk != m_pAllBlocks.end()) { // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the // list, and it will get added again soon when we page it in and fill it with valid data. - if (itWeakUncompressedBlock->second.expired()) + if (itWeakChunk->second.expired()) { - m_pAllBlocks.erase(itWeakUncompressedBlock); + m_pAllBlocks.erase(itWeakChunk); } else { // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. - pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); } } } // If we still haven't found the block then it's time to create a new one and page it in from disk. - if (!pUncompressedBlock) + if (!pChunk) { // The block was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uBlockSideLength, m_pPager); // As we are loading a new block we should try to ensure we don't go over our target memory usage. bool erasedBlock = false; @@ -594,15 +594,15 @@ namespace PolyVox } // Add our new block to the maps. - m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); } - pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; - m_pLastAccessedBlock = pUncompressedBlock; + pChunk->m_uBlockLastAccessed = ++m_uTimestamper; + m_pLastAccessedBlock = pChunk; m_v3dLastAccessedBlockPos = v3dBlockPos; - return pUncompressedBlock; + return pChunk; } //////////////////////////////////////////////////////////////////////////////// @@ -616,7 +616,7 @@ namespace PolyVox // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. - return UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); + return Chunk::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); } template @@ -692,8 +692,8 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + auto pChunk = getChunk(blockX, blockY, blockZ); + return pChunk->getVoxel(xOffset, yOffset, zOffset); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index 5c55e8ae..d6f38554 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -119,7 +119,7 @@ namespace PolyVox uYPosInBlock * this->mVolume->m_uBlockSideLength + uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - auto pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); + auto pUncompressedCurrentBlock = this->mVolume->getChunk(uXBlock, uYBlock, uZBlock); mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index 6b670302..f8edc620 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Pager_H__ #define __PolyVox_Pager_H__ -#include "PolyVoxCore/UncompressedBlock.h" +#include "PolyVoxCore/Chunk.h" #include "PolyVoxCore/Impl/TypeDef.h" #include @@ -43,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) = 0; - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) = 0; + virtual void pageIn(const Region& region, Chunk* pBlockData) = 0; + virtual void pageOut(const Region& region, Chunk* pBlockData) = 0; }; } From 8d7d88a7df90e6a13c50f0a73bb9e59568334dc1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 17:39:12 +0200 Subject: [PATCH 220/259] Renamed a bunch of stuff from using 'block' to 'chunk' --- examples/Paging/main.cpp | 8 +- .../PolyVoxCore/include/PolyVoxCore/Chunk.h | 4 +- .../PolyVoxCore/include/PolyVoxCore/Chunk.inl | 20 +-- .../include/PolyVoxCore/FilePager.h | 18 +- .../include/PolyVoxCore/PagedVolume.h | 20 +-- .../include/PolyVoxCore/PagedVolume.inl | 160 +++++++++--------- .../PolyVoxCore/PagedVolumeSampler.inl | 96 +++++------ .../PolyVoxCore/include/PolyVoxCore/Pager.h | 4 +- 8 files changed, 165 insertions(+), 165 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 576bfb67..b111a6bf 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,7 +90,7 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, Chunk* pBlockData) + virtual void pageIn(const PolyVox::Region& region, Chunk* pChunk) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... @@ -132,18 +132,18 @@ public: // Voxel position within a block always start from zero. So if a block represents region (4, 8, 12) to (11, 19, 15) // then the valid block voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the // region from the volume space position in order to get the block space position. - pBlockData->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); + pChunk->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); } } } // Now compress the computed data into the provided block. //RLEBlockCompressor* compressor = new RLEBlockCompressor(); - //compressor->compress(&block, pBlockData); + //compressor->compress(&block, pChunk); //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, Chunk* /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, Chunk* /*pChunk*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h index 4f92e458..69df02b3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h @@ -55,7 +55,7 @@ namespace PolyVox Chunk& operator=(const Chunk& /*rhs*/) {}; // This is updated by the PagedVolume and used to discard the least recently used blocks. - uint32_t m_uBlockLastAccessed; + uint32_t m_uChunkLastAccessed; // This is so we can tell whether a uncompressed block has to be recompressed and whether // a compressed block has to be paged back to disk, or whether they can just be discarded. @@ -70,7 +70,7 @@ namespace PolyVox uint16_t m_uSideLength; uint8_t m_uSideLengthPower; Pager* m_pPager; - Vector3DInt32 m_v3dBlockSpacePosition; + Vector3DInt32 m_v3dChunkSpacePosition; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl index ad8e255a..16440c7b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl @@ -27,13 +27,13 @@ namespace PolyVox { template Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) - :m_uBlockLastAccessed(0) + :m_uChunkLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) ,m_uSideLength(0) ,m_uSideLengthPower(0) ,m_pPager(pPager) - ,m_v3dBlockSpacePosition(v3dPosition) + ,m_v3dChunkSpacePosition(v3dPosition) { // Compute the side length m_uSideLength = uSideLength; @@ -47,7 +47,7 @@ namespace PolyVox if (m_pPager) { // From the coordinates of the block we deduce the coordinates of the contained voxels. - Vector3DInt32 v3dLower = m_v3dBlockSpacePosition * static_cast(m_uSideLength); + Vector3DInt32 v3dLower = m_v3dChunkSpacePosition * static_cast(m_uSideLength); Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); Region reg(v3dLower, v3dUpper); @@ -70,7 +70,7 @@ namespace PolyVox if (m_pPager && m_bDataModified) { // From the coordinates of the block we deduce the coordinates of the contained voxels. - Vector3DInt32 v3dLower = m_v3dBlockSpacePosition * static_cast(m_uSideLength); + Vector3DInt32 v3dLower = m_v3dChunkSpacePosition * static_cast(m_uSideLength); Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); // Page the data out @@ -98,9 +98,9 @@ namespace PolyVox { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. - POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the block"); - POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the block"); - POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the block"); + POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the chunk"); + POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the chunk"); + POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(m_tData, "No uncompressed data - block must be decompressed before accessing voxels."); return m_tData @@ -122,9 +122,9 @@ namespace PolyVox { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. - POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the block"); - POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the block"); - POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the block"); + POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the chunk"); + POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the chunk"); + POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(m_tData, "No uncompressed data - block must be decompressed before accessing voxels."); m_tData diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 83ae5047..671023cc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -76,10 +76,10 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, Chunk* pBlockData) + virtual void pageIn(const Region& region, Chunk* pChunk) { - POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); - //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); + POLYVOX_ASSERT(pChunk, "Attempting to page in NULL block"); + //POLYVOX_ASSERT(pChunk->hasUncompressedData() == false, "Block should not have uncompressed data"); std::stringstream ssFilename; ssFilename << m_strFolderName << "/" << m_strRandomPrefix << "-" @@ -102,10 +102,10 @@ namespace PolyVox uint8_t* buffer = new uint8_t[fileSizeInBytes]; fread(buffer, sizeof(uint8_t), fileSizeInBytes, pFile); - pBlockData->setData(buffer, fileSizeInBytes); + pChunk->setData(buffer, fileSizeInBytes); delete[] buffer;*/ - fread(pBlockData->getData(), sizeof(uint8_t), pBlockData->getDataSizeInBytes(), pFile); + fread(pChunk->getData(), sizeof(uint8_t), pChunk->getDataSizeInBytes(), pFile); if(ferror(pFile)) { @@ -120,10 +120,10 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, Chunk* pBlockData) + virtual void pageOut(const Region& region, Chunk* pChunk) { - POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); - //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); + POLYVOX_ASSERT(pChunk, "Attempting to page out NULL block"); + //POLYVOX_ASSERT(pChunk->hasUncompressedData() == false, "Block should not have uncompressed data"); POLYVOX_LOG_TRACE("Paging out data for " << region); @@ -146,7 +146,7 @@ namespace PolyVox //The file has been created, so add it to the list to delete on shutdown. m_vecCreatedFiles.push_back(filename); - fwrite(pBlockData->getData(), sizeof(uint8_t), pBlockData->getDataSizeInBytes(), pFile); + fwrite(pChunk->getData(), sizeof(uint8_t), pChunk->getDataSizeInBytes(), pFile); if(ferror(pFile)) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 215f2349..de85418e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -234,7 +234,7 @@ namespace PolyVox ( const Region& regValid, Pager* pPager = nullptr, - uint16_t uBlockSideLength = 32 + uint16_t uChunkSideLength = 32 ); /// Destructor ~PagedVolume(); @@ -285,8 +285,8 @@ namespace PolyVox private: - typedef std::unordered_map > > SharedPtrBlockMap; - typedef std::unordered_map > > WeakPtrBlockMap; + typedef std::unordered_map > > SharedPtrChunkMap; + typedef std::unordered_map > > WeakPtrChunkMap; void initialise(); @@ -300,23 +300,23 @@ namespace PolyVox std::shared_ptr< Chunk > getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; - void purgeNullPtrsFromAllBlocks(void) const; + void purgeNullPtrsFromAllChunks(void) const; // The block data - mutable WeakPtrBlockMap m_pAllBlocks; - mutable SharedPtrBlockMap m_pRecentlyUsedBlocks; + mutable WeakPtrChunkMap m_pAllChunks; + mutable SharedPtrChunkMap m_pRecentlyUsedChunks; mutable uint32_t m_uTimestamper; - mutable Vector3DInt32 m_v3dLastAccessedBlockPos; - mutable std::shared_ptr< Chunk > m_pLastAccessedBlock; + mutable Vector3DInt32 m_v3dLastAccessedChunkPos; + mutable std::shared_ptr< Chunk > m_pLastAccessedChunk; uint32_t m_uBlockCountLimit; // The size of the volume Region m_regValidRegionInBlocks; // The size of the blocks - uint16_t m_uBlockSideLength; - uint8_t m_uBlockSideLengthPower; + uint16_t m_uChunkSideLength; + uint8_t m_uChunkSideLengthPower; Pager* m_pPager; diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 56a8f36e..48763014 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -35,18 +35,18 @@ namespace PolyVox /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory. /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. /// \param bPagingEnabled Controls whether or not paging is enabled for this PagedVolume. - /// \param uBlockSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. + /// \param uChunkSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. //////////////////////////////////////////////////////////////////////////////// template PagedVolume::PagedVolume ( const Region& regValid, Pager* pPager, - uint16_t uBlockSideLength + uint16_t uChunkSideLength ) :BaseVolume(regValid) { - m_uBlockSideLength = uBlockSideLength; + m_uChunkSideLength = uChunkSideLength; m_pPager = pPager; if (m_pPager) @@ -65,8 +65,8 @@ namespace PolyVox uint32_t longestSide = (std::max)(regValid.getWidthInVoxels(), (std::max)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); uint32_t shortestSide = (std::min)(regValid.getWidthInVoxels(), (std::min)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); - longestSide /= m_uBlockSideLength; - shortestSide /= m_uBlockSideLength; + longestSide /= m_uChunkSideLength; + shortestSide /= m_uChunkSideLength; m_uBlockCountLimit = longestSide * shortestSide; } @@ -82,7 +82,7 @@ namespace PolyVox m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); @@ -215,13 +215,13 @@ namespace PolyVox { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + const int32_t blockX = uXPos >> m_uChunkSideLengthPower; + const int32_t blockY = uYPos >> m_uChunkSideLengthPower; + const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); auto pChunk = getChunk(blockX, blockY, blockZ); @@ -255,7 +255,7 @@ namespace PolyVox POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); // Calculate the number of blocks based on the memory limit and the size of each block. - uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); m_uBlockCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. @@ -265,7 +265,7 @@ namespace PolyVox m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); // If the new limit is less than the number of blocks already loaded then the easiest solution is to flush and start loading again. - if (m_pRecentlyUsedBlocks.size() > m_uBlockCountLimit) + if (m_pRecentlyUsedChunks.size() > m_uBlockCountLimit) { flushAll(); } @@ -299,13 +299,13 @@ namespace PolyVox } } - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + const int32_t blockX = uXPos >> m_uChunkSideLengthPower; + const int32_t blockY = uYPos >> m_uChunkSideLengthPower; + const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); auto pChunk = getChunk(blockX, blockY, blockZ); pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); @@ -336,13 +336,13 @@ namespace PolyVox // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + const int32_t blockX = uXPos >> m_uChunkSideLengthPower; + const int32_t blockY = uYPos >> m_uChunkSideLengthPower; + const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); auto pChunk = getChunk(blockX, blockY, blockZ); @@ -375,13 +375,13 @@ namespace PolyVox Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { - v3dStart.setElement(i, regPrefetch.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); + v3dStart.setElement(i, regPrefetch.getLowerCorner().getElement(i) >> m_uChunkSideLengthPower); } Vector3DInt32 v3dEnd; for(int i = 0; i < 3; i++) { - v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); + v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uChunkSideLengthPower); } // Ensure we don't page in more blocks than the volume can hold. @@ -412,16 +412,16 @@ namespace PolyVox POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); // Clear this pointer so it doesn't hang on to any blocks. - m_pLastAccessedBlock = nullptr; + m_pLastAccessedChunk = nullptr; // Erase all the most recently used blocks. - m_pRecentlyUsedBlocks.clear(); + m_pRecentlyUsedChunks.clear(); // Remove deleted blocks from the list of all loaded blocks. - purgeNullPtrsFromAllBlocks(); + purgeNullPtrsFromAllChunks(); // If there are still some blocks left then this is a cause for concern. Perhaps samplers are holding on to them? - POLYVOX_LOG_WARNING_IF(m_pAllBlocks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); + POLYVOX_LOG_WARNING_IF(m_pAllChunks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); } //////////////////////////////////////////////////////////////////////////////// @@ -433,19 +433,19 @@ namespace PolyVox POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); // Clear this pointer so it doesn't hang on to any blocks. - m_pLastAccessedBlock = nullptr; + m_pLastAccessedChunk = nullptr; // Convert the start and end positions into block space coordinates Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { - v3dStart.setElement(i, regFlush.getLowerCorner().getElement(i) >> m_uBlockSideLengthPower); + v3dStart.setElement(i, regFlush.getLowerCorner().getElement(i) >> m_uChunkSideLengthPower); } Vector3DInt32 v3dEnd; for(int i = 0; i < 3; i++) { - v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uBlockSideLengthPower); + v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uChunkSideLengthPower); } // Loops over the specified positions and delete the corresponding blocks. @@ -455,13 +455,13 @@ namespace PolyVox { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { - m_pRecentlyUsedBlocks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedBlock = 0; + m_pRecentlyUsedChunks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedChunk = 0; } } } // We might now have so null pointers in the 'all blocks' list so clean them up. - purgeNullPtrsFromAllBlocks(); + purgeNullPtrsFromAllChunks(); } //////////////////////////////////////////////////////////////////////////////// @@ -471,12 +471,12 @@ namespace PolyVox void PagedVolume::initialise() { //Validate parameters - if(m_uBlockSideLength == 0) + if(m_uChunkSideLength == 0) { POLYVOX_THROW(std::invalid_argument, "Block side length cannot be zero."); } - if(!isPowerOf2(m_uBlockSideLength)) + if(!isPowerOf2(m_uChunkSideLength)) { POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); } @@ -484,23 +484,23 @@ namespace PolyVox m_uTimestamper = 0; //m_uBlockCountLimit = 16; //m_uMaxNumberOfBlocksInMemory = 1024; - m_v3dLastAccessedBlockPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedBlock pointer will be null; - m_pLastAccessedBlock = 0; + m_v3dLastAccessedChunkPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedChunk pointer will be null; + m_pLastAccessedChunk = 0; //Compute the block side length - m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); + m_uChunkSideLengthPower = logBase2(m_uChunkSideLength); - m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); - m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uChunkSideLengthPower); + m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uChunkSideLengthPower); + m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uChunkSideLengthPower); + m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uChunkSideLengthPower); + m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uChunkSideLengthPower); + m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uChunkSideLengthPower); //setMaxNumberOfChunks(m_uBlockCountLimit); //Clear the previous data - m_pRecentlyUsedBlocks.clear(); + m_pRecentlyUsedChunks.clear(); //Other properties we might find useful later this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); @@ -517,17 +517,17 @@ namespace PolyVox //the time stamp. If we updated it everytime then that would be every time we touched //a voxel, which would overflow a uint32_t and require us to use a uint64_t instead. //This check should also provide a significant speed boost as usually it is true. - if((v3dBlockPos == m_v3dLastAccessedBlockPos) && (m_pLastAccessedBlock != 0)) + if((v3dBlockPos == m_v3dLastAccessedChunkPos) && (m_pLastAccessedChunk != 0)) { - return m_pLastAccessedBlock; + return m_pLastAccessedChunk; } // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. std::shared_ptr< Chunk > pChunk = nullptr; - typename SharedPtrBlockMap::iterator itChunk = m_pRecentlyUsedBlocks.find(v3dBlockPos); + typename SharedPtrChunkMap::iterator itChunk = m_pRecentlyUsedChunks.find(v3dBlockPos); // Check whether the block was found. - if ((itChunk) != m_pRecentlyUsedBlocks.end()) + if ((itChunk) != m_pRecentlyUsedChunks.end()) { // The block was found so we can use it. pChunk = itChunk->second; @@ -538,21 +538,21 @@ namespace PolyVox { // Although it's not in our recently use blocks, there's some (slim) chance that it // exists in the list of all loaded blocks, because a sampler may be holding on to it. - typename WeakPtrBlockMap::iterator itWeakChunk = m_pAllBlocks.find(v3dBlockPos); - if (itWeakChunk != m_pAllBlocks.end()) + typename WeakPtrChunkMap::iterator itWeakChunk = m_pAllChunks.find(v3dBlockPos); + if (itWeakChunk != m_pAllChunks.end()) { // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the // list, and it will get added again soon when we page it in and fill it with valid data. if (itWeakChunk->second.expired()) { - m_pAllBlocks.erase(itWeakChunk); + m_pAllChunks.erase(itWeakChunk); } else { // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); } } } @@ -561,28 +561,28 @@ namespace PolyVox if (!pChunk) { // The block was not found so we will create a new one. - pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uBlockSideLength, m_pPager); + pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uChunkSideLength, m_pPager); // As we are loading a new block we should try to ensure we don't go over our target memory usage. bool erasedBlock = false; - while (m_pRecentlyUsedBlocks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. + while (m_pRecentlyUsedChunks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. { // This should never hit, because it should not have been possible for // the user to limit the number of blocks if they did not provide a pager. POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of blocks"); // Find the least recently used block. Hopefully this isn't too slow. - typename SharedPtrBlockMap::iterator itUnloadBlock = m_pRecentlyUsedBlocks.begin(); - for (typename SharedPtrBlockMap::iterator i = m_pRecentlyUsedBlocks.begin(); i != m_pRecentlyUsedBlocks.end(); i++) + typename SharedPtrChunkMap::iterator itUnloadBlock = m_pRecentlyUsedChunks.begin(); + for (typename SharedPtrChunkMap::iterator i = m_pRecentlyUsedChunks.begin(); i != m_pRecentlyUsedChunks.end(); i++) { - if (i->second->m_uBlockLastAccessed < itUnloadBlock->second->m_uBlockLastAccessed) + if (i->second->m_uChunkLastAccessed < itUnloadBlock->second->m_uChunkLastAccessed) { itUnloadBlock = i; } } // Erase the least recently used block - m_pRecentlyUsedBlocks.erase(itUnloadBlock); + m_pRecentlyUsedChunks.erase(itUnloadBlock); erasedBlock = true; } @@ -590,17 +590,17 @@ namespace PolyVox // seems like a good place to purge the 'all blocks' list as well. if (erasedBlock) { - purgeNullPtrsFromAllBlocks(); + purgeNullPtrsFromAllChunks(); } // Add our new block to the maps. - m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pAllChunks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); } - pChunk->m_uBlockLastAccessed = ++m_uTimestamper; - m_pLastAccessedBlock = pChunk; - m_v3dLastAccessedBlockPos = v3dBlockPos; + pChunk->m_uChunkLastAccessed = ++m_uTimestamper; + m_pLastAccessedChunk = pChunk; + m_v3dLastAccessedChunkPos = v3dBlockPos; return pChunk; } @@ -612,21 +612,21 @@ namespace PolyVox uint32_t PagedVolume::calculateSizeInBytes(void) { // Purge null blocks so we know that all blocks are used. - purgeNullPtrsFromAllBlocks(); + purgeNullPtrsFromAllChunks(); // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. - return Chunk::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); + return Chunk::calculateSizeInBytes(m_uChunkSideLength) * m_pAllChunks.size(); } template - void PagedVolume::purgeNullPtrsFromAllBlocks(void) const + void PagedVolume::purgeNullPtrsFromAllChunks(void) const { - for (auto blockIter = m_pAllBlocks.begin(); blockIter != m_pAllBlocks.end();) + for (auto blockIter = m_pAllChunks.begin(); blockIter != m_pAllChunks.end();) { if (blockIter->second.expired()) { - blockIter = m_pAllBlocks.erase(blockIter); + blockIter = m_pAllChunks.erase(blockIter); } else { @@ -684,13 +684,13 @@ namespace PolyVox template VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const { - const int32_t blockX = uXPos >> m_uBlockSideLengthPower; - const int32_t blockY = uYPos >> m_uBlockSideLengthPower; - const int32_t blockZ = uZPos >> m_uBlockSideLengthPower; + const int32_t blockX = uXPos >> m_uChunkSideLengthPower; + const int32_t blockY = uYPos >> m_uChunkSideLengthPower; + const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uBlockSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); auto pChunk = getChunk(blockX, blockY, blockZ); return pChunk->getVoxel(xOffset, yOffset, zOffset); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index d6f38554..bd7b8d7f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -21,12 +21,12 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#define CAN_GO_NEG_X(val) ((val > this->mVolume->getEnclosingRegion().getLowerX()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_X(val) ((val < this->mVolume->getEnclosingRegion().getUpperX()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Y(val) ((val > this->mVolume->getEnclosingRegion().getLowerY()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Y(val) ((val < this->mVolume->getEnclosingRegion().getUpperY()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_NEG_Z(val) ((val > this->mVolume->getEnclosingRegion().getLowerZ()) && (val % this->mVolume->m_uBlockSideLength != 0)) -#define CAN_GO_POS_Z(val) ((val < this->mVolume->getEnclosingRegion().getUpperZ()) && ((val + 1) % this->mVolume->m_uBlockSideLength != 0)) +#define CAN_GO_NEG_X(val) ((val > this->mVolume->getEnclosingRegion().getLowerX()) && (val % this->mVolume->m_uChunkSideLength != 0)) +#define CAN_GO_POS_X(val) ((val < this->mVolume->getEnclosingRegion().getUpperX()) && ((val + 1) % this->mVolume->m_uChunkSideLength != 0)) +#define CAN_GO_NEG_Y(val) ((val > this->mVolume->getEnclosingRegion().getLowerY()) && (val % this->mVolume->m_uChunkSideLength != 0)) +#define CAN_GO_POS_Y(val) ((val < this->mVolume->getEnclosingRegion().getUpperY()) && ((val + 1) % this->mVolume->m_uChunkSideLength != 0)) +#define CAN_GO_NEG_Z(val) ((val > this->mVolume->getEnclosingRegion().getLowerZ()) && (val % this->mVolume->m_uChunkSideLength != 0)) +#define CAN_GO_POS_Z(val) ((val < this->mVolume->getEnclosingRegion().getUpperZ()) && ((val + 1) % this->mVolume->m_uChunkSideLength != 0)) namespace PolyVox { @@ -107,17 +107,17 @@ namespace PolyVox // Then we update the voxel pointer if(this->isCurrentPositionValid()) { - const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower; - const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower; + const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uChunkSideLengthPower; + const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uChunkSideLengthPower; + const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uChunkSideLengthPower; - const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower)); - const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower)); + const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uChunkSideLengthPower)); + const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uChunkSideLengthPower)); + const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uChunkSideLengthPower)); const uint32_t uVoxelIndexInBlock = uXPosInBlock + - uYPosInBlock * this->mVolume->m_uBlockSideLength + - uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + uYPosInBlock * this->mVolume->m_uChunkSideLength + + uZPosInBlock * this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; auto pUncompressedCurrentBlock = this->mVolume->getChunk(uXBlock, uYBlock, uZBlock); @@ -157,7 +157,7 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::movePositiveX(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. ++mCurrentVoxel; @@ -179,10 +179,10 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::movePositiveY(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength; + mCurrentVoxel += this->mVolume->m_uChunkSideLength; } else { @@ -201,10 +201,10 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::movePositiveZ(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. - mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + mCurrentVoxel += this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; } else { @@ -223,7 +223,7 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::moveNegativeX(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. --mCurrentVoxel; @@ -245,10 +245,10 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::moveNegativeY(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength; + mCurrentVoxel -= this->mVolume->m_uChunkSideLength; } else { @@ -267,10 +267,10 @@ namespace PolyVox BaseVolume::template Sampler< PagedVolume >::moveNegativeZ(); // Then we update the voxel pointer - if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uBlockSideLength != 0)) + if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new block. - mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; + mCurrentVoxel -= this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; } else { @@ -284,7 +284,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 - this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -294,7 +294,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 - this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -304,7 +304,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 - this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -314,7 +314,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -334,7 +334,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -344,7 +344,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 + this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -354,7 +354,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 + this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -364,7 +364,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - 1 + this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -376,7 +376,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -386,7 +386,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -396,7 +396,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -406,7 +406,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -426,7 +426,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -436,7 +436,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -446,7 +446,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -456,7 +456,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -468,7 +468,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 - this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -478,7 +478,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 - this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -488,7 +488,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 - this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -498,7 +498,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -518,7 +518,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } @@ -528,7 +528,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 + this->mVolume->m_uChunkSideLength - this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); } @@ -538,7 +538,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 + this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); } @@ -548,7 +548,7 @@ namespace PolyVox { if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) { - return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength); + return *(mCurrentVoxel + 1 + this->mVolume->m_uChunkSideLength + this->mVolume->m_uChunkSideLength*this->mVolume->m_uChunkSideLength); } return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index f8edc620..39d016bb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -43,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, Chunk* pBlockData) = 0; - virtual void pageOut(const Region& region, Chunk* pBlockData) = 0; + virtual void pageIn(const Region& region, Chunk* pChunk) = 0; + virtual void pageOut(const Region& region, Chunk* pChunk) = 0; }; } From f3a18befad765ee4b518e1bc0a2755302d212246 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 21:17:21 +0200 Subject: [PATCH 221/259] More renaming of 'block' to 'chunk' --- .../MarchingCubesSurfaceExtractor.inl | 1 - .../include/PolyVoxCore/PagedVolume.inl | 65 +++++++++---------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index acd0f77b..4c2402cf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -50,7 +50,6 @@ namespace PolyVox const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; - const uint32_t arraySizes[2]= {uArrayWidth, uArrayHeight}; // Array dimensions //For edge indices Array2DInt32 m_pPreviousVertexIndicesX(uArrayWidth, uArrayHeight); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 48763014..8db258d7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -31,7 +31,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// /// This constructor creates a volume with a fixed size which is specified as a parameter. By default this constructor will not enable paging but you can override this if desired. If you do wish to enable paging then you are required to provide the call back function (see the other PagedVolume constructor). /// \param regValid Specifies the minimum and maximum valid voxel positions. - /// \param pBlockCompressor An implementation of the Compressor interface which is used to compress blocks in memory. /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory. /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. /// \param bPagingEnabled Controls whether or not paging is enabled for this PagedVolume. @@ -215,15 +214,15 @@ namespace PolyVox { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) { - const int32_t blockX = uXPos >> m_uChunkSideLengthPower; - const int32_t blockY = uYPos >> m_uChunkSideLengthPower; - const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - auto pChunk = getChunk(blockX, blockY, blockZ); + auto pChunk = getChunk(chunkX, chunkY, chunkZ); return pChunk->getVoxel(xOffset, yOffset, zOffset); } @@ -299,15 +298,15 @@ namespace PolyVox } } - const int32_t blockX = uXPos >> m_uChunkSideLengthPower; - const int32_t blockY = uYPos >> m_uChunkSideLengthPower; - const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - auto pChunk = getChunk(blockX, blockY, blockZ); + auto pChunk = getChunk(chunkX, chunkY, chunkZ); pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); } @@ -336,15 +335,15 @@ namespace PolyVox // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); - const int32_t blockX = uXPos >> m_uChunkSideLengthPower; - const int32_t blockY = uYPos >> m_uChunkSideLengthPower; - const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - auto pChunk = getChunk(blockX, blockY, blockZ); + auto pChunk = getChunk(chunkX, chunkY, chunkZ); pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); @@ -622,15 +621,15 @@ namespace PolyVox template void PagedVolume::purgeNullPtrsFromAllChunks(void) const { - for (auto blockIter = m_pAllChunks.begin(); blockIter != m_pAllChunks.end();) + for (auto chunkIter = m_pAllChunks.begin(); chunkIter != m_pAllChunks.end();) { - if (blockIter->second.expired()) + if (chunkIter->second.expired()) { - blockIter = m_pAllChunks.erase(blockIter); + chunkIter = m_pAllChunks.erase(chunkIter); } else { - blockIter++; + chunkIter++; } } } @@ -684,15 +683,15 @@ namespace PolyVox template VoxelType PagedVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const { - const int32_t blockX = uXPos >> m_uChunkSideLengthPower; - const int32_t blockY = uYPos >> m_uChunkSideLengthPower; - const int32_t blockZ = uZPos >> m_uChunkSideLengthPower; + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - const uint16_t xOffset = static_cast(uXPos - (blockX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (blockY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uChunkSideLengthPower)); + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - auto pChunk = getChunk(blockX, blockY, blockZ); + auto pChunk = getChunk(chunkX, chunkY, chunkZ); return pChunk->getVoxel(xOffset, yOffset, zOffset); } } From 0ab7f27f0f5b55873482b4522f4821d133d48565 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 21:27:26 +0200 Subject: [PATCH 222/259] More renaming of block to chunk. --- examples/Paging/main.cpp | 15 +-- .../PolyVoxCore/include/PolyVoxCore/Chunk.h | 8 +- .../PolyVoxCore/include/PolyVoxCore/Chunk.inl | 10 +- .../include/PolyVoxCore/FilePager.h | 14 +-- .../include/PolyVoxCore/PagedVolume.h | 32 +++---- .../include/PolyVoxCore/PagedVolume.inl | 96 +++++++++---------- .../PolyVoxCore/PagedVolumeSampler.inl | 24 ++--- .../include/PolyVoxCore/RawVolume.h | 2 +- 8 files changed, 95 insertions(+), 106 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index b111a6bf..6d140e2f 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -92,10 +92,6 @@ public: virtual void pageIn(const PolyVox::Region& region, Chunk* pChunk) { - // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy - // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... - //Chunk block(256); - Perlin perlin(2,2,1,234); for(int x = region.getLowerX(); x <= region.getUpperX(); x++) @@ -129,18 +125,13 @@ public: voxel.setDensity(MaterialDensityPair44::getMinDensity()); } - // Voxel position within a block always start from zero. So if a block represents region (4, 8, 12) to (11, 19, 15) - // then the valid block voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the - // region from the volume space position in order to get the block space position. + // Voxel position within a chunk always start from zero. So if a chunk represents region (4, 8, 12) to (11, 19, 15) + // then the valid chunk voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the + // region from the volume space position in order to get the chunk space position. pChunk->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); } } } - - // Now compress the computed data into the provided block. - //RLEBlockCompressor* compressor = new RLEBlockCompressor(); - //compressor->compress(&block, pChunk); - //delete compressor; } virtual void pageOut(const PolyVox::Region& region, Chunk* /*pChunk*/) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h index 69df02b3..1eeec066 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h @@ -54,15 +54,13 @@ namespace PolyVox /// Private assignment operator to prevent accisdental copying Chunk& operator=(const Chunk& /*rhs*/) {}; - // This is updated by the PagedVolume and used to discard the least recently used blocks. + // This is updated by the PagedVolume and used to discard the least recently used chunks. uint32_t m_uChunkLastAccessed; - // This is so we can tell whether a uncompressed block has to be recompressed and whether - // a compressed block has to be paged back to disk, or whether they can just be discarded. + // This is so we can tell whether a uncompressed chunk has to be recompressed and whether + // a compressed chunk has to be paged back to disk, or whether they can just be discarded. bool m_bDataModified; - // Made this private for consistancy with CompressedBlock. - // Users shouldn't really need this for Chunk anyway. uint32_t calculateSizeInBytes(void); static uint32_t calculateSizeInBytes(uint32_t uSideLength); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl index 16440c7b..49d25aeb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl @@ -43,10 +43,10 @@ namespace PolyVox const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength; m_tData = new VoxelType[uNoOfVoxels]; - // Pass the block to the Pager to give it a chance to initialise it with any data + // Pass the chunk to the Pager to give it a chance to initialise it with any data if (m_pPager) { - // From the coordinates of the block we deduce the coordinates of the contained voxels. + // From the coordinates of the chunk we deduce the coordinates of the contained voxels. Vector3DInt32 v3dLower = m_v3dChunkSpacePosition * static_cast(m_uSideLength); Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); Region reg(v3dLower, v3dUpper); @@ -69,7 +69,7 @@ namespace PolyVox { if (m_pPager && m_bDataModified) { - // From the coordinates of the block we deduce the coordinates of the contained voxels. + // From the coordinates of the chunk we deduce the coordinates of the contained voxels. Vector3DInt32 v3dLower = m_v3dChunkSpacePosition * static_cast(m_uSideLength); Vector3DInt32 v3dUpper = v3dLower + Vector3DInt32(m_uSideLength - 1, m_uSideLength - 1, m_uSideLength - 1); @@ -101,7 +101,7 @@ namespace PolyVox POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the chunk"); - POLYVOX_ASSERT(m_tData, "No uncompressed data - block must be decompressed before accessing voxels."); + POLYVOX_ASSERT(m_tData, "No uncompressed data - chunk must be decompressed before accessing voxels."); return m_tData [ @@ -125,7 +125,7 @@ namespace PolyVox POLYVOX_ASSERT(uXPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(uYPos < m_uSideLength, "Supplied position is outside of the chunk"); POLYVOX_ASSERT(uZPos < m_uSideLength, "Supplied position is outside of the chunk"); - POLYVOX_ASSERT(m_tData, "No uncompressed data - block must be decompressed before accessing voxels."); + POLYVOX_ASSERT(m_tData, "No uncompressed data - chunk must be decompressed before accessing voxels."); m_tData [ diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 671023cc..26f20c21 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -78,8 +78,8 @@ namespace PolyVox virtual void pageIn(const Region& region, Chunk* pChunk) { - POLYVOX_ASSERT(pChunk, "Attempting to page in NULL block"); - //POLYVOX_ASSERT(pChunk->hasUncompressedData() == false, "Block should not have uncompressed data"); + POLYVOX_ASSERT(pChunk, "Attempting to page in NULL chunk"); + POLYVOX_ASSERT(pChunk->getData() == false, "Chunk must have valid data"); std::stringstream ssFilename; ssFilename << m_strFolderName << "/" << m_strRandomPrefix << "-" @@ -109,7 +109,7 @@ namespace PolyVox if(ferror(pFile)) { - POLYVOX_THROW(std::runtime_error, "Error reading in block data, even though a file exists."); + POLYVOX_THROW(std::runtime_error, "Error reading in chunk data, even though a file exists."); } fclose(pFile); @@ -122,8 +122,8 @@ namespace PolyVox virtual void pageOut(const Region& region, Chunk* pChunk) { - POLYVOX_ASSERT(pChunk, "Attempting to page out NULL block"); - //POLYVOX_ASSERT(pChunk->hasUncompressedData() == false, "Block should not have uncompressed data"); + POLYVOX_ASSERT(pChunk, "Attempting to page out NULL chunk"); + POLYVOX_ASSERT(pChunk->getData() == false, "Chunk must have valid data"); POLYVOX_LOG_TRACE("Paging out data for " << region); @@ -140,7 +140,7 @@ namespace PolyVox FILE* pFile = fopen(filename.c_str(), "wb"); if(!pFile) { - POLYVOX_THROW(std::runtime_error, "Unable to open file to write out block data."); + POLYVOX_THROW(std::runtime_error, "Unable to open file to write out chunk data."); } //The file has been created, so add it to the list to delete on shutdown. @@ -150,7 +150,7 @@ namespace PolyVox if(ferror(pFile)) { - POLYVOX_THROW(std::runtime_error, "Error writing out block data."); + POLYVOX_THROW(std::runtime_error, "Error writing out chunk data."); } fclose(pFile); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index de85418e..bc5ebb3e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -80,14 +80,14 @@ namespace PolyVox /// 1 byte per voxel will require 1GB of memory if stored in an uncompressed form. Natuarally our PagedVolume class is much more efficient /// than this and it is worth understanding (at least at a high level) the approach which is used. /// - /// Essentially, the PagedVolume class stores its data as a collection of blocks. Each of these block is much smaller than the whole volume, + /// Essentially, the PagedVolume class stores its data as a collection of chunks. Each of these chunk is much smaller than the whole volume, /// for example a typical size might be 32x32x32 voxels (though is is configurable by the user). In this case, a 256x512x1024 volume - /// would contain 8x16x32 = 4096 blocks. The data for each block is stored in a compressed form, which uses only a small amout of - /// memory but it is hard to modify the data. Therefore, before any given voxel can be modified, its corresponding block must be uncompressed. + /// would contain 8x16x32 = 4096 chunks. The data for each chunk is stored in a compressed form, which uses only a small amout of + /// memory but it is hard to modify the data. Therefore, before any given voxel can be modified, its corresponding chunk must be uncompressed. /// - /// The compression and decompression of block is a relatively slow process and so we aim to do this as rarely as possible. In order - /// to achive this, the volume class stores a cache of recently used blocks and their associated uncompressed data. Each time a voxel - /// is touched a timestamp is updated on the corresponding block. When the cache becomes full the block with the oldest timestamp is + /// The compression and decompression of chunk is a relatively slow process and so we aim to do this as rarely as possible. In order + /// to achive this, the volume class stores a cache of recently used chunks and their associated uncompressed data. Each time a voxel + /// is touched a timestamp is updated on the corresponding chunk. When the cache becomes full the chunk with the oldest timestamp is /// recompressed and moved out of the cache. /// /// Achieving high compression rates @@ -136,11 +136,11 @@ namespace PolyVox /// Cache-aware traversal /// --------------------- /// You might be suprised at just how many cache misses can occur when you traverse the volume in a naive manner. Consider a 1024x1024x1024 volume - /// with blocks of size 32x32x32. And imagine you iterate over this volume with a simple three-level for loop which iterates over x, the y, then z. + /// with chunks of size 32x32x32. And imagine you iterate over this volume with a simple three-level for loop which iterates over x, the y, then z. /// If you start at position (0,0,0) then ny the time you reach position (1023,0,0) you have touched 1024 voxels along one edge of the volume and - /// have pulled 32 blocks into the cache. By the time you reach (1023,1023,0) you have hit 1024x1024 voxels and pulled 32x32 blocks into the cache. - /// You are now ready to touch voxel (0,0,1) which is right nect to where you started, but unless your cache is at least 32x32 blocks large then this - /// initial block has already been cleared from the cache. + /// have pulled 32 chunks into the cache. By the time you reach (1023,1023,0) you have hit 1024x1024 voxels and pulled 32x32 chunks into the cache. + /// You are now ready to touch voxel (0,0,1) which is right nect to where you started, but unless your cache is at least 32x32 chunks large then this + /// initial chunk has already been cleared from the cache. /// /// Ensuring you have a large enough cache size can obviously help the above situation, but you might also consider iterating over the voxels in a /// different order. For example, if you replace your three-level loop with a six-level loop then you can first process all the voxels between (0,0,0) @@ -151,7 +151,7 @@ namespace PolyVox /// --------- /// The PagedVolume class does not make any guarentees about thread safety. You should ensure that all accesses are performed from the same thread. /// This is true even if you are only reading data from the volume, as concurrently reading from different threads can invalidate the contents - /// of the block cache (amoung other problems). + /// of the chunk cache (amoung other problems). //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template class PagedVolume : public BaseVolume @@ -256,7 +256,7 @@ namespace PolyVox /// Gets a voxel at the position given by a 3D vector POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - /// Sets the number of blocks for which uncompressed data is stored + /// Sets the number of chunks for which uncompressed data is stored void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); @@ -302,7 +302,7 @@ namespace PolyVox void purgeNullPtrsFromAllChunks(void) const; - // The block data + // The chunk data mutable WeakPtrChunkMap m_pAllChunks; mutable SharedPtrChunkMap m_pRecentlyUsedChunks; @@ -314,15 +314,15 @@ namespace PolyVox // The size of the volume Region m_regValidRegionInBlocks; - // The size of the blocks + // The size of the chunks uint16_t m_uChunkSideLength; uint8_t m_uChunkSideLengthPower; Pager* m_pPager; - // Enough to make sure a blocks and it's neighbours can be loaded, with a few to spare. + // Enough to make sure a chunks and it's neighbours can be loaded, with a few to spare. static const uint32_t uMinPracticalNoOfBlocks = 32; - // Should preent multi-gigabyte volumes with reasonable block sizes. + // Should preent multi-gigabyte volumes with reasonable chunk sizes. static const uint32_t uMaxPracticalNoOfBlocks = 32768; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 8db258d7..cd8654c8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -34,7 +34,7 @@ namespace PolyVox /// \param dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory. /// \param dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory. /// \param bPagingEnabled Controls whether or not paging is enabled for this PagedVolume. - /// \param uChunkSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. + /// \param uChunkSideLength The size of the chunks making up the volume. Small chunks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower. //////////////////////////////////////////////////////////////////////////////// template PagedVolume::PagedVolume @@ -51,15 +51,15 @@ namespace PolyVox if (m_pPager) { // If the user is creating a vast (almost infinite) volume then we can bet they will be - // expecting a high memory usage and will want a fair number of blocks to play around with. + // expecting a high memory usage and will want a fair number of chunks to play around with. if (regValid == Region::MaxRegion) { m_uBlockCountLimit = 1024; } else { - // Otherwise we try to choose a block count to avoid too much thrashing, particularly when iterating - // over the whole volume. This means at least enough blocks to cover one edge of the volume, and ideally + // Otherwise we try to choose a chunk count to avoid too much thrashing, particularly when iterating + // over the whole volume. This means at least enough chunks to cover one edge of the volume, and ideally // enough for a whole face. Which face? Longest edge by shortest edge seems like a reasonable guess. uint32_t longestSide = (std::max)(regValid.getWidthInVoxels(), (std::max)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); uint32_t shortestSide = (std::min)(regValid.getWidthInVoxels(), (std::min)(regValid.getHeightInVoxels(), regValid.getDepthInVoxels())); @@ -72,18 +72,18 @@ namespace PolyVox } else { - // If there is no pager provided then we set the block limit to the maximum - // value to ensure the system never attempts to page blocks out of memory. + // If there is no pager provided then we set the chunk limit to the maximum + // value to ensure the system never attempts to page chunks out of memory. m_uBlockCountLimit = (std::numeric_limits::max)(); } - // Make sure the calculated block limit is within practical bounds + // Make sure the calculated chunk limit is within practical bounds m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); + << "Mb (" << m_uBlockCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); initialise(); } @@ -243,34 +243,34 @@ namespace PolyVox } //////////////////////////////////////////////////////////////////////////////// - /// Increasing the size of the block cache will increase memory but may improve performance. + /// Increasing the size of the chunk cache will increase memory but may improve performance. /// You may want to set this to a large value (e.g. 1024) when you are first loading your /// volume data and then set it to a smaller value (e.g.64) for general processing. - /// \param uMaxNumberOfChunks The number of blocks for which uncompressed data can be cached. + /// \param uMaxNumberOfChunks The number of chunks for which uncompressed data can be cached. //////////////////////////////////////////////////////////////////////////////// template void PagedVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) { POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); - // Calculate the number of blocks based on the memory limit and the size of each block. + // Calculate the number of chunks based on the memory limit and the size of each chunk. uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); m_uBlockCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; - // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. + // We need at least a few chunks available to avoid thrashing, and in pratice there will probably be hundreds. POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " << uMemoryUsageInBytes / (1024 * 1024) << "Mb is too low and cannot be adhered to."); m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - // If the new limit is less than the number of blocks already loaded then the easiest solution is to flush and start loading again. + // If the new limit is less than the number of chunks already loaded then the easiest solution is to flush and start loading again. if (m_pRecentlyUsedChunks.size() > m_uBlockCountLimit) { flushAll(); } POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); + << "Mb (" << m_uBlockCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -370,7 +370,7 @@ namespace PolyVox template void PagedVolume::prefetch(Region regPrefetch) { - // Convert the start and end positions into block space coordinates + // Convert the start and end positions into chunk space coordinates Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { @@ -383,13 +383,13 @@ namespace PolyVox v3dEnd.setElement(i, regPrefetch.getUpperCorner().getElement(i) >> m_uChunkSideLengthPower); } - // Ensure we don't page in more blocks than the volume can hold. + // Ensure we don't page in more chunks than the volume can hold. Region region(v3dStart, v3dEnd); uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); - POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of blocks."); + POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of chunks."); uNoOfBlocks = (std::min)(uNoOfBlocks, m_uBlockCountLimit); - // Loops over the specified positions and touch the corresponding blocks. + // Loops over the specified positions and touch the corresponding chunks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) { for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) @@ -410,16 +410,16 @@ namespace PolyVox { POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); - // Clear this pointer so it doesn't hang on to any blocks. + // Clear this pointer so it doesn't hang on to any chunks. m_pLastAccessedChunk = nullptr; - // Erase all the most recently used blocks. + // Erase all the most recently used chunks. m_pRecentlyUsedChunks.clear(); - // Remove deleted blocks from the list of all loaded blocks. + // Remove deleted chunks from the list of all loaded chunks. purgeNullPtrsFromAllChunks(); - // If there are still some blocks left then this is a cause for concern. Perhaps samplers are holding on to them? + // If there are still some chunks left then this is a cause for concern. Perhaps samplers are holding on to them? POLYVOX_LOG_WARNING_IF(m_pAllChunks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); } @@ -431,10 +431,10 @@ namespace PolyVox { POLYVOX_LOG_WARNING_IF(!m_pPager, "Data discarded by flush operation as no pager is attached."); - // Clear this pointer so it doesn't hang on to any blocks. + // Clear this pointer so it doesn't hang on to any chunks. m_pLastAccessedChunk = nullptr; - // Convert the start and end positions into block space coordinates + // Convert the start and end positions into chunk space coordinates Vector3DInt32 v3dStart; for(int i = 0; i < 3; i++) { @@ -447,7 +447,7 @@ namespace PolyVox v3dEnd.setElement(i, regFlush.getUpperCorner().getElement(i) >> m_uChunkSideLengthPower); } - // Loops over the specified positions and delete the corresponding blocks. + // Loops over the specified positions and delete the corresponding chunks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) { for(int32_t y = v3dStart.getY(); y <= v3dEnd.getY(); y++) @@ -459,7 +459,7 @@ namespace PolyVox } } - // We might now have so null pointers in the 'all blocks' list so clean them up. + // We might now have so null pointers in the 'all chunks' list so clean them up. purgeNullPtrsFromAllChunks(); } @@ -486,7 +486,7 @@ namespace PolyVox m_v3dLastAccessedChunkPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedChunk pointer will be null; m_pLastAccessedChunk = 0; - //Compute the block side length + //Compute the chunk side length m_uChunkSideLengthPower = logBase2(m_uChunkSideLength); m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uChunkSideLengthPower); @@ -512,7 +512,7 @@ namespace PolyVox { Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); - //Check if we have the same block as last time, if so there's no need to even update + //Check if we have the same chunk as last time, if so there's no need to even update //the time stamp. If we updated it everytime then that would be every time we touched //a voxel, which would overflow a uint32_t and require us to use a uint64_t instead. //This check should also provide a significant speed boost as usually it is true. @@ -521,26 +521,26 @@ namespace PolyVox return m_pLastAccessedChunk; } - // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. + // The chunk was not the same as last time, but we can now hope it is in the set of most recently used chunks. std::shared_ptr< Chunk > pChunk = nullptr; typename SharedPtrChunkMap::iterator itChunk = m_pRecentlyUsedChunks.find(v3dBlockPos); - // Check whether the block was found. + // Check whether the chunk was found. if ((itChunk) != m_pRecentlyUsedChunks.end()) { - // The block was found so we can use it. + // The chunk was found so we can use it. pChunk = itChunk->second; - POLYVOX_ASSERT(pChunk, "Recent block list shold never contain a null pointer."); + POLYVOX_ASSERT(pChunk, "Recent chunk list shold never contain a null pointer."); } if (!pChunk) { - // Although it's not in our recently use blocks, there's some (slim) chance that it - // exists in the list of all loaded blocks, because a sampler may be holding on to it. + // Although it's not in our recently use chunks, there's some (slim) chance that it + // exists in the list of all loaded chunks, because a sampler may be holding on to it. typename WeakPtrChunkMap::iterator itWeakChunk = m_pAllChunks.find(v3dBlockPos); if (itWeakChunk != m_pAllChunks.end()) { - // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the + // We've found an entry in the 'all chunks' list, but it can be null. This happens if a sampler was the // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the // list, and it will get added again soon when we page it in and fill it with valid data. if (itWeakChunk->second.expired()) @@ -549,28 +549,28 @@ namespace PolyVox } else { - // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. + // The chunk is valid. We know it's not in the recently used list (we checked earlier) so it should be added. pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); } } } - // If we still haven't found the block then it's time to create a new one and page it in from disk. + // If we still haven't found the chunk then it's time to create a new one and page it in from disk. if (!pChunk) { - // The block was not found so we will create a new one. + // The chunk was not found so we will create a new one. pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uChunkSideLength, m_pPager); - // As we are loading a new block we should try to ensure we don't go over our target memory usage. + // As we are loading a new chunk we should try to ensure we don't go over our target memory usage. bool erasedBlock = false; - while (m_pRecentlyUsedChunks.size() + 1 > m_uBlockCountLimit) // +1 ready for new block we will add next. + while (m_pRecentlyUsedChunks.size() + 1 > m_uBlockCountLimit) // +1 ready for new chunk we will add next. { // This should never hit, because it should not have been possible for - // the user to limit the number of blocks if they did not provide a pager. - POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of blocks"); + // the user to limit the number of chunks if they did not provide a pager. + POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of chunks"); - // Find the least recently used block. Hopefully this isn't too slow. + // Find the least recently used chunk. Hopefully this isn't too slow. typename SharedPtrChunkMap::iterator itUnloadBlock = m_pRecentlyUsedChunks.begin(); for (typename SharedPtrChunkMap::iterator i = m_pRecentlyUsedChunks.begin(); i != m_pRecentlyUsedChunks.end(); i++) { @@ -580,19 +580,19 @@ namespace PolyVox } } - // Erase the least recently used block + // Erase the least recently used chunk m_pRecentlyUsedChunks.erase(itUnloadBlock); erasedBlock = true; } - // If we've deleted any blocks from the recently used list then this - // seems like a good place to purge the 'all blocks' list as well. + // If we've deleted any chunks from the recently used list then this + // seems like a good place to purge the 'all chunks' list as well. if (erasedBlock) { purgeNullPtrsFromAllChunks(); } - // Add our new block to the maps. + // Add our new chunk to the maps. m_pAllChunks.insert(std::make_pair(v3dBlockPos, pChunk)); m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); } @@ -610,7 +610,7 @@ namespace PolyVox template uint32_t PagedVolume::calculateSizeInBytes(void) { - // Purge null blocks so we know that all blocks are used. + // Purge null chunks so we know that all chunks are used. purgeNullPtrsFromAllChunks(); // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index bd7b8d7f..d325b01d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -159,12 +159,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. ++mCurrentVoxel; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } @@ -181,12 +181,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. mCurrentVoxel += this->mVolume->m_uChunkSideLength; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } @@ -203,12 +203,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. mCurrentVoxel += this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } @@ -225,12 +225,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mXPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. --mCurrentVoxel; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } @@ -247,12 +247,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mYPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. mCurrentVoxel -= this->mVolume->m_uChunkSideLength; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } @@ -269,12 +269,12 @@ namespace PolyVox // Then we update the voxel pointer if((this->isCurrentPositionValid()) && bIsOldPositionValid && ((this->mZPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { - //No need to compute new block. + //No need to compute new chunk. mCurrentVoxel -= this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; } else { - //We've hit the block boundary. Just calling setPosition() is the easiest way to resolve this. + //We've hit the chunk boundary. Just calling setPosition() is the easiest way to resolve this. setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index 71f2be01..7c24e023 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -162,7 +162,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - //The block data + //The voxel data VoxelType* m_pData; }; } From 71035029d1c51fb3eb1ae812ec6a9dc140433119 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 23:27:28 +0200 Subject: [PATCH 223/259] More renaming blocks to chunks. --- examples/Paging/main.cpp | 1 - .../PolyVoxCore/CubicSurfaceExtractor.h | 2 +- .../include/PolyVoxCore/PagedVolume.h | 10 +- .../include/PolyVoxCore/PagedVolume.inl | 94 +++++++++---------- .../PolyVoxCore/PagedVolumeSampler.inl | 22 ++--- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 5 - 6 files changed, 63 insertions(+), 71 deletions(-) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 6d140e2f..0b0d3de6 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -156,7 +156,6 @@ int main(int argc, char *argv[]) //createPerlinVolumeSlow(volData); std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - //volData.setBlockCacheSize(64); PolyVox::Region reg(Vector3DInt32(-255,0,0), Vector3DInt32(255,255,255)); std::cout << "Prefetching region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; volData.prefetch(reg); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 409ed096..9e86ee1a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -206,7 +206,7 @@ namespace PolyVox /// /// \image html CubicSurfaceExtractor3.png /// - /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent block from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). + /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent voxels from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). /// /// **Note:** *This behaviour has changed recently (September 2012). Earlier versions of PolyVox tried to be smart about this problem by looking beyond the region which was being processed, but this complicated the code and didn't work very well. Ultimatly we decided to simply stick with the convention outlined above.* /// diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index bc5ebb3e..60852007 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -298,7 +298,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - std::shared_ptr< Chunk > getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + std::shared_ptr< Chunk > getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const; void purgeNullPtrsFromAllChunks(void) const; @@ -309,10 +309,10 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedChunkPos; mutable std::shared_ptr< Chunk > m_pLastAccessedChunk; - uint32_t m_uBlockCountLimit; + uint32_t m_uChunkCountLimit; // The size of the volume - Region m_regValidRegionInBlocks; + Region m_regValidRegionInChunks; // The size of the chunks uint16_t m_uChunkSideLength; @@ -321,9 +321,9 @@ namespace PolyVox Pager* m_pPager; // Enough to make sure a chunks and it's neighbours can be loaded, with a few to spare. - static const uint32_t uMinPracticalNoOfBlocks = 32; + static const uint32_t uMinPracticalNoOfChunks = 32; // Should preent multi-gigabyte volumes with reasonable chunk sizes. - static const uint32_t uMaxPracticalNoOfBlocks = 32768; + static const uint32_t uMaxPracticalNoOfChunks = 32768; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index cd8654c8..e307ceb1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -54,7 +54,7 @@ namespace PolyVox // expecting a high memory usage and will want a fair number of chunks to play around with. if (regValid == Region::MaxRegion) { - m_uBlockCountLimit = 1024; + m_uChunkCountLimit = 1024; } else { @@ -67,23 +67,23 @@ namespace PolyVox longestSide /= m_uChunkSideLength; shortestSide /= m_uChunkSideLength; - m_uBlockCountLimit = longestSide * shortestSide; + m_uChunkCountLimit = longestSide * shortestSide; } } else { // If there is no pager provided then we set the chunk limit to the maximum // value to ensure the system never attempts to page chunks out of memory. - m_uBlockCountLimit = (std::numeric_limits::max)(); + m_uChunkCountLimit = (std::numeric_limits::max)(); } // Make sure the calculated chunk limit is within practical bounds - m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); - m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); + m_uChunkCountLimit = (std::max)(m_uChunkCountLimit, uMinPracticalNoOfChunks); + m_uChunkCountLimit = (std::min)(m_uChunkCountLimit, uMaxPracticalNoOfChunks); uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); - POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); + POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uChunkCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uChunkCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); initialise(); } @@ -255,22 +255,22 @@ namespace PolyVox // Calculate the number of chunks based on the memory limit and the size of each chunk. uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); - m_uBlockCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; + m_uChunkCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; // We need at least a few chunks available to avoid thrashing, and in pratice there will probably be hundreds. - POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " + POLYVOX_LOG_WARNING_IF(m_uChunkCountLimit < uMinPracticalNoOfChunks, "Requested memory usage limit of " << uMemoryUsageInBytes / (1024 * 1024) << "Mb is too low and cannot be adhered to."); - m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); - m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); + m_uChunkCountLimit = (std::max)(m_uChunkCountLimit, uMinPracticalNoOfChunks); + m_uChunkCountLimit = (std::min)(m_uChunkCountLimit, uMaxPracticalNoOfChunks); // If the new limit is less than the number of chunks already loaded then the easiest solution is to flush and start loading again. - if (m_pRecentlyUsedChunks.size() > m_uBlockCountLimit) + if (m_pRecentlyUsedChunks.size() > m_uChunkCountLimit) { flushAll(); } - POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); + POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uChunkCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uChunkCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -364,7 +364,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// - /// Note that if *NOTE - update docs - MaxNumberOfBlocksInMemory no longer exists* MaxNumberOfBlocksInMemory is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. + /// Note that if the memory usage limit is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. /// \param regPrefetch The Region of voxels to prefetch into memory. //////////////////////////////////////////////////////////////////////////////// template @@ -385,9 +385,9 @@ namespace PolyVox // Ensure we don't page in more chunks than the volume can hold. Region region(v3dStart, v3dEnd); - uint32_t uNoOfBlocks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); - POLYVOX_LOG_WARNING_IF(uNoOfBlocks > m_uBlockCountLimit, "Attempting to prefetch more than the maximum number of chunks."); - uNoOfBlocks = (std::min)(uNoOfBlocks, m_uBlockCountLimit); + uint32_t uNoOfChunks = static_cast(region.getWidthInVoxels() * region.getHeightInVoxels() * region.getDepthInVoxels()); + POLYVOX_LOG_WARNING_IF(uNoOfChunks > m_uChunkCountLimit, "Attempting to prefetch more than the maximum number of chunks."); + uNoOfChunks = (std::min)(uNoOfChunks, m_uChunkCountLimit); // Loops over the specified positions and touch the corresponding chunks. for(int32_t x = v3dStart.getX(); x <= v3dEnd.getX(); x++) @@ -420,7 +420,7 @@ namespace PolyVox purgeNullPtrsFromAllChunks(); // If there are still some chunks left then this is a cause for concern. Perhaps samplers are holding on to them? - POLYVOX_LOG_WARNING_IF(m_pAllChunks.size() > 0, "Blocks still exist after performing flushAll()! Perhaps you have samplers attached?"); + POLYVOX_LOG_WARNING_IF(m_pAllChunks.size() > 0, "Chunks still exist after performing flushAll()! Perhaps you have samplers attached?"); } //////////////////////////////////////////////////////////////////////////////// @@ -472,31 +472,29 @@ namespace PolyVox //Validate parameters if(m_uChunkSideLength == 0) { - POLYVOX_THROW(std::invalid_argument, "Block side length cannot be zero."); + POLYVOX_THROW(std::invalid_argument, "Chunk side length cannot be zero."); } if(!isPowerOf2(m_uChunkSideLength)) { - POLYVOX_THROW(std::invalid_argument, "Block side length must be a power of two."); + POLYVOX_THROW(std::invalid_argument, "Chunk side length must be a power of two."); } m_uTimestamper = 0; - //m_uBlockCountLimit = 16; - //m_uMaxNumberOfBlocksInMemory = 1024; m_v3dLastAccessedChunkPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedChunk pointer will be null; m_pLastAccessedChunk = 0; //Compute the chunk side length m_uChunkSideLengthPower = logBase2(m_uChunkSideLength); - m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uChunkSideLengthPower); - m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uChunkSideLengthPower); - m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uChunkSideLengthPower); - m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uChunkSideLengthPower); - m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uChunkSideLengthPower); - m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uChunkSideLengthPower); + m_regValidRegionInChunks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uChunkSideLengthPower); - //setMaxNumberOfChunks(m_uBlockCountLimit); + //setMaxNumberOfChunks(m_uChunkCountLimit); //Clear the previous data m_pRecentlyUsedChunks.clear(); @@ -508,22 +506,22 @@ namespace PolyVox } template - std::shared_ptr< Chunk > PagedVolume::getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const + std::shared_ptr< Chunk > PagedVolume::getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const { - Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); + Vector3DInt32 v3dChunkPos(uChunkX, uChunkY, uChunkZ); //Check if we have the same chunk as last time, if so there's no need to even update //the time stamp. If we updated it everytime then that would be every time we touched //a voxel, which would overflow a uint32_t and require us to use a uint64_t instead. //This check should also provide a significant speed boost as usually it is true. - if((v3dBlockPos == m_v3dLastAccessedChunkPos) && (m_pLastAccessedChunk != 0)) + if((v3dChunkPos == m_v3dLastAccessedChunkPos) && (m_pLastAccessedChunk != 0)) { return m_pLastAccessedChunk; } // The chunk was not the same as last time, but we can now hope it is in the set of most recently used chunks. std::shared_ptr< Chunk > pChunk = nullptr; - typename SharedPtrChunkMap::iterator itChunk = m_pRecentlyUsedChunks.find(v3dBlockPos); + typename SharedPtrChunkMap::iterator itChunk = m_pRecentlyUsedChunks.find(v3dChunkPos); // Check whether the chunk was found. if ((itChunk) != m_pRecentlyUsedChunks.end()) @@ -537,7 +535,7 @@ namespace PolyVox { // Although it's not in our recently use chunks, there's some (slim) chance that it // exists in the list of all loaded chunks, because a sampler may be holding on to it. - typename WeakPtrChunkMap::iterator itWeakChunk = m_pAllChunks.find(v3dBlockPos); + typename WeakPtrChunkMap::iterator itWeakChunk = m_pAllChunks.find(v3dChunkPos); if (itWeakChunk != m_pAllChunks.end()) { // We've found an entry in the 'all chunks' list, but it can be null. This happens if a sampler was the @@ -551,7 +549,7 @@ namespace PolyVox { // The chunk is valid. We know it's not in the recently used list (we checked earlier) so it should be added. pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); - m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pRecentlyUsedChunks.insert(std::make_pair(v3dChunkPos, pChunk)); } } } @@ -560,46 +558,46 @@ namespace PolyVox if (!pChunk) { // The chunk was not found so we will create a new one. - pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uChunkSideLength, m_pPager); + pChunk = std::make_shared< Chunk >(v3dChunkPos, m_uChunkSideLength, m_pPager); // As we are loading a new chunk we should try to ensure we don't go over our target memory usage. - bool erasedBlock = false; - while (m_pRecentlyUsedChunks.size() + 1 > m_uBlockCountLimit) // +1 ready for new chunk we will add next. + bool erasedChunk = false; + while (m_pRecentlyUsedChunks.size() + 1 > m_uChunkCountLimit) // +1 ready for new chunk we will add next. { // This should never hit, because it should not have been possible for // the user to limit the number of chunks if they did not provide a pager. POLYVOX_ASSERT(m_pPager, "A valid pager is required to limit number of chunks"); // Find the least recently used chunk. Hopefully this isn't too slow. - typename SharedPtrChunkMap::iterator itUnloadBlock = m_pRecentlyUsedChunks.begin(); + typename SharedPtrChunkMap::iterator itUnloadChunk = m_pRecentlyUsedChunks.begin(); for (typename SharedPtrChunkMap::iterator i = m_pRecentlyUsedChunks.begin(); i != m_pRecentlyUsedChunks.end(); i++) { - if (i->second->m_uChunkLastAccessed < itUnloadBlock->second->m_uChunkLastAccessed) + if (i->second->m_uChunkLastAccessed < itUnloadChunk->second->m_uChunkLastAccessed) { - itUnloadBlock = i; + itUnloadChunk = i; } } // Erase the least recently used chunk - m_pRecentlyUsedChunks.erase(itUnloadBlock); - erasedBlock = true; + m_pRecentlyUsedChunks.erase(itUnloadChunk); + erasedChunk = true; } // If we've deleted any chunks from the recently used list then this // seems like a good place to purge the 'all chunks' list as well. - if (erasedBlock) + if (erasedChunk) { purgeNullPtrsFromAllChunks(); } // Add our new chunk to the maps. - m_pAllChunks.insert(std::make_pair(v3dBlockPos, pChunk)); - m_pRecentlyUsedChunks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pAllChunks.insert(std::make_pair(v3dChunkPos, pChunk)); + m_pRecentlyUsedChunks.insert(std::make_pair(v3dChunkPos, pChunk)); } pChunk->m_uChunkLastAccessed = ++m_uTimestamper; m_pLastAccessedChunk = pChunk; - m_v3dLastAccessedChunkPos = v3dBlockPos; + m_v3dLastAccessedChunkPos = v3dChunkPos; return pChunk; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index d325b01d..90909cb7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -107,21 +107,21 @@ namespace PolyVox // Then we update the voxel pointer if(this->isCurrentPositionValid()) { - const int32_t uXBlock = this->mXPosInVolume >> this->mVolume->m_uChunkSideLengthPower; - const int32_t uYBlock = this->mYPosInVolume >> this->mVolume->m_uChunkSideLengthPower; - const int32_t uZBlock = this->mZPosInVolume >> this->mVolume->m_uChunkSideLengthPower; + const int32_t uXChunk = this->mXPosInVolume >> this->mVolume->m_uChunkSideLengthPower; + const int32_t uYChunk = this->mYPosInVolume >> this->mVolume->m_uChunkSideLengthPower; + const int32_t uZChunk = this->mZPosInVolume >> this->mVolume->m_uChunkSideLengthPower; - const uint16_t uXPosInBlock = static_cast(this->mXPosInVolume - (uXBlock << this->mVolume->m_uChunkSideLengthPower)); - const uint16_t uYPosInBlock = static_cast(this->mYPosInVolume - (uYBlock << this->mVolume->m_uChunkSideLengthPower)); - const uint16_t uZPosInBlock = static_cast(this->mZPosInVolume - (uZBlock << this->mVolume->m_uChunkSideLengthPower)); + const uint16_t uXPosInChunk = static_cast(this->mXPosInVolume - (uXChunk << this->mVolume->m_uChunkSideLengthPower)); + const uint16_t uYPosInChunk = static_cast(this->mYPosInVolume - (uYChunk << this->mVolume->m_uChunkSideLengthPower)); + const uint16_t uZPosInChunk = static_cast(this->mZPosInVolume - (uZChunk << this->mVolume->m_uChunkSideLengthPower)); - const uint32_t uVoxelIndexInBlock = uXPosInBlock + - uYPosInBlock * this->mVolume->m_uChunkSideLength + - uZPosInBlock * this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; + const uint32_t uVoxelIndexInChunk = uXPosInChunk + + uYPosInChunk * this->mVolume->m_uChunkSideLength + + uZPosInChunk * this->mVolume->m_uChunkSideLength * this->mVolume->m_uChunkSideLength; - auto pUncompressedCurrentBlock = this->mVolume->getChunk(uXBlock, uYBlock, uZBlock); + auto pCurrentChunk = this->mVolume->getChunk(uXChunk, uYChunk, uZChunk); - mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; + mCurrentVoxel = pCurrentChunk->m_tData + uVoxelIndexInChunk; } else { diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 449ff4a9..58aceae2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -62,11 +62,6 @@ namespace PolyVox typedef Array<3,int32_t> Array3DInt32; typedef Array<3,uint32_t> Array3DUint32;*/ - //////////////////////////////////////////////////////////////////////////////// - // BlockCompressor - //////////////////////////////////////////////////////////////////////////////// - template class BlockCompressor; - //////////////////////////////////////////////////////////////////////////////// // Compressor //////////////////////////////////////////////////////////////////////////////// From db9a74fdb4656fbe80dce56302f1881758b387ba Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 10:27:55 +0200 Subject: [PATCH 224/259] Moving Chunk to be a nested class of PagedVolume. --- examples/Paging/main.cpp | 4 +- library/PolyVoxCore/CMakeLists.txt | 3 +- .../PolyVoxCore/include/PolyVoxCore/Chunk.h | 77 ------------------- .../include/PolyVoxCore/FilePager.h | 8 +- .../include/PolyVoxCore/PagedVolume.h | 50 ++++++++++-- .../include/PolyVoxCore/PagedVolume.inl | 14 ++-- .../{Chunk.inl => PagedVolumeChunk.inl} | 20 ++--- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 6 +- 8 files changed, 72 insertions(+), 110 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Chunk.h rename library/PolyVoxCore/include/PolyVoxCore/{Chunk.inl => PagedVolumeChunk.inl} (86%) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 0b0d3de6..f0248c14 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,7 +90,7 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, Chunk* pChunk) + virtual void pageIn(const PolyVox::Region& region, PagedVolume::Chunk* pChunk) { Perlin perlin(2,2,1,234); @@ -134,7 +134,7 @@ public: } } - virtual void pageOut(const PolyVox::Region& region, Chunk* /*pChunk*/) + virtual void pageOut(const PolyVox::Region& region, PagedVolume::Chunk* /*pChunk*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 286f5e14..9704e593 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -38,8 +38,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/BaseVolume.h include/PolyVoxCore/BaseVolume.inl include/PolyVoxCore/BaseVolumeSampler.inl - include/PolyVoxCore/Chunk.h - include/PolyVoxCore/Chunk.inl include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -62,6 +60,7 @@ SET(CORE_INC_FILES include/PolyVoxCore/Mesh.inl include/PolyVoxCore/PagedVolume.h include/PolyVoxCore/PagedVolume.inl + include/PolyVoxCore/PagedVolumeChunk.inl include/PolyVoxCore/PagedVolumeSampler.inl include/PolyVoxCore/Pager.h include/PolyVoxCore/PolyVoxForwardDeclarations.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h deleted file mode 100644 index 1eeec066..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.h +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Chunk_H__ -#define __PolyVox_Chunk_H__ - -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/Vector.h" - -namespace PolyVox -{ - template - class Chunk - { - friend class PagedVolume; - - public: - Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); - ~Chunk(); - - VoxelType* getData(void) const; - uint32_t getDataSizeInBytes(void) const; - - VoxelType getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; - VoxelType getVoxel(const Vector3DUint16& v3dPos) const; - - void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); - void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); - - private: - /// Private copy constructor to prevent accisdental copying - Chunk(const Chunk& /*rhs*/) {}; - - /// Private assignment operator to prevent accisdental copying - Chunk& operator=(const Chunk& /*rhs*/) {}; - - // This is updated by the PagedVolume and used to discard the least recently used chunks. - uint32_t m_uChunkLastAccessed; - - // This is so we can tell whether a uncompressed chunk has to be recompressed and whether - // a compressed chunk has to be paged back to disk, or whether they can just be discarded. - bool m_bDataModified; - - uint32_t calculateSizeInBytes(void); - static uint32_t calculateSizeInBytes(uint32_t uSideLength); - - VoxelType* m_tData; - uint16_t m_uSideLength; - uint8_t m_uSideLengthPower; - Pager* m_pPager; - Vector3DInt32 m_v3dChunkSpacePosition; - }; -} - -#include "PolyVoxCore/Chunk.inl" - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 26f20c21..269af29c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -76,10 +76,10 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, Chunk* pChunk) + virtual void pageIn(const Region& region, typename PagedVolume::Chunk* pChunk) { POLYVOX_ASSERT(pChunk, "Attempting to page in NULL chunk"); - POLYVOX_ASSERT(pChunk->getData() == false, "Chunk must have valid data"); + POLYVOX_ASSERT(pChunk->getData(), "Chunk must have valid data"); std::stringstream ssFilename; ssFilename << m_strFolderName << "/" << m_strRandomPrefix << "-" @@ -120,10 +120,10 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, Chunk* pChunk) + virtual void pageOut(const Region& region, typename PagedVolume::Chunk* pChunk) { POLYVOX_ASSERT(pChunk, "Attempting to page out NULL chunk"); - POLYVOX_ASSERT(pChunk->getData() == false, "Chunk must have valid data"); + POLYVOX_ASSERT(pChunk->getData(), "Chunk must have valid data"); POLYVOX_LOG_TRACE("Paging out data for " << region); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 60852007..75acaaca 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -27,7 +27,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Chunk.h" #include "PolyVoxCore/Vector.h" #include @@ -157,6 +156,46 @@ namespace PolyVox class PagedVolume : public BaseVolume { public: + + class Chunk + { + public: + Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); + ~Chunk(); + + VoxelType* getData(void) const; + uint32_t getDataSizeInBytes(void) const; + + VoxelType getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; + VoxelType getVoxel(const Vector3DUint16& v3dPos) const; + + void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); + void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); + + public: + /// Private copy constructor to prevent accisdental copying + Chunk(const Chunk& /*rhs*/) {}; + + /// Private assignment operator to prevent accisdental copying + Chunk& operator=(const Chunk& /*rhs*/) {}; + + // This is updated by the PagedVolume and used to discard the least recently used chunks. + uint32_t m_uChunkLastAccessed; + + // This is so we can tell whether a uncompressed chunk has to be recompressed and whether + // a compressed chunk has to be paged back to disk, or whether they can just be discarded. + bool m_bDataModified; + + uint32_t calculateSizeInBytes(void); + static uint32_t calculateSizeInBytes(uint32_t uSideLength); + + VoxelType* m_tData; + uint16_t m_uSideLength; + uint8_t m_uSideLengthPower; + Pager* m_pPager; + Vector3DInt32 m_v3dChunkSpacePosition; + }; + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler @@ -285,8 +324,8 @@ namespace PolyVox private: - typedef std::unordered_map > > SharedPtrChunkMap; - typedef std::unordered_map > > WeakPtrChunkMap; + typedef std::unordered_map > SharedPtrChunkMap; + typedef std::unordered_map > WeakPtrChunkMap; void initialise(); @@ -298,7 +337,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - std::shared_ptr< Chunk > getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const; + std::shared_ptr getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const; void purgeNullPtrsFromAllChunks(void) const; @@ -308,7 +347,7 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedChunkPos; - mutable std::shared_ptr< Chunk > m_pLastAccessedChunk; + mutable std::shared_ptr m_pLastAccessedChunk; uint32_t m_uChunkCountLimit; // The size of the volume @@ -328,6 +367,7 @@ namespace PolyVox } #include "PolyVoxCore/PagedVolume.inl" +#include "PolyVoxCore/PagedVolumeChunk.inl" #include "PolyVoxCore/PagedVolumeSampler.inl" #endif //__PolyVox_PagedVolume_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index e307ceb1..ae5aeea3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -81,7 +81,7 @@ namespace PolyVox m_uChunkCountLimit = (std::max)(m_uChunkCountLimit, uMinPracticalNoOfChunks); m_uChunkCountLimit = (std::min)(m_uChunkCountLimit, uMaxPracticalNoOfChunks); - uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); + uint32_t uChunkSizeInBytes = PagedVolume::Chunk::calculateSizeInBytes(m_uChunkSideLength); POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uChunkCountLimit * uChunkSizeInBytes) / (1024 * 1024) << "Mb (" << m_uChunkCountLimit << " chunks of " << uChunkSizeInBytes / 1024 << "Kb each)."); @@ -254,7 +254,7 @@ namespace PolyVox POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); // Calculate the number of chunks based on the memory limit and the size of each chunk. - uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uChunkSideLength); + uint32_t uChunkSizeInBytes = PagedVolume::Chunk::calculateSizeInBytes(m_uChunkSideLength); m_uChunkCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; // We need at least a few chunks available to avoid thrashing, and in pratice there will probably be hundreds. @@ -506,7 +506,7 @@ namespace PolyVox } template - std::shared_ptr< Chunk > PagedVolume::getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const + std::shared_ptr::Chunk> PagedVolume::getChunk(int32_t uChunkX, int32_t uChunkY, int32_t uChunkZ) const { Vector3DInt32 v3dChunkPos(uChunkX, uChunkY, uChunkZ); @@ -520,7 +520,7 @@ namespace PolyVox } // The chunk was not the same as last time, but we can now hope it is in the set of most recently used chunks. - std::shared_ptr< Chunk > pChunk = nullptr; + std::shared_ptr::Chunk> pChunk = nullptr; typename SharedPtrChunkMap::iterator itChunk = m_pRecentlyUsedChunks.find(v3dChunkPos); // Check whether the chunk was found. @@ -548,7 +548,7 @@ namespace PolyVox else { // The chunk is valid. We know it's not in the recently used list (we checked earlier) so it should be added. - pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); + pChunk = std::shared_ptr< PagedVolume::Chunk >(itWeakChunk->second); m_pRecentlyUsedChunks.insert(std::make_pair(v3dChunkPos, pChunk)); } } @@ -558,7 +558,7 @@ namespace PolyVox if (!pChunk) { // The chunk was not found so we will create a new one. - pChunk = std::make_shared< Chunk >(v3dChunkPos, m_uChunkSideLength, m_pPager); + pChunk = std::make_shared< PagedVolume::Chunk >(v3dChunkPos, m_uChunkSideLength, m_pPager); // As we are loading a new chunk we should try to ensure we don't go over our target memory usage. bool erasedChunk = false; @@ -613,7 +613,7 @@ namespace PolyVox // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. - return Chunk::calculateSizeInBytes(m_uChunkSideLength) * m_pAllChunks.size(); + return PagedVolume::Chunk::calculateSizeInBytes(m_uChunkSideLength) * m_pAllChunks.size(); } template diff --git a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl similarity index 86% rename from library/PolyVoxCore/include/PolyVoxCore/Chunk.inl rename to library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl index 49d25aeb..05b713d2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) + PagedVolume::Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) :m_uChunkLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) @@ -65,7 +65,7 @@ namespace PolyVox } template - Chunk::~Chunk() + PagedVolume::Chunk::~Chunk() { if (m_pPager && m_bDataModified) { @@ -82,19 +82,19 @@ namespace PolyVox } template - VoxelType* Chunk::getData(void) const + VoxelType* PagedVolume::Chunk::getData(void) const { return m_tData; } template - uint32_t Chunk::getDataSizeInBytes(void) const + uint32_t PagedVolume::Chunk::getDataSizeInBytes(void) const { return m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType); } template - VoxelType Chunk::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const + VoxelType PagedVolume::Chunk::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -112,13 +112,13 @@ namespace PolyVox } template - VoxelType Chunk::getVoxel(const Vector3DUint16& v3dPos) const + VoxelType PagedVolume::Chunk::getVoxel(const Vector3DUint16& v3dPos) const { return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); } template - void Chunk::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) + void PagedVolume::Chunk::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -138,20 +138,20 @@ namespace PolyVox } template - void Chunk::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) + void PagedVolume::Chunk::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) { setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } template - uint32_t Chunk::calculateSizeInBytes(void) + uint32_t PagedVolume::Chunk::calculateSizeInBytes(void) { // Call through to the static version return calculateSizeInBytes(m_uSideLength); } template - uint32_t Chunk::calculateSizeInBytes(uint32_t uSideLength) + uint32_t PagedVolume::Chunk::calculateSizeInBytes(uint32_t uSideLength) { // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index 39d016bb..0280883c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Pager_H__ #define __PolyVox_Pager_H__ -#include "PolyVoxCore/Chunk.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/Impl/TypeDef.h" #include @@ -43,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, Chunk* pChunk) = 0; - virtual void pageOut(const Region& region, Chunk* pChunk) = 0; + virtual void pageIn(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; + virtual void pageOut(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; }; } From d6a7b83698f3a4e24679bb4800bc12e92166cee7 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 11:42:12 +0200 Subject: [PATCH 225/259] Moved Pager to be a nested class of PagedVolume. --- examples/Paging/main.cpp | 7 ++- library/PolyVoxCore/CMakeLists.txt | 1 - .../include/PolyVoxCore/FilePager.h | 6 +-- .../include/PolyVoxCore/PagedVolume.h | 28 +++++++--- .../include/PolyVoxCore/PagedVolume.inl | 2 +- .../include/PolyVoxCore/PagedVolumeChunk.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 51 ------------------- 7 files changed, 30 insertions(+), 67 deletions(-) delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Pager.h diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index f0248c14..f70de28f 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -27,9 +27,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/LargeVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include @@ -78,12 +77,12 @@ void createSphereInVolume(LargeVolume& volData, Vector3DF /** * Generates data using Perlin noise. */ -class PerlinNoisePager : public PolyVox::Pager +class PerlinNoisePager : public PolyVox::PagedVolume::Pager { public: /// Constructor PerlinNoisePager() - :Pager() + :PagedVolume::Pager() { } diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 9704e593..42d8c752 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -62,7 +62,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/PagedVolume.inl include/PolyVoxCore/PagedVolumeChunk.inl include/PolyVoxCore/PagedVolumeSampler.inl - include/PolyVoxCore/Pager.h include/PolyVoxCore/PolyVoxForwardDeclarations.h include/PolyVoxCore/Picking.h include/PolyVoxCore/Picking.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 269af29c..ed3b7a9a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -26,7 +26,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/TypeDef.h" -#include "PolyVoxCore/Pager.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/Region.h" #include @@ -42,12 +42,12 @@ namespace PolyVox * Provides an interface for performing paging of data. */ template - class FilePager : public Pager + class FilePager : public PagedVolume::Pager { public: /// Constructor FilePager(const std::string& strFolderName = ".") - :Pager() + :PagedVolume::Pager() ,m_strFolderName(strFolderName) { // Add the trailing slash, assuming the user dind't already do it. diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 75acaaca..7ee41ec4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -25,7 +25,6 @@ freely, subject to the following restrictions: #define __PolyVox_PagedVolume_H__ #include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" #include "PolyVoxCore/Vector.h" @@ -156,11 +155,13 @@ namespace PolyVox class PagedVolume : public BaseVolume { public: + class Chunk; + class Pager; class Chunk { public: - Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); + Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, typename PagedVolume::Pager* pPager = nullptr); ~Chunk(); VoxelType* getData(void) const; @@ -192,10 +193,25 @@ namespace PolyVox VoxelType* m_tData; uint16_t m_uSideLength; uint8_t m_uSideLengthPower; - Pager* m_pPager; + typename PagedVolume::Pager* m_pPager; Vector3DInt32 m_v3dChunkSpacePosition; }; + /** + * Provides an interface for performing paging of data. + */ + class Pager + { + public: + /// Constructor + Pager() {}; + /// Destructor + virtual ~Pager() {}; + + virtual void pageIn(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; + virtual void pageOut(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; + }; + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler @@ -272,7 +288,7 @@ namespace PolyVox PagedVolume ( const Region& regValid, - Pager* pPager = nullptr, + typename PagedVolume::Pager* pPager = nullptr, uint16_t uChunkSideLength = 32 ); /// Destructor @@ -357,11 +373,11 @@ namespace PolyVox uint16_t m_uChunkSideLength; uint8_t m_uChunkSideLengthPower; - Pager* m_pPager; + typename PagedVolume::Pager* m_pPager; // Enough to make sure a chunks and it's neighbours can be loaded, with a few to spare. static const uint32_t uMinPracticalNoOfChunks = 32; - // Should preent multi-gigabyte volumes with reasonable chunk sizes. + // Should prevent multi-gigabyte volumes when chunk sizes are reasonable. static const uint32_t uMaxPracticalNoOfChunks = 32768; }; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index ae5aeea3..7027bf68 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -40,7 +40,7 @@ namespace PolyVox PagedVolume::PagedVolume ( const Region& regValid, - Pager* pPager, + typename PagedVolume::Pager* pPager, uint16_t uChunkSideLength ) :BaseVolume(regValid) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl index 05b713d2..7bb904a8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - PagedVolume::Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) + PagedVolume::Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, typename PagedVolume::Pager* pPager) :m_uChunkLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h deleted file mode 100644 index 0280883c..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Pager_H__ -#define __PolyVox_Pager_H__ - -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - /** - * Provides an interface for performing paging of data. - */ - template - class Pager - { - public: - /// Constructor - Pager() {}; - /// Destructor - virtual ~Pager() {}; - - virtual void pageIn(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; - virtual void pageOut(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; - }; -} - -#endif //__PolyVox_Pager_H__ From 33ec5e1d79e1d5f27e920729dc4955c437d6ae5f Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 12:16:54 +0200 Subject: [PATCH 226/259] Added a couple of comments. --- library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 7ee41ec4..b7f03aa1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -155,7 +155,9 @@ namespace PolyVox class PagedVolume : public BaseVolume { public: + /// The PagedVolume stores it data as a set of Chunk instances which can be loaded and unloaded as memory requirements dictate. class Chunk; + /// The Pager class is responsible for the loading and unloading of Chunks, and can be overridden by the user. class Pager; class Chunk From ae0c5b3702caf52288e1716ab772aaf540d95a72 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 14:47:46 +0200 Subject: [PATCH 227/259] Added comments and removed deprecated functions. --- .../include/PolyVoxCore/PagedVolume.h | 40 +++++---- .../include/PolyVoxCore/PagedVolume.inl | 82 +------------------ .../include/PolyVoxCore/PagedVolumeChunk.inl | 2 +- 3 files changed, 25 insertions(+), 99 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index b7f03aa1..304909ca 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -163,7 +163,7 @@ namespace PolyVox class Chunk { public: - Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, typename PagedVolume::Pager* pPager = nullptr); + Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); ~Chunk(); VoxelType* getData(void) const; @@ -195,12 +195,14 @@ namespace PolyVox VoxelType* m_tData; uint16_t m_uSideLength; uint8_t m_uSideLengthPower; - typename PagedVolume::Pager* m_pPager; + Pager* m_pPager; Vector3DInt32 m_v3dChunkSpacePosition; }; /** - * Provides an interface for performing paging of data. + * Users can override this class and provide an instance of the derived class to the PagedVolume constructor. This derived class + * could then perform tasks such as compression and decompression of the data, and read/writing it to a file, database, network, + * or other storage as appropriate. See FilePager for a simple example of such a derived class. */ class Pager { @@ -210,8 +212,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; - virtual void pageOut(const Region& region, typename PagedVolume::Chunk* pChunk) = 0; + virtual void pageIn(const Region& region, Chunk* pChunk) = 0; + virtual void pageOut(const Region& region, Chunk* pChunk) = 0; }; //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. @@ -290,7 +292,7 @@ namespace PolyVox PagedVolume ( const Region& regValid, - typename PagedVolume::Pager* pPager = nullptr, + Pager* pPager = nullptr, uint16_t uChunkSideLength = 32 ); /// Destructor @@ -308,21 +310,13 @@ namespace PolyVox /// Gets a voxel at the position given by a 3D vector VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by x,y,z coordinates - POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - /// Gets a voxel at the position given by a 3D vector - POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - /// Sets the number of chunks for which uncompressed data is stored void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); /// Sets the voxel at the position given by a 3D vector void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); + /// Tries to ensure that the voxels within the specified Region are loaded into memory. void prefetch(Region regPrefetch); /// Ensures that any voxels within the specified Region are removed from memory. @@ -359,8 +353,20 @@ namespace PolyVox void purgeNullPtrsFromAllChunks(void) const; - // The chunk data + // The chunk data is stored in the pair of maps below. This will often hold the same set of chunks but there are occasions + // when they can differ (more on that in a moment). The main store is the set of 'recently used chunks' which holds shared_ptr's + // to the chunk data. When memory is low chunks can be removed from this list and, assuming there are no more references to + // them, they will be deleted. However, it is also possible that a Sampler is pointing at a given chunk, and in this case the + // reference counting will ensure that the chunk survives until the sampler has finished with it. + // + // However, this leaves us open to a subtle bug. If a chunk is removed from the recently used set, continues to exist due to a + // sampler using it, and then the user tries to access it through the volume interface, then the volume will page the chunk + // back in (not knowing the sampler still has it). This would result in two chunks in memory with the same position is space. + // To avoid this, the 'all chunks' set tracks chunks with are used by the volume *and/or* the samplers. It holds weak pointers + // so does not cause chunks to persist. + typedef std::unordered_map > WeakPtrChunkMap; mutable WeakPtrChunkMap m_pAllChunks; + typedef std::unordered_map > SharedPtrChunkMap; mutable SharedPtrChunkMap m_pRecentlyUsedChunks; mutable uint32_t m_uTimestamper; @@ -375,7 +381,7 @@ namespace PolyVox uint16_t m_uChunkSideLength; uint8_t m_uChunkSideLengthPower; - typename PagedVolume::Pager* m_pPager; + Pager* m_pPager; // Enough to make sure a chunks and it's neighbours can be loaded, with a few to spare. static const uint32_t uMinPracticalNoOfChunks = 32; diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 7027bf68..9919da74 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -40,7 +40,7 @@ namespace PolyVox PagedVolume::PagedVolume ( const Region& regValid, - typename PagedVolume::Pager* pPager, + Pager* pPager, uint16_t uChunkSideLength ) :BaseVolume(regValid) @@ -203,45 +203,6 @@ namespace PolyVox return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); } - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType PagedVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; - const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; - const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - - auto pChunk = getChunk(chunkX, chunkY, chunkZ); - - return pChunk->getVoxel(xOffset, yOffset, zOffset); - } - else - { - return this->getBorderValue(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos The 3D position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType PagedVolume::getVoxelAt(const Vector3DInt32& v3dPos) const - { - return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - //////////////////////////////////////////////////////////////////////////////// /// Increasing the size of the chunk cache will increase memory but may improve performance. /// You may want to set this to a large value (e.g. 1024) when you are first loading your @@ -322,47 +283,6 @@ namespace PolyVox setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); } - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool PagedVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) - { - // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. - POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); - - const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; - const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; - const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; - - const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); - const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); - const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); - - auto pChunk = getChunk(chunkX, chunkY, chunkZ); - - pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); - - //Return true to indicate that we modified a voxel. - return true; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool PagedVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) - { - return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); - } - - //////////////////////////////////////////////////////////////////////////////// /// Note that if the memory usage limit is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. /// \param regPrefetch The Region of voxels to prefetch into memory. diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl index 7bb904a8..d7e249bd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - PagedVolume::Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, typename PagedVolume::Pager* pPager) + PagedVolume::Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) :m_uChunkLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) From ccb9f8d5641059bc7ebed9ce71c24455831faa91 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 15:03:13 +0200 Subject: [PATCH 228/259] Updated documentation. --- .../include/PolyVoxCore/PagedVolume.h | 70 ++++--------------- 1 file changed, 13 insertions(+), 57 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 304909ca..d0ed5d51 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -52,22 +52,18 @@ namespace PolyVox /// The following code snippet shows how to construct a volume and demonstrates basic usage: /// /// \code - /// PagedVolume volume(Region(Vector3DInt32(0,0,0), Vector3DInt32(63,127,255))); - /// volume.setVoxelAt(15, 90, 42, Material8(5)); - /// std::cout << "Voxel at (15, 90, 42) has value: " << volume.getVoxelAt(15, 90, 42).getMaterial() << std::endl; + /// PagedVolume volume(Region(Vector3DInt32(0,0,0), Vector3DInt32(63,127,255))); + /// volume.setVoxel(15, 90, 42, int(5)); + /// std::cout << "Voxel at (15, 90, 42) has value: " << volume.getVoxel(15, 90, 42) << std::endl; /// std::cout << "Width = " << volume.getWidth() << ", Height = " << volume.getHeight() << ", Depth = " << volume.getDepth() << std::endl; /// \endcode - /// - /// In this particular example each voxel in the PagedVolume is of type 'Material8', as specified by the template parameter. This is one of several - /// predefined voxel types, and it is also possible to define your own. The Material8 type simply holds an integer value where zero represents - /// empty space and any other value represents a solid material. /// /// The PagedVolume constructor takes a Region as a parameter. This specifies the valid range of voxels which can be held in the volume, so in this - /// particular case the valid voxel positions are (0,0,0) to (63, 127, 255). Attempts to access voxels outside this range will result is accessing the - /// border value (see getBorderValue() and setBorderValue()). PolyVox also has support for near infinite volumes which will be discussed later. + /// particular case the valid voxel positions are (0,0,0) to (63, 127, 255). The result of attempts to access voxels outside this range will result + /// are defined by the WrapMode). PolyVox also has support for near infinite volumes which will be discussed later. /// - /// Access to individual voxels is provided via the setVoxelAt() and getVoxelAt() member functions. Advanced users may also be interested in - /// the Sampler class for faster read-only access to a large number of voxels. + /// Access to individual voxels is provided via the setVoxel() and getVoxel() member functions. Advanced users may also be interested in + /// the Sampler nested class for faster read-only access to a large number of voxels. /// /// Lastly the example prints out some properties of the PagedVolume. Note that the dimentsions getWidth(), getHeight(), and getDepth() are inclusive, such /// that the width is 64 when the range of valid x coordinates goes from 0 to 63. @@ -80,70 +76,30 @@ namespace PolyVox /// /// Essentially, the PagedVolume class stores its data as a collection of chunks. Each of these chunk is much smaller than the whole volume, /// for example a typical size might be 32x32x32 voxels (though is is configurable by the user). In this case, a 256x512x1024 volume - /// would contain 8x16x32 = 4096 chunks. The data for each chunk is stored in a compressed form, which uses only a small amout of - /// memory but it is hard to modify the data. Therefore, before any given voxel can be modified, its corresponding chunk must be uncompressed. - /// - /// The compression and decompression of chunk is a relatively slow process and so we aim to do this as rarely as possible. In order - /// to achive this, the volume class stores a cache of recently used chunks and their associated uncompressed data. Each time a voxel - /// is touched a timestamp is updated on the corresponding chunk. When the cache becomes full the chunk with the oldest timestamp is - /// recompressed and moved out of the cache. - /// - /// Achieving high compression rates - /// -------------------------------- - /// The compression rates which can be achieved can vary significantly depending the nature of the data you are storing, but you can - /// encourage high compression rates by making your data as homogenous as possible. If you are simply storing a material with each - /// voxel then this will probably happen naturally. Games such as Minecraft which use this approach will typically involve large areas - /// of the same material which will compress down well. - /// - /// However, if you are storing density values then you may want to take some care. The advantage of storing smoothly changing values - /// is that you can get smooth surfaces extracted, but storing smoothly changing values inside or outside objects (rather than just - /// on the boundary) does not benefit the surface and is very hard to compress effectively. You may wish to apply some thresholding to - /// your density values to reduce this problem (this threasholding should only be applied to voxels who don't contribute to the surface). - /// - /// Paging large volumes - /// -------------------- - /// The compression scheme described previously will typically allow you to load several billion voxels into a few hundred megabytes of memory, - /// though as explained the exact compression rate is highly dependant on your data. If you have more data than this then PolyVox provides a - /// mechanism by which parts of the volume can be paged out of memory by calling user supplied callback functions. This mechanism allows a + /// would contain 8x16x32 = 4096 chunks. Typically these chunks do not need to all be in memory all the time, and the Pager class can + /// be used to control how they are loaded and unloaded. This mechanism allows a /// potentially unlimited amount of data to be loaded, provided the user is able to take responsibility for storing any data which PolyVox /// cannot fit in memory, and then returning it back to PolyVox on demand. For example, the user might choose to temporarily store this data /// on disk or stream it to a remote database. /// - /// You can construct such a PagedVolume as follows: - /// - /// \code - /// void myDataRequiredHandler(const ConstVolumeProxy& volume, const PolyVox::Region& reg) - /// { - /// //This function is being called because part of the data is missing from memory and needs to be supplied. The parameter - /// //'volume' provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need fill. - /// } - /// - /// void myDataOverflowHandler(const ConstVolumeProxy& vol, const PolyVox::Region& reg) - /// { - /// //This function is being called because part of the data is about to be removed from memory. The parameter 'volume' - /// //provides access to the volume data, and the parameter 'reg' indicates which region of the volume you need to store. - /// } - /// - /// PagedVolumevolData(&myDataRequiredHandler, &myDataOverflowHandler); - /// \endcode - /// /// Essentially you are providing an extension to the PagedVolume class - a way for data to be stored once PolyVox has run out of memory for it. Note /// that you don't actually have to do anything with the data - you could simply decide that once it gets removed from memory it doesn't matter - /// anymore. But you still need to be ready to then provide something to PolyVox (even if it's just default data) in the event that it is requested. + /// anymore. /// /// Cache-aware traversal /// --------------------- + /// *NOTE: This needs updating for PagedVolume rather than the old LargeVolume* /// You might be suprised at just how many cache misses can occur when you traverse the volume in a naive manner. Consider a 1024x1024x1024 volume /// with chunks of size 32x32x32. And imagine you iterate over this volume with a simple three-level for loop which iterates over x, the y, then z. /// If you start at position (0,0,0) then ny the time you reach position (1023,0,0) you have touched 1024 voxels along one edge of the volume and /// have pulled 32 chunks into the cache. By the time you reach (1023,1023,0) you have hit 1024x1024 voxels and pulled 32x32 chunks into the cache. - /// You are now ready to touch voxel (0,0,1) which is right nect to where you started, but unless your cache is at least 32x32 chunks large then this + /// You are now ready to touch voxel (0,0,1) which is right next to where you started, but unless your cache is at least 32x32 chunks large then this /// initial chunk has already been cleared from the cache. /// /// Ensuring you have a large enough cache size can obviously help the above situation, but you might also consider iterating over the voxels in a /// different order. For example, if you replace your three-level loop with a six-level loop then you can first process all the voxels between (0,0,0) /// and (31,31,31), then process all the voxels between (32,0,0) and (63,0,0), and so forth. Using this approach you will have no cache misses even - /// is your cache sise is only one. Of course the logic is more complex, but writing code in such a cache-aware manner may be beneficial in some situations. + /// is your cache size is only one. Of course the logic is more complex, but writing code in such a cache-aware manner may be beneficial in some situations. /// /// Threading /// --------- From 3a56a70f38f9fab5262b9ae9ca98fc195a39ece8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 15:07:54 +0200 Subject: [PATCH 229/259] Put deprecated functions back in - lets remove them in the future after more thought. --- .../include/PolyVoxCore/PagedVolume.h | 10 ++- .../include/PolyVoxCore/PagedVolume.inl | 80 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index d0ed5d51..b014c9a3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -266,13 +266,21 @@ namespace PolyVox /// Gets a voxel at the position given by a 3D vector VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by x,y,z coordinates + POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; + /// Gets a voxel at the position given by a 3D vector + POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; + /// Sets the number of chunks for which uncompressed data is stored void setMemoryUsageLimit(uint32_t uMemoryUsageInBytes); /// Sets the voxel at the position given by x,y,z coordinates void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); /// Sets the voxel at the position given by a 3D vector void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - + /// Sets the voxel at the position given by x,y,z coordinates + bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); + /// Sets the voxel at the position given by a 3D vector + bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); /// Tries to ensure that the voxels within the specified Region are loaded into memory. void prefetch(Region regPrefetch); /// Ensures that any voxels within the specified Region are removed from memory. diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 9919da74..28babf13 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -203,6 +203,45 @@ namespace PolyVox return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); } + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) + { + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); + + auto pChunk = getChunk(chunkX, chunkY, chunkZ); + + return pChunk->getVoxel(xOffset, yOffset, zOffset); + } + else + { + return this->getBorderValue(); + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos The 3D position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType PagedVolume::getVoxelAt(const Vector3DInt32& v3dPos) const + { + return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); + } + //////////////////////////////////////////////////////////////////////////////// /// Increasing the size of the chunk cache will increase memory but may improve performance. /// You may want to set this to a large value (e.g. 1024) when you are first loading your @@ -283,6 +322,47 @@ namespace PolyVox setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); } + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool PagedVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) + { + // PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual. + POLYVOX_ASSERT(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region"); + + const int32_t chunkX = uXPos >> m_uChunkSideLengthPower; + const int32_t chunkY = uYPos >> m_uChunkSideLengthPower; + const int32_t chunkZ = uZPos >> m_uChunkSideLengthPower; + + const uint16_t xOffset = static_cast(uXPos - (chunkX << m_uChunkSideLengthPower)); + const uint16_t yOffset = static_cast(uYPos - (chunkY << m_uChunkSideLengthPower)); + const uint16_t zOffset = static_cast(uZPos - (chunkZ << m_uChunkSideLengthPower)); + + auto pChunk = getChunk(chunkX, chunkY, chunkZ); + + pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); + + //Return true to indicate that we modified a voxel. + return true; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool PagedVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) + { + return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); + } + + //////////////////////////////////////////////////////////////////////////////// /// Note that if the memory usage limit is not large enough to support the region this function will only load part of the region. In this case it is undefined which parts will actually be loaded. If all the voxels in the given region are already loaded, this function will not do anything. Other voxels might be unloaded to make space for the new voxels. /// \param regPrefetch The Region of voxels to prefetch into memory. From f95cc6bfcac0284ddad573883196405b841b96df Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 17:50:35 +0200 Subject: [PATCH 230/259] Added comments and warnings. --- documentation/Threading.rst | 4 +++- .../PolyVoxCore/include/PolyVoxCore/LargeVolume.h | 2 ++ .../PolyVoxCore/include/PolyVoxCore/PagedVolume.h | 13 +++++++++---- .../PolyVoxCore/include/PolyVoxCore/SimpleVolume.h | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/documentation/Threading.rst b/documentation/Threading.rst index c2d8991a..fc4d2245 100644 --- a/documentation/Threading.rst +++ b/documentation/Threading.rst @@ -27,8 +27,10 @@ C++ does provide the 'volatile' keyword which can be used to ensure a variable i Lastly, note that PolyVox volumes are templatised which means the voxel type might be something other than a simple int. However we don't think this actually makes a difference given that so few guarantees are made anyway, and it should still be safe to perform multiple concurrent reads for more complex types. -LargeVolume +PagedVolume ----------- +NOTE: The info below is based on LargeVolume, which PagedVolume has replaced. It is likely that the same limitations apply but this has not been well tested. We do intend to improve the thread safty of PagedVolume in the future. + The LargeVolume provides even less thread safety than the RawVolume, in that even concurrent read operations can cause problems. The reason for this is the more complex memory management which is performed behind the scenes, and which allows pieces of volume data to be moved around and deleted. For example, a read of a single voxel may mean that the block of data associated with that voxel has to be paged in to memory, which in turn may mean that another block of data has to be paged out of memory. If second thread was halfway through reading a voxel in this second block of data then a problem will occur. In the future we may do a more comprehensive analysis of thread safety in the LargeVolume, but for now you should assume that any multithreaded access can cause problems. diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index ff60e49f..a018e67c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -1,6 +1,8 @@ #ifndef __PolyVox_LargeVolume_H__ #define __PolyVox_LargeVolume_H__ +#pragma message("WARNING - The LargeVolume class has been replaced by PagedVolume. Please use that instead.") + #include "PagedVolume.h" #include "PolyVoxForwardDeclarations.h" diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index b014c9a3..848486e2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -118,6 +118,8 @@ namespace PolyVox class Chunk { + friend class PagedVolume; + public: Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); ~Chunk(); @@ -131,7 +133,7 @@ namespace PolyVox void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); - public: + private: /// Private copy constructor to prevent accisdental copying Chunk(const Chunk& /*rhs*/) {}; @@ -152,6 +154,8 @@ namespace PolyVox uint16_t m_uSideLength; uint8_t m_uSideLengthPower; Pager* m_pPager; + + // Note: Do we really need to store this position here as well as in the block maps? Vector3DInt32 m_v3dChunkSpacePosition; }; @@ -300,9 +304,7 @@ namespace PolyVox private: - typedef std::unordered_map > SharedPtrChunkMap; - typedef std::unordered_map > WeakPtrChunkMap; - + // FIXME - We can probably ove this into the constructor void initialise(); // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 @@ -328,6 +330,9 @@ namespace PolyVox // back in (not knowing the sampler still has it). This would result in two chunks in memory with the same position is space. // To avoid this, the 'all chunks' set tracks chunks with are used by the volume *and/or* the samplers. It holds weak pointers // so does not cause chunks to persist. + // + // TODO: Do we really need maps here? It means we are storing the chunk positions in the map, but they are also stored in the + // chunks themselves (so they can be passed to the pager from the chunks destructor). Can we use a set here? What is a better approach? typedef std::unordered_map > WeakPtrChunkMap; mutable WeakPtrChunkMap m_pAllChunks; typedef std::unordered_map > SharedPtrChunkMap; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index 9967d874..84ecd46b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -1,6 +1,8 @@ #ifndef __PolyVox_SimpleVolume_H__ #define __PolyVox_SimpleVolume_H__ +#pragma message("WARNING - The LargeVolume class has been replaced by PagedVolume. Please use that instead.") + #include "PagedVolume.h" #include "PolyVoxForwardDeclarations.h" From db2e62d2a8ed9c29ca4b46c6e5eaf5e253abdce9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 17:57:42 +0200 Subject: [PATCH 231/259] Replaced LargeVolume and SimpleVolume with PagedVolume in tests and examples. --- examples/Basic/main.cpp | 6 +++--- examples/DecodeOnGPU/main.cpp | 6 +++--- examples/OpenGL/Shapes.cpp | 4 ++-- examples/OpenGL/Shapes.h | 2 +- examples/OpenGL/main.cpp | 3 +-- examples/Paging/main.cpp | 4 ++-- examples/SmoothLOD/main.cpp | 14 +++++++------- .../PolyVoxCore/AmbientOcclusionCalculator.h | 4 ++-- .../include/PolyVoxCore/BaseVolume.h | 2 +- .../include/PolyVoxCore/BaseVolume.inl | 2 +- .../include/PolyVoxCore/SimpleVolume.h | 2 +- tests/TestAmbientOcclusionGenerator.cpp | 4 ++-- tests/TestCubicSurfaceExtractor.cpp | 16 ++++++++-------- tests/TestPicking.cpp | 4 ++-- tests/TestRaycast.cpp | 6 +++--- tests/TestSurfaceExtractor.cpp | 17 ++++++++--------- tests/testvolume.cpp | 6 +++--- 17 files changed, 50 insertions(+), 52 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index b697b189..a3fdbbd5 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -26,14 +26,14 @@ freely, subject to the following restrictions: #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(SimpleVolume& volData, float fRadius) +void createSphereInVolume(PagedVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) openGLWidget.show(); //Create an empty volume and then place a sphere in it - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 34c86bef..19ef97fd 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -26,14 +26,14 @@ freely, subject to the following restrictions: #include "PolyVoxCore/CubicSurfaceExtractor.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(SimpleVolume& volData, float fRadius) +void createSphereInVolume(PagedVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) openGLWidget.setShader(shader); //Create an empty volume and then place a sphere in it - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 7a66b988..419359d0 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: using namespace PolyVox; -void createSphereInVolume(LargeVolume& volData, float fRadius, uint8_t uValue) +void createSphereInVolume(PagedVolume& volData, float fRadius, uint8_t uValue) { //This vector hold the position of the center of the volume Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); @@ -55,7 +55,7 @@ void createSphereInVolume(LargeVolume& volData, float fRa } } -void createCubeInVolume(LargeVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) +void createCubeInVolume(PagedVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) { uint8_t maxDen = MaterialDensityPair88::getMaxDensity(); uint8_t minDen = MaterialDensityPair88::getMinDensity(); diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index 712558fd..25f2acfc 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __OpenGLExample_Shapes_H__ #define __OpenGLExample_Shapes_H__ -#include "PolyVoxCore/LargeVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/MaterialDensityPair.h" void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 9a36fac8..edd7cdbc 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -24,7 +24,6 @@ freely, subject to the following restrictions: #include "PolyVoxCore/FilePager.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/LargeVolume.h" #include "PolyVoxCore/LowPassFilter.h" #include "PolyVoxCore/RawVolume.h" #include "PolyVoxCore/Mesh.h" @@ -51,7 +50,7 @@ const int32_t g_uVolumeSideLength = 128; int main(int argc, char *argv[]) { FilePager* pager = new FilePager("."); - LargeVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); //Make our volume contain a sphere in the center. int32_t minPos = 0; diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index f70de28f..95c93972 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -35,7 +35,7 @@ freely, subject to the following restrictions: //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(LargeVolume& volData, Vector3DFloat v3dVolCenter, float fRadius) +void createSphereInVolume(PagedVolume& volData, Vector3DFloat v3dVolCenter, float fRadius) { //This vector hold the position of the center of the volume //Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) openGLWidget.show(); PerlinNoisePager* pager = new PerlinNoisePager(); - LargeVolume volData(PolyVox::Region::MaxRegion, pager, 64); + PagedVolume volData(PolyVox::Region::MaxRegion, pager, 64); volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb //createSphereInVolume(volData, 30); diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 0054c5ce..978f9935 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include "PolyVoxCore/Mesh.h" #include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/VolumeResampler.h" #include @@ -35,7 +35,7 @@ freely, subject to the following restrictions: //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(SimpleVolume& volData, float fRadius) +void createSphereInVolume(PagedVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -76,17 +76,17 @@ int main(int argc, char *argv[]) openGLWidget.show(); //Create an empty volume and then place a sphere in it - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 28); //Smooth the data - should reimplement this using LowPassFilter - //smoothRegion(volData, volData.getEnclosingRegion()); - //smoothRegion(volData, volData.getEnclosingRegion()); - //smoothRegion(volData, volData.getEnclosingRegion()); + //smoothRegion(volData, volData.getEnclosingRegion()); + //smoothRegion(volData, volData.getEnclosingRegion()); + //smoothRegion(volData, volData.getEnclosingRegion()); RawVolume volDataLowLOD(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(15, 31, 31))); - VolumeResampler< SimpleVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + VolumeResampler< PagedVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); volumeResampler.execute(); //Extract the surface diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h index 696d21e1..70a5d89d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h @@ -33,7 +33,7 @@ freely, subject to the following restrictions: //These two should not be here! #include "PolyVoxCore/Material.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include @@ -53,7 +53,7 @@ namespace PolyVox { } - bool operator()(const SimpleVolume::Sampler& sampler) + bool operator()(const PagedVolume::Sampler& sampler) { uint8_t sample = sampler.getVoxel(); bool func = mIsVoxelTransparentCallback(sample); diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h index 3f5f1c0f..84d46c9b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h @@ -32,7 +32,7 @@ freely, subject to the following restrictions: namespace PolyVox { /// The BaseVolume class provides common functionality and an interface for other volume classes to implement. You should not try to create an instance of this - /// class directly. Instead you should use RawVolume, SimpleVolume, or PagedVolume. + /// class directly. Instead you should use RawVolume or PagedVolume. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// More details to come... //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl index 7669a4ca..aeefc305 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl @@ -26,7 +26,7 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// /// This is protected because you should never create a BaseVolume directly, you should instead use one of the derived classes. /// - /// \sa RawVolume, SimpleVolume, PagedVolume + /// \sa RawVolume, PagedVolume //////////////////////////////////////////////////////////////////////////////// template BaseVolume::BaseVolume(const Region& regValid) diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index 84ecd46b..a97c7be3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -1,7 +1,7 @@ #ifndef __PolyVox_SimpleVolume_H__ #define __PolyVox_SimpleVolume_H__ -#pragma message("WARNING - The LargeVolume class has been replaced by PagedVolume. Please use that instead.") +#pragma message("WARNING - The SimpleVolume class has been replaced by PagedVolume. Please use that instead.") #include "PagedVolume.h" #include "PolyVoxForwardDeclarations.h" diff --git a/tests/TestAmbientOcclusionGenerator.cpp b/tests/TestAmbientOcclusionGenerator.cpp index cb077ec2..97ab7993 100644 --- a/tests/TestAmbientOcclusionGenerator.cpp +++ b/tests/TestAmbientOcclusionGenerator.cpp @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #include "TestAmbientOcclusionGenerator.h" #include "PolyVoxCore/AmbientOcclusionCalculator.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include @@ -49,7 +49,7 @@ void TestAmbientOcclusionGenerator::testExecute() const int32_t g_uVolumeSideLength = 64; //Create empty volume - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(g_uVolumeSideLength-1, g_uVolumeSideLength-1, g_uVolumeSideLength-1))); + PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1))); //Create two solid walls at opposite sides of the volume for (int32_t z = 0; z < g_uVolumeSideLength; z++) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 906a2e80..74182fda 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Material.h" #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/CubicSurfaceExtractor.h" #include @@ -128,26 +128,26 @@ VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength) void TestCubicSurfaceExtractor::testBehaviour() { // Test with default mesh and contoller types. - auto uint8Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); + auto uint8Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687)); QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234)); // Test with default mesh type but user-provided controller. - auto int8Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); + auto int8Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded()); QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29027)); QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178356)); // Test with default controller but user-provided mesh. - auto uint32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); + auto uint32Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234)); // Test with both mesh and controller being provided by the user. - auto int32Vol = createAndFillVolumeWithNoise< SimpleVolume >(32, 0, 2); + auto int32Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027)); @@ -156,7 +156,7 @@ void TestCubicSurfaceExtractor::testBehaviour() void TestCubicSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 0); + auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, 0, 0); Mesh< CubicVertex< uint32_t >, uint16_t > emptyMesh; QBENCHMARK{ extractCubicMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); @@ -164,7 +164,7 @@ void TestCubicSurfaceExtractor::testEmptyVolumePerformance() void TestCubicSurfaceExtractor::testRealisticVolumePerformance() { - auto realisticVol = createAndFillVolumeRealistic< SimpleVolume >(128); + auto realisticVol = createAndFillVolumeRealistic< PagedVolume >(128); Mesh< CubicVertex< uint32_t >, uint16_t > realisticMesh; QBENCHMARK{ extractCubicMeshCustom(realisticVol, Region(32, 32, 32, 63, 63, 63), &realisticMesh); } QCOMPARE(realisticMesh.getNoOfVertices(), uint16_t(2176)); @@ -172,7 +172,7 @@ void TestCubicSurfaceExtractor::testRealisticVolumePerformance() void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume >(128, 0, 2); + auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, 0, 2); Mesh< CubicVertex< uint32_t >, uint16_t > noiseMesh; QBENCHMARK{ extractCubicMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(57729)); diff --git a/tests/TestPicking.cpp b/tests/TestPicking.cpp index 6271d004..fa255b55 100644 --- a/tests/TestPicking.cpp +++ b/tests/TestPicking.cpp @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #include "TestPicking.h" #include "PolyVoxCore/Picking.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include @@ -34,7 +34,7 @@ void TestPicking::testExecute() { const int32_t uVolumeSideLength = 32; - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); + PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); for (int32_t z = 0; z < uVolumeSideLength; z++) { for (int32_t y = 0; y < uVolumeSideLength; y++) diff --git a/tests/TestRaycast.cpp b/tests/TestRaycast.cpp index 364bff04..a7b148fa 100644 --- a/tests/TestRaycast.cpp +++ b/tests/TestRaycast.cpp @@ -25,7 +25,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Density.h" #include "PolyVoxCore/Raycast.h" -#include "PolyVoxCore/SimpleVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/Impl/RandomUnitVectors.h" @@ -47,7 +47,7 @@ public: { } - bool operator()(const SimpleVolume::Sampler& sampler) + bool operator()(const PagedVolume::Sampler& sampler) { m_uVoxelsTouched++; @@ -73,7 +73,7 @@ void TestRaycast::testExecute() const int32_t uVolumeSideLength = 32; //Create a hollow volume, with solid sides on x and y but with open ends in z. - SimpleVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); + PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); for (int32_t z = 0; z < uVolumeSideLength; z++) { for (int32_t y = 0; y < uVolumeSideLength; y++) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 599281bb..9bf96a6c 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -27,8 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/FilePager.h" #include "PolyVoxCore/MaterialDensityPair.h" #include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/SimpleVolume.h" -#include "PolyVoxCore/LargeVolume.h" +#include "PolyVoxCore/PagedVolume.h" #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" #include @@ -173,7 +172,7 @@ void TestSurfaceExtractor::testBehaviour() // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. - auto uintVol = createAndFillVolume< LargeVolume >(); + auto uintVol = createAndFillVolume< PagedVolume >(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh @@ -181,7 +180,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type // This test makes use of a custom controller - auto floatVol = createAndFillVolume< LargeVolume >(); + auto floatVol = createAndFillVolume< PagedVolume >(); CustomMarchingCubesController floatCustomController; auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices @@ -191,7 +190,7 @@ void TestSurfaceExtractor::testBehaviour() // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us // use a default for the second-to-last parameter but noot use a default for the last parameter. - auto intVol = createAndFillVolume< LargeVolume >(); + auto intVol = createAndFillVolume< PagedVolume >(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices @@ -200,7 +199,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type // This test makes use of a user-provided mesh and also a custom controller. - auto doubleVol = createAndFillVolume< LargeVolume >(); + auto doubleVol = createAndFillVolume< PagedVolume >(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); @@ -210,7 +209,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type // This test ensures the extractor works on a non-primitive voxel type. - auto materialVol = createAndFillVolume< LargeVolume >(); + auto materialVol = createAndFillVolume< PagedVolume >(); auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh @@ -220,7 +219,7 @@ void TestSurfaceExtractor::testBehaviour() void TestSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise< LargeVolume >(128, -2.0f, -1.0f); + auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, -2.0f, -1.0f); Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); @@ -228,7 +227,7 @@ void TestSurfaceExtractor::testEmptyVolumePerformance() void TestSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise< LargeVolume >(128, -1.0f, 1.0f); + auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, -1.0f, 1.0f); Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index a8f8202b..3eafceb2 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -110,7 +110,7 @@ int32_t testSamplersWithWrappingForwards(VolumeType* volume, int lowXOffset, int xSampler = ySampler; for(int x = volume->getEnclosingRegion().getLowerX() + lowXOffset; x <= volume->getEnclosingRegion().getUpperX() + highXOffset; x++) { - xSampler.setPosition(x, y, z); // HACK - Accessing a volume through multiple samplers currently breaks the LargeVolume. + xSampler.setPosition(x, y, z); // HACK - Accessing a volume through multiple samplers currently breaks the PagedVolume. result = cantorTupleFunction(result, xSampler.peekVoxel1nx1ny1nz()); result = cantorTupleFunction(result, xSampler.peekVoxel0px1ny1nz()); @@ -223,7 +223,7 @@ int32_t testSamplersWithWrappingBackwards(VolumeType* volume, int lowXOffset, in xSampler = ySampler; for(int x = volume->getEnclosingRegion().getUpperX() + highXOffset; x >= volume->getEnclosingRegion().getLowerX() + lowXOffset; x--) { - xSampler.setPosition(x, y, z); // HACK - Accessing a volume through multiple samplers currently breaks the LargeVolume. + xSampler.setPosition(x, y, z); // HACK - Accessing a volume through multiple samplers currently breaks the PagedVolume. result = cantorTupleFunction(result, xSampler.peekVoxel1nx1ny1nz()); result = cantorTupleFunction(result, xSampler.peekVoxel0px1ny1nz()); @@ -273,7 +273,7 @@ TestVolume::TestVolume() //Create the volumes m_pRawVolume = new RawVolume(region); - m_pPagedVolume = new LargeVolume(region, m_pFilePager, 32); + m_pPagedVolume = new PagedVolume(region, m_pFilePager, 32); m_pPagedVolume->setMemoryUsageLimit(1 * 1024 * 1024); From 75df6621bd144801af4eacef4ca55152bfdd55db Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 21 Sep 2014 23:07:14 +0200 Subject: [PATCH 232/259] GCC fixes --- .../include/PolyVoxCore/PagedVolume.h | 4 +- tests/TestSurfaceExtractor.cpp | 456 +++++++++--------- 2 files changed, 230 insertions(+), 230 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 848486e2..adf27243 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -353,9 +353,9 @@ namespace PolyVox Pager* m_pPager; // Enough to make sure a chunks and it's neighbours can be loaded, with a few to spare. - static const uint32_t uMinPracticalNoOfChunks = 32; + const uint32_t uMinPracticalNoOfChunks = 32; // Should prevent multi-gigabyte volumes when chunk sizes are reasonable. - static const uint32_t uMaxPracticalNoOfChunks = 32768; + const uint32_t uMaxPracticalNoOfChunks = 32768; }; } diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 9bf96a6c..a3a70085 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -1,236 +1,236 @@ -/******************************************************************************* -Copyright (c) 2010 Matt Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "TestSurfaceExtractor.h" - -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" - -#include - -using namespace PolyVox; - -// Test our ability to modify the behaviour of the MarchingCubesSurfaceExtractor. This simple example only modifies -// the threshold (and actually this can be achieved by passing a parameter to the constructor of the -// DefaultMarchingCubesController) but you could implement custom behaviour in the other members -// if you wanted too. Actually, it's not clear if this ability is really useful because I can't think -// what you'd modify apart from the threshold but the ability is at least available. Also, the -// DefaultMarchingCubesController is templatised whereas this exmple shows that controllers don't -// have to be. -class CustomMarchingCubesController -{ -public: - typedef float DensityType; - typedef float MaterialType; - - float convertToDensity(float voxel) - { - return voxel; - } - - float convertToMaterial(float /*voxel*/) - { - return 1.0f; - } - - float blendMaterials(float /*a*/, float /*b*/, float /*weight*/) - { - return 1.0f; - } - - float getThreshold(void) - { - return 50.0f; - } -}; - -// These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. -// They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part -// of PolyVox, but they might be usful to other tests so we cold move them into a 'Tests.h' or something in the future. -template -void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) -{ - voxel = valueToWrite; -} - -template<> -void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setDensity(valueToWrite); -} - -template -void writeMaterialValueToVoxel(int /*valueToWrite*/, VoxelType& /*voxel*/) -{ - //Most types don't have a material - return; -} - -template<> -void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setMaterial(valueToWrite); -} - -template -VolumeType* createAndFillVolume(void) -{ - const int32_t uVolumeSideLength = 64; +/******************************************************************************* +Copyright (c) 2010 Matt Williams - FilePager* pager = new FilePager("."); - - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); - - // Fill - for (int32_t z = 0; z < uVolumeSideLength; z++) - { - for (int32_t y = 0; y < uVolumeSideLength; y++) - { - for (int32_t x = 0; x < uVolumeSideLength; x++) - { - // Create a density field which changes throughout the volume. It's - // zero in the lower corner and increasing as the coordinates increase. - VolumeType::VoxelType voxelValue; - writeDensityValueToVoxel(x + y + z, voxelValue); - writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); - volData->setVoxelAt(x, y, z, voxelValue); - } - } - } - - return volData; -} - -// From http://stackoverflow.com/a/5289624 +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "TestSurfaceExtractor.h" + +#include "PolyVoxCore/Density.h" +#include "PolyVoxCore/FilePager.h" +#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/RawVolume.h" +#include "PolyVoxCore/PagedVolume.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" + +#include + +using namespace PolyVox; + +// Test our ability to modify the behaviour of the MarchingCubesSurfaceExtractor. This simple example only modifies +// the threshold (and actually this can be achieved by passing a parameter to the constructor of the +// DefaultMarchingCubesController) but you could implement custom behaviour in the other members +// if you wanted too. Actually, it's not clear if this ability is really useful because I can't think +// what you'd modify apart from the threshold but the ability is at least available. Also, the +// DefaultMarchingCubesController is templatised whereas this exmple shows that controllers don't +// have to be. +class CustomMarchingCubesController +{ +public: + typedef float DensityType; + typedef float MaterialType; + + float convertToDensity(float voxel) + { + return voxel; + } + + float convertToMaterial(float /*voxel*/) + { + return 1.0f; + } + + float blendMaterials(float /*a*/, float /*b*/, float /*weight*/) + { + return 1.0f; + } + + float getThreshold(void) + { + return 50.0f; + } +}; + +// These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. +// They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part +// of PolyVox, but they might be usful to other tests so we cold move them into a 'Tests.h' or something in the future. +template +void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) +{ + voxel = valueToWrite; +} + +template<> +void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) +{ + voxel.setDensity(valueToWrite); +} + +template +void writeMaterialValueToVoxel(int /*valueToWrite*/, VoxelType& /*voxel*/) +{ + //Most types don't have a material + return; +} + +template<> +void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) +{ + voxel.setMaterial(valueToWrite); +} + +template +VolumeType* createAndFillVolume(void) +{ + const int32_t uVolumeSideLength = 64; + + FilePager* pager = new FilePager("."); + + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); + + // Fill + for (int32_t z = 0; z < uVolumeSideLength; z++) + { + for (int32_t y = 0; y < uVolumeSideLength; y++) + { + for (int32_t x = 0; x < uVolumeSideLength; x++) + { + // Create a density field which changes throughout the volume. It's + // zero in the lower corner and increasing as the coordinates increase. + typename VolumeType::VoxelType voxelValue; + writeDensityValueToVoxel(x + y + z, voxelValue); + writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); + volData->setVoxelAt(x, y, z, voxelValue); + } + } + } + + return volData; +} + +// From http://stackoverflow.com/a/5289624 float randomFloat(float a, float b) { float random = ((float)rand()) / (float)RAND_MAX; float diff = b - a; float r = random * diff; return a + r; -} - -template -VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) +} + +template +VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) { - FilePager* pager = new FilePager("."); - - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); - - // Seed generator for consistency between runs. - srand(12345); - - // Fill - for (int32_t z = 0; z < iVolumeSideLength; z++) - { - for (int32_t y = 0; y < iVolumeSideLength; y++) - { - for (int32_t x = 0; x < iVolumeSideLength; x++) - { - float voxelValue = randomFloat(minValue, maxValue); - volData->setVoxelAt(x, y, z, voxelValue); - } - } - } - - return volData; -} - -void TestSurfaceExtractor::testBehaviour() -{ - // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers - // and user-provided meshes to make sure these various combinations work as expected. - // - // It is also noted that the number of indices and vertices is varying quite significantly based on the voxel type. This seems unexpected, but could - // be explained if some overflow is occuring when writing data into the volume, causing volumes of different voxel types to have different distributions. - // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. - - // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. - auto uintVol = createAndFillVolume< PagedVolume >(); - auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); - QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh - QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices - QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type - - // This test makes use of a custom controller - auto floatVol = createAndFillVolume< PagedVolume >(); - CustomMarchingCubesController floatCustomController; - auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); - QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh - QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices - QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type - - // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us - // use a default for the second-to-last parameter but noot use a default for the last parameter. - auto intVol = createAndFillVolume< PagedVolume >(); - Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; - extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); - QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices - QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh - QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices - QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type - - // This test makes use of a user-provided mesh and also a custom controller. - auto doubleVol = createAndFillVolume< PagedVolume >(); - CustomMarchingCubesController doubleCustomController; - Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; - extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); - QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh - QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices - QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type - - // This test ensures the extractor works on a non-primitive voxel type. - auto materialVol = createAndFillVolume< PagedVolume >(); - auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); - QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh - QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices - QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex -} - -void TestSurfaceExtractor::testEmptyVolumePerformance() -{ - auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, -2.0f, -1.0f); - Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; - QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } - QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); -} - -void TestSurfaceExtractor::testNoiseVolumePerformance() -{ - auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, -1.0f, 1.0f); - Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; - QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } - QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); -} - -QTEST_MAIN(TestSurfaceExtractor) + FilePager* pager = new FilePager("."); + + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); + + // Seed generator for consistency between runs. + srand(12345); + + // Fill + for (int32_t z = 0; z < iVolumeSideLength; z++) + { + for (int32_t y = 0; y < iVolumeSideLength; y++) + { + for (int32_t x = 0; x < iVolumeSideLength; x++) + { + float voxelValue = randomFloat(minValue, maxValue); + volData->setVoxelAt(x, y, z, voxelValue); + } + } + } + + return volData; +} + +void TestSurfaceExtractor::testBehaviour() +{ + // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers + // and user-provided meshes to make sure these various combinations work as expected. + // + // It is also noted that the number of indices and vertices is varying quite significantly based on the voxel type. This seems unexpected, but could + // be explained if some overflow is occuring when writing data into the volume, causing volumes of different voxel types to have different distributions. + // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. + + // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. + auto uintVol = createAndFillVolume< PagedVolume >(); + auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); + QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type + + // This test makes use of a custom controller + auto floatVol = createAndFillVolume< PagedVolume >(); + CustomMarchingCubesController floatCustomController; + auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); + QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type + + // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us + // use a default for the second-to-last parameter but noot use a default for the last parameter. + auto intVol = createAndFillVolume< PagedVolume >(); + Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; + extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); + QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices + QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh + QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices + QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type + + // This test makes use of a user-provided mesh and also a custom controller. + auto doubleVol = createAndFillVolume< PagedVolume >(); + CustomMarchingCubesController doubleCustomController; + Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; + extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); + QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type + + // This test ensures the extractor works on a non-primitive voxel type. + auto materialVol = createAndFillVolume< PagedVolume >(); + auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); + QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex +} + +void TestSurfaceExtractor::testEmptyVolumePerformance() +{ + auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, -2.0f, -1.0f); + Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } + QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); +} + +void TestSurfaceExtractor::testNoiseVolumePerformance() +{ + auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, -1.0f, 1.0f); + Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } + QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); +} + +QTEST_MAIN(TestSurfaceExtractor) From c560e84be5fcd1f292de383669b92575a3cedf31 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 25 Sep 2014 22:31:13 +0200 Subject: [PATCH 233/259] Added gitattributes file for proper handling of line endings. --- .gitattributes | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..4fd74970 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,19 @@ +# Based on GitHub sample: https://help.github.com/articles/dealing-with-line-endings + +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.c text +*.cpp text +*.h text +*.inl text +*.txt text + +# Declare files that will always have CRLF line endings on checkout. +#*.sln text eol=crlf + +# Denote all files that are truly binary and should not be modified. +#*.png binary +#*.jpg binary \ No newline at end of file From 86357d66b735e57f670270753c03d22d68a5a15f Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 25 Sep 2014 22:38:01 +0200 Subject: [PATCH 234/259] Normalized line endings --- CHANGELOG.txt | 240 +- CMakeLists.txt | 246 +- CREDITS.txt | 12 +- CTestConfig.cmake | 56 +- INSTALL.txt | 258 +- LICENSE.TXT | 40 +- Packaging.cmake | 110 +- README.rst | 8 +- TODO.txt | 130 +- documentation/CMakeLists.txt | 98 +- documentation/FAQ.rst | 48 +- documentation/LevelOfDetail.rst | 96 +- documentation/Lighting.rst | 88 +- documentation/ModifyingTerrain.rst | 6 +- documentation/Prerequisites.rst | 74 +- documentation/TextureMapping.rst | 300 +- documentation/Threading.rst | 136 +- documentation/changelog.rst | 8 +- documentation/conf.in.py | 464 +- documentation/index.rst | 82 +- documentation/install.rst | 2 +- documentation/make.bat | 310 +- documentation/principles.rst | 28 +- documentation/tutorial1.rst | 330 +- examples/Basic/CMakeLists.txt | 148 +- examples/Basic/main.cpp | 172 +- examples/DecodeOnGPU/CMakeLists.txt | 150 +- examples/DecodeOnGPU/main.cpp | 316 +- examples/OpenGL/CMakeLists.txt | 154 +- examples/OpenGL/Shapes.cpp | 144 +- examples/OpenGL/Shapes.h | 64 +- examples/OpenGL/main.cpp | 292 +- examples/Paging/CMakeLists.txt | 158 +- examples/Paging/Perlin.cpp | 530 +- examples/Paging/Perlin.h | 128 +- examples/Paging/main.cpp | 372 +- examples/Python/CMakeLists.txt | 48 +- examples/SmoothLOD/CMakeLists.txt | 154 +- examples/SmoothLOD/main.cpp | 220 +- examples/common/OpenGLWidget.cpp | 390 +- examples/common/OpenGLWidget.h | 320 +- examples/common/glew/LICENSE.txt | 146 +- examples/common/glew/glew.cpp | 33944 +++++++-------- examples/common/glew/glew.h | 34264 ++++++++-------- examples/common/glew/glxew.h | 3274 +- examples/common/glew/wglew.h | 2794 +- library/CMakeLists.txt | 172 +- library/PolyVoxCore/CMakeLists.txt | 328 +- .../include/PolyVoxCore/AStarPathfinder.h | 390 +- .../include/PolyVoxCore/AStarPathfinder.inl | 702 +- .../PolyVoxCore/AmbientOcclusionCalculator.h | 164 +- .../AmbientOcclusionCalculator.inl | 272 +- .../PolyVoxCore/include/PolyVoxCore/Array.h | 384 +- .../include/PolyVoxCore/BaseVolume.h | 434 +- .../include/PolyVoxCore/BaseVolume.inl | 628 +- .../include/PolyVoxCore/BaseVolumeSampler.inl | 732 +- .../PolyVoxCore/CubicSurfaceExtractor.h | 432 +- .../PolyVoxCore/CubicSurfaceExtractor.inl | 620 +- .../include/PolyVoxCore/DefaultIsQuadNeeded.h | 98 +- .../PolyVoxCore/include/PolyVoxCore/Density.h | 382 +- .../include/PolyVoxCore/GradientEstimators.h | 128 +- .../PolyVoxCore/GradientEstimators.inl | 604 +- .../include/PolyVoxCore/Impl/Utility.h | 118 +- .../include/PolyVoxCore/IteratorController.h | 92 +- .../PolyVoxCore/IteratorController.inl | 126 +- .../include/PolyVoxCore/LargeVolume.h | 16 +- .../include/PolyVoxCore/LowPassFilter.h | 120 +- .../include/PolyVoxCore/LowPassFilter.inl | 510 +- .../MarchingCubesSurfaceExtractor.h | 230 +- .../MarchingCubesSurfaceExtractor.inl | 1274 +- .../include/PolyVoxCore/Material.h | 182 +- .../include/PolyVoxCore/MaterialDensityPair.h | 330 +- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 390 +- .../include/PolyVoxCore/RawVolume.h | 346 +- .../include/PolyVoxCore/RawVolume.inl | 780 +- .../include/PolyVoxCore/RawVolumeSampler.inl | 1010 +- .../PolyVoxCore/include/PolyVoxCore/Raycast.h | 206 +- .../include/PolyVoxCore/Raycast.inl | 356 +- .../PolyVoxCore/include/PolyVoxCore/Region.h | 922 +- .../include/PolyVoxCore/SimpleVolume.h | 16 +- .../PolyVoxCore/include/PolyVoxCore/Vector.h | 496 +- .../include/PolyVoxCore/Vector.inl | 1346 +- .../include/PolyVoxCore/VolumeResampler.h | 114 +- .../include/PolyVoxCore/VolumeResampler.inl | 276 +- .../include/PolyVoxCore/VoxelFilters.h | 74 +- .../PolyVoxCore/source/AStarPathfinder.cpp | 134 +- library/PolyVoxCore/source/Region.cpp | 1038 +- library/PolyVoxUtil/CMakeLists.txt | 184 +- library/PolyVoxUtil/source/Dummy.cpp | 32 +- library/bindings/Array.i | 20 +- library/bindings/CMakeLists.txt | 130 +- library/bindings/CubicSurfaceExtractor.i | 18 +- .../CubicSurfaceExtractorWithNormals.i | 16 +- library/bindings/MeshDecimator.i | 2 +- library/bindings/PolyVoxCore.i | 196 +- library/bindings/SimpleVolumeSampler.i | 16 +- library/bindings/SubArray.i | 16 +- library/bindings/SurfaceMesh.i | 38 +- library/bindings/TypeDef.i | 10 +- library/bindings/Vector.i | 242 +- library/bindings/VertexTypes.i | 24 +- tests/TestAStarPathfinder.cpp | 278 +- tests/TestArray.cpp | 254 +- tests/TestCubicSurfaceExtractor.cpp | 32 +- tests/TestSurfaceExtractor.cpp | 472 +- tests/TestVolumeSubclass.cpp | 384 +- 106 files changed, 50344 insertions(+), 50344 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d50bb57e..d466b177 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,120 +1,120 @@ -Changes for PolyVox version 0.3 -=============================== -This release has focused on... (some introduction here). - -This line was added just for testing. - -Voxel access ------------- -The getVoxelAt() and setVoxelAt() functions have been deprecated and replaced by getVoxel() and setVoxel(). These new functions provide more control over how edge cases are handled and can potentially be faster as well. Please see the 'Volumes' section of the user manual for more information about how voxel access should be performed. - -LargeVolume ------------ -Behaviour and interface of the LargeVolume has changed significantly and code which uses it will certainly need to be updated. Plese see the LargeVolume API docs for full details of how it now works. - -It is now possible to provide custom compressors for the data which is stored in a LargeVolume. Two compressor implementation are provided with PolyVox - RLECompressor which is suitable for cubic-style terrain, and MinizCompressor which uses the 'miniz' zlib implementation for smooth terrain or general purpose use. Users can provide their own implementation of the compressor interface if they wish. - -Note that the setCompressionEnabled() functionality has been removed and a compressor must always be provided when constructing the volume. The ability to disable compression was of questionable benefit and was complicating the logic in the code. - -The LargeVolume also supports custom paging code which can be supplied by providing a subclass of Pager and implementing the relevant methods. This replaces the dataRequiredHandler() and dataOverflowHandler() functions. - -These changes regarding compression and paging have also affected the LargeVolume constructors(s). Please see the API docs to see how they look now. - -Error Handling --------------- -PolyVox now has it's own POLYVOX_ASSERT() macro rather than using the standard assert(). This has some advantages such as allowing a message to be printed and providing file/line information, and it is also possible to enable/disable it independantly of whether you are making a debug or release build. - -A simple logging system has also been added, and the output can be redirected by user code. - -Please see the 'Error Handling' section of the user manual for more information about these changes. - -Volume wrap modes ------------------ -This release has seen a overhaul of the way PolyVox handles voxel positions which are outside of the volume. It used to be the case that you could specify a border value which would be returned whenever an out-of-volume access was performed, but this was not flexible enough for all use cases. You can now choose between different wrapping modes (border, clamp, etc) and apply them to both the volume itself or to samplers. If you have multiple samplers pointing at the same volume then you can choose to have different wrap modes for each of them. - -Within the Volume class the getVoxelAt() and setBorderValue() functions have been deprecated. Please see the 'Volumes' section of the user manual for more information about how voxel access should now be performed. - -Various algorithms have also been updated to allow wrap modes to be specified when executing them. - -Region class ------------- -The Region class has been tidied up and enhanced with new functionality. It now contains functions for growing and shrinking regions, as well as 'accumulate()' functions which ensure the Region contains a given point. The concept of an invalid region has also been introduced - this is one whose lower corner is greater than it's upper corner. - -Vector class ------------- -The Vector class has been tidied up. Most notably it now makes use of an 'OperationType' which is used for internal calculations and some results. The documentation has also been updated. - -Deprecated functionality ------------------------- -Vector::operator<() has been deprecated. It was only present to allow Vectors to be used as the key to an std::map, but it makes more sense for this to be specified seperatly as a std::map comparison function. This is now done in the OpenGLExample (search for VectorCompare). - -getVoxelAt() and setBorderValue() have been deprecated in the Volume class. See the section of this file on 'Volume wrap modes' for details. - -Removed functionality --------------------- -Functionality deprecated for the previous release has now been removed. This includes: - - - Region::getWidth() and related functions. You should now use Region::getWidthInVoxels() or Region::getWidthInCells. - - The MeshDecimator. We don't have a direct replacement for this so you should consider an alternative such as downsampling the volume or using an external mesh processing library. - - The SimpleInterface. This was primarily for the bindings, and we are making other efforts to get those working. - - Serialisation. You should implement any required serialisation yourself. - - This had a number of problems and was a little too high-level for PolyVox. You should implement change tracking yourself. - - -Changes for PolyVox version 0.2 -=============================== -This is the first revision for which we have produced a changelog, as we are now trying to streamline our development and release process. Hence this changelog entry is not going to be as structured as we hope they will be in the future. We're writing it from memory, rather than having carefully kept track of all the relevant changes as we made them. - -Deprecated functionality ------------------------- -The following functionality is considered deprecated in this release of PolyVox and will probably be removed in future versions. - -MeshDecimator: The mesh decimator was intended to reduce the amount of triangles in generated meshes but it has always had problems. It's far too slow and not very robust. For cubic meshes it is no longer needed anyway as the CubicSurfaceExtractor has built in decimation which is much more effective. For smooth (marching cubes) meshes there is no single alternative. You can consider downsampling the volume before you run the surface extractor (see the SmoothLODExample), and in the future we may add support for an external mesh processing library. - -SimpleInterface: This was added so that people could create volumes without knowing about templates, and also to provide a target which was easier to wrap with SWIG. But overall we'd rather focus on getting the real SWIG bindings to work. The SimpleInterface is also extremely limited in the functionality it provides. - -Serialisation: This is a difficult one. The current serialisation is rather old and only deals with loading/saving a whole volume at a time. It would make much more sense if it could serialise regions instead of whole volumes, and if it could handle compression. It would then be useful for serialising the data which is paged into and out of the LargeVolume, as well as other uses. Both these changes would likely require breaking the current format and interface. It is likely that serialisation will return to PolyVox in the future, but for now we would suggest just implementing your own. - -VolumeChangeTracker: The idea behind this was was to provide a utility class to help the user keep track of which regions have been modified so they know when they need the surface extractor to be run again. But overall we'd rather keep such higher level functionality in user code as there are multiple ways it can be implemented. The current implementation is also old and does not support very large/infinite volumes, for example. - -Refactor of basic voxel types ------------------------------ -Previous versions of PolyVox provided classes representing voxel data, such as MaterialDensityPair88. These classes were required to expose certain functions such as getDensity() and getMaterial(). This is no longer the case as now even primitive data types such as floats and ints can be used as voxels. You can also create new classes to represent voxel data and it is entirely up to you what kind of properties they have. - -As an example, imagine you might want to store lighting values in a volume and propagate them according to some algorithm you devise. In this case the voxel data has no concept of densities or materials and there is no need to provide them. Algorithms which conceptually operate on densities (such as the MarchingCubesSurfaceExtractor) will not be able to operate on your lighting data but this would not make sense anyway. - -Because algorithms now know nothing about the structure of the underlying voxels, some utility functions/classes are required. The principle is similar to the std::sort algorithm, which knows nothing about the type of data it is operating on but is told how to compare any two values via a comparator function object. In this sense, it will be useful to have an understanding of how algorithms such as std::sort are used. - -We have continued to provide the Density, Material, and MaterialDensityPair classes to ease the transition into the new system, but really they should just be considered as examples of how you might create your own voxel types. - -Some algorithms assume that basic mathematical operations can be applied to voxel types. For example, the LowPassFilter needs to compute the average of a set of voxels, and to do this it needs to be possible to add voxels together and divide by an integer. Obviously these operations are provided by primitive types, but it means that if you want to use the LowPassfilter on custom voxel types then these types need to provide operator+=, operator/=, etc. These have been added to the Density and MaterialDensityPair classes, but not to the Material class. This reflects the fact that applying a low pass filter to a material volume does not make conceptual sense. - -Changes to build system ------------------------ -In order to make the build system easier to use, a number of CMake variables were changed to be more consistent. See :doc:`install` for details on the new variable naming. - -Changes to CubicSurfaceExtractor --------------------------------- -The behaviour of the CubicSurfaceExtractor has been changed such that it no longer handles some edge cases. Because each generated quad lies between two voxels it can be unclear which region should 'own' a quad when the two voxels are from different regions. The previous version of the CubicSurfaceExtractor would attempt to handle this automatically, but as a result it was possible to get two quads existing at the same position in space. This can cause problems with transparency and with physics, as well as making it harder to decide which regions need to be updated when a voxel is changed. - -The new system simplifies the behaviour of this surface extractor but does require a bit of care on the part of the user. You should be clear on the rules controlling when quads are generated and to which regions they will belong. To aid with this we have significantly improved the API documentation for the CubicSurfaceExtractor so be sure to have a look. - -Changes to Raycast ------------------- -The raycasting functionality was previously in a class (Raycast) but now it is provided by standalone functions. This is basically because there is no need for it to be a class, and it complicated usage. The new functions are called 'raycastWithDirection' and 'raycastWithEndpoints' which helps remove the previous ambiguity regarding the meaning of the two vectors which are passed as parameters. - -The callback functionality (called for each processed voxel to determine whether to continue and also perform additional processing) is no longer implemented as an std::function. Instead the standard STL approach is used, in which a function or function object is used a a template parameter. This is faster than the std::function solution and should also be easier to integrate with other languages. - -Usage of the new raycasting is demonstrated by a unit test. - -Changes to AmbientOcclusionCalculator -------------------------------------- -The AmbientOcclusionCalculator has also been unclassed and is now called calculateAmbientOcclusion. The unit test has been updated to demonstrate the new usage. - -Changes to A* pathfinder ------------------------- -The A* pathfinder has always had different (but equally valid) results when building in Visual Studio vs. GCC. This is now fixed and results are consistent between platforms. - -Copy and move semantics ------------------------ -All volume classes now have protected copy constructors and assignment operators to prevent you from accidentally copying them (which is expensive). Look at the VolumeResampler if you really do want to copy some volume data. +Changes for PolyVox version 0.3 +=============================== +This release has focused on... (some introduction here). + +This line was added just for testing. + +Voxel access +------------ +The getVoxelAt() and setVoxelAt() functions have been deprecated and replaced by getVoxel() and setVoxel(). These new functions provide more control over how edge cases are handled and can potentially be faster as well. Please see the 'Volumes' section of the user manual for more information about how voxel access should be performed. + +LargeVolume +----------- +Behaviour and interface of the LargeVolume has changed significantly and code which uses it will certainly need to be updated. Plese see the LargeVolume API docs for full details of how it now works. + +It is now possible to provide custom compressors for the data which is stored in a LargeVolume. Two compressor implementation are provided with PolyVox - RLECompressor which is suitable for cubic-style terrain, and MinizCompressor which uses the 'miniz' zlib implementation for smooth terrain or general purpose use. Users can provide their own implementation of the compressor interface if they wish. + +Note that the setCompressionEnabled() functionality has been removed and a compressor must always be provided when constructing the volume. The ability to disable compression was of questionable benefit and was complicating the logic in the code. + +The LargeVolume also supports custom paging code which can be supplied by providing a subclass of Pager and implementing the relevant methods. This replaces the dataRequiredHandler() and dataOverflowHandler() functions. + +These changes regarding compression and paging have also affected the LargeVolume constructors(s). Please see the API docs to see how they look now. + +Error Handling +-------------- +PolyVox now has it's own POLYVOX_ASSERT() macro rather than using the standard assert(). This has some advantages such as allowing a message to be printed and providing file/line information, and it is also possible to enable/disable it independantly of whether you are making a debug or release build. + +A simple logging system has also been added, and the output can be redirected by user code. + +Please see the 'Error Handling' section of the user manual for more information about these changes. + +Volume wrap modes +----------------- +This release has seen a overhaul of the way PolyVox handles voxel positions which are outside of the volume. It used to be the case that you could specify a border value which would be returned whenever an out-of-volume access was performed, but this was not flexible enough for all use cases. You can now choose between different wrapping modes (border, clamp, etc) and apply them to both the volume itself or to samplers. If you have multiple samplers pointing at the same volume then you can choose to have different wrap modes for each of them. + +Within the Volume class the getVoxelAt() and setBorderValue() functions have been deprecated. Please see the 'Volumes' section of the user manual for more information about how voxel access should now be performed. + +Various algorithms have also been updated to allow wrap modes to be specified when executing them. + +Region class +------------ +The Region class has been tidied up and enhanced with new functionality. It now contains functions for growing and shrinking regions, as well as 'accumulate()' functions which ensure the Region contains a given point. The concept of an invalid region has also been introduced - this is one whose lower corner is greater than it's upper corner. + +Vector class +------------ +The Vector class has been tidied up. Most notably it now makes use of an 'OperationType' which is used for internal calculations and some results. The documentation has also been updated. + +Deprecated functionality +------------------------ +Vector::operator<() has been deprecated. It was only present to allow Vectors to be used as the key to an std::map, but it makes more sense for this to be specified seperatly as a std::map comparison function. This is now done in the OpenGLExample (search for VectorCompare). + +getVoxelAt() and setBorderValue() have been deprecated in the Volume class. See the section of this file on 'Volume wrap modes' for details. + +Removed functionality +-------------------- +Functionality deprecated for the previous release has now been removed. This includes: + + - Region::getWidth() and related functions. You should now use Region::getWidthInVoxels() or Region::getWidthInCells. + - The MeshDecimator. We don't have a direct replacement for this so you should consider an alternative such as downsampling the volume or using an external mesh processing library. + - The SimpleInterface. This was primarily for the bindings, and we are making other efforts to get those working. + - Serialisation. You should implement any required serialisation yourself. + - This had a number of problems and was a little too high-level for PolyVox. You should implement change tracking yourself. + + +Changes for PolyVox version 0.2 +=============================== +This is the first revision for which we have produced a changelog, as we are now trying to streamline our development and release process. Hence this changelog entry is not going to be as structured as we hope they will be in the future. We're writing it from memory, rather than having carefully kept track of all the relevant changes as we made them. + +Deprecated functionality +------------------------ +The following functionality is considered deprecated in this release of PolyVox and will probably be removed in future versions. + +MeshDecimator: The mesh decimator was intended to reduce the amount of triangles in generated meshes but it has always had problems. It's far too slow and not very robust. For cubic meshes it is no longer needed anyway as the CubicSurfaceExtractor has built in decimation which is much more effective. For smooth (marching cubes) meshes there is no single alternative. You can consider downsampling the volume before you run the surface extractor (see the SmoothLODExample), and in the future we may add support for an external mesh processing library. + +SimpleInterface: This was added so that people could create volumes without knowing about templates, and also to provide a target which was easier to wrap with SWIG. But overall we'd rather focus on getting the real SWIG bindings to work. The SimpleInterface is also extremely limited in the functionality it provides. + +Serialisation: This is a difficult one. The current serialisation is rather old and only deals with loading/saving a whole volume at a time. It would make much more sense if it could serialise regions instead of whole volumes, and if it could handle compression. It would then be useful for serialising the data which is paged into and out of the LargeVolume, as well as other uses. Both these changes would likely require breaking the current format and interface. It is likely that serialisation will return to PolyVox in the future, but for now we would suggest just implementing your own. + +VolumeChangeTracker: The idea behind this was was to provide a utility class to help the user keep track of which regions have been modified so they know when they need the surface extractor to be run again. But overall we'd rather keep such higher level functionality in user code as there are multiple ways it can be implemented. The current implementation is also old and does not support very large/infinite volumes, for example. + +Refactor of basic voxel types +----------------------------- +Previous versions of PolyVox provided classes representing voxel data, such as MaterialDensityPair88. These classes were required to expose certain functions such as getDensity() and getMaterial(). This is no longer the case as now even primitive data types such as floats and ints can be used as voxels. You can also create new classes to represent voxel data and it is entirely up to you what kind of properties they have. + +As an example, imagine you might want to store lighting values in a volume and propagate them according to some algorithm you devise. In this case the voxel data has no concept of densities or materials and there is no need to provide them. Algorithms which conceptually operate on densities (such as the MarchingCubesSurfaceExtractor) will not be able to operate on your lighting data but this would not make sense anyway. + +Because algorithms now know nothing about the structure of the underlying voxels, some utility functions/classes are required. The principle is similar to the std::sort algorithm, which knows nothing about the type of data it is operating on but is told how to compare any two values via a comparator function object. In this sense, it will be useful to have an understanding of how algorithms such as std::sort are used. + +We have continued to provide the Density, Material, and MaterialDensityPair classes to ease the transition into the new system, but really they should just be considered as examples of how you might create your own voxel types. + +Some algorithms assume that basic mathematical operations can be applied to voxel types. For example, the LowPassFilter needs to compute the average of a set of voxels, and to do this it needs to be possible to add voxels together and divide by an integer. Obviously these operations are provided by primitive types, but it means that if you want to use the LowPassfilter on custom voxel types then these types need to provide operator+=, operator/=, etc. These have been added to the Density and MaterialDensityPair classes, but not to the Material class. This reflects the fact that applying a low pass filter to a material volume does not make conceptual sense. + +Changes to build system +----------------------- +In order to make the build system easier to use, a number of CMake variables were changed to be more consistent. See :doc:`install` for details on the new variable naming. + +Changes to CubicSurfaceExtractor +-------------------------------- +The behaviour of the CubicSurfaceExtractor has been changed such that it no longer handles some edge cases. Because each generated quad lies between two voxels it can be unclear which region should 'own' a quad when the two voxels are from different regions. The previous version of the CubicSurfaceExtractor would attempt to handle this automatically, but as a result it was possible to get two quads existing at the same position in space. This can cause problems with transparency and with physics, as well as making it harder to decide which regions need to be updated when a voxel is changed. + +The new system simplifies the behaviour of this surface extractor but does require a bit of care on the part of the user. You should be clear on the rules controlling when quads are generated and to which regions they will belong. To aid with this we have significantly improved the API documentation for the CubicSurfaceExtractor so be sure to have a look. + +Changes to Raycast +------------------ +The raycasting functionality was previously in a class (Raycast) but now it is provided by standalone functions. This is basically because there is no need for it to be a class, and it complicated usage. The new functions are called 'raycastWithDirection' and 'raycastWithEndpoints' which helps remove the previous ambiguity regarding the meaning of the two vectors which are passed as parameters. + +The callback functionality (called for each processed voxel to determine whether to continue and also perform additional processing) is no longer implemented as an std::function. Instead the standard STL approach is used, in which a function or function object is used a a template parameter. This is faster than the std::function solution and should also be easier to integrate with other languages. + +Usage of the new raycasting is demonstrated by a unit test. + +Changes to AmbientOcclusionCalculator +------------------------------------- +The AmbientOcclusionCalculator has also been unclassed and is now called calculateAmbientOcclusion. The unit test has been updated to demonstrate the new usage. + +Changes to A* pathfinder +------------------------ +The A* pathfinder has always had different (but equally valid) results when building in Visual Studio vs. GCC. This is now fixed and results are consistent between platforms. + +Copy and move semantics +----------------------- +All volume classes now have protected copy constructors and assignment operators to prevent you from accidentally copying them (which is expensive). Look at the VolumeResampler if you really do want to copy some volume data. diff --git a/CMakeLists.txt b/CMakeLists.txt index ae1cdeb0..eb6c583f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,123 +1,123 @@ -# Copyright (c) 2007-2012 Matt Williams -# Copyright (c) 2007-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6) - -PROJECT(PolyVox) - -SET(POLYVOX_VERSION_MAJOR "0") -SET(POLYVOX_VERSION_MINOR "2") -SET(POLYVOX_VERSION_PATCH "1") -SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}" CACHE STRING "PolyVox version") -MARK_AS_ADVANCED(FORCE POLYVOX_VERSION) - -SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) -include(FeatureSummary) - -FIND_PACKAGE(Doxygen) -OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) - -SET(LIBRARY_TYPE "DYNAMIC" CACHE STRING "Should the library be STATIC or DYNAMIC") -SET_PROPERTY(CACHE LIBRARY_TYPE PROPERTY STRINGS DYNAMIC STATIC) -IF(WIN32) - SET(LIBRARY_TYPE "STATIC") -ENDIF() - -# Qt is required for building the tests, the example and optionally for bundling the documentation -FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) -INCLUDE(${QT_USE_FILE}) -if(CMAKE_VERSION VERSION_LESS "2.8.6") - set_package_info(Doxygen "API documentation generator" http://www.doxygen.org "Building the API documentation") - set_package_info(Qt4 "C++ framework" http://qt-project.org "Building the examples and tests") -else() - set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") - set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) - set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") - set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") -endif() - - -IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW" - ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode -ENDIF() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode -endif() - -ADD_SUBDIRECTORY(library) - -OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) -IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) - ADD_SUBDIRECTORY(examples/common) - ADD_SUBDIRECTORY(examples/Basic) - ADD_SUBDIRECTORY(examples/Paging) - ADD_SUBDIRECTORY(examples/OpenGL) - ADD_SUBDIRECTORY(examples/SmoothLOD) - ADD_SUBDIRECTORY(examples/DecodeOnGPU) - ADD_SUBDIRECTORY(examples/Python) - SET(BUILD_EXAMPLES ON) -ELSE() - SET(BUILD_EXAMPLES OFF) -ENDIF() - -INCLUDE(Packaging.cmake) - -OPTION(ENABLE_TESTS "Should the tests be built" ON) -IF(ENABLE_TESTS AND QT_QTTEST_FOUND) - INCLUDE(CTest) - MARK_AS_ADVANCED(FORCE BUILD_TESTING) - ADD_SUBDIRECTORY(tests) - SET(BUILD_TESTS ON) -ELSE() - SET(BUILD_TESTS OFF) -ENDIF() - -#Check if we will building _and_ bundling the docs -IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) - SET(BUILD_AND_BUNDLE_DOCS ON) -ELSE() - SET(BUILD_AND_BUNDLE_DOCS OFF) -ENDIF() - -ADD_SUBDIRECTORY(documentation) - -add_feature_info("Examples" BUILD_EXAMPLES "Examples of PolyVox usage") -add_feature_info("Tests" BUILD_TESTS "Unit tests") -add_feature_info("Bindings" BUILD_BINDINGS "SWIG bindings") -add_feature_info("API docs" DOXYGEN_FOUND "HTML documentation of the API") -add_feature_info("Qt Help" BUILD_AND_BUNDLE_DOCS "API docs in Qt Help format") -add_feature_info("Manual" BUILD_MANUAL "HTML user's manual") - -feature_summary(WHAT ALL) - -# Option summary -MESSAGE(STATUS "") -MESSAGE(STATUS "Summary") -MESSAGE(STATUS "-------") -MESSAGE(STATUS "Library type: " ${LIBRARY_TYPE}) -MESSAGE(STATUS "Build examples: " ${BUILD_EXAMPLES}) -MESSAGE(STATUS "Build tests: " ${BUILD_TESTS}) -MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS}) -MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND}) -MESSAGE(STATUS " - Qt Help bundling: " ${BUILD_AND_BUNDLE_DOCS}) -MESSAGE(STATUS "Build manual: " ${BUILD_MANUAL}) -MESSAGE(STATUS "") +# Copyright (c) 2007-2012 Matt Williams +# Copyright (c) 2007-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6) + +PROJECT(PolyVox) + +SET(POLYVOX_VERSION_MAJOR "0") +SET(POLYVOX_VERSION_MINOR "2") +SET(POLYVOX_VERSION_PATCH "1") +SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}" CACHE STRING "PolyVox version") +MARK_AS_ADVANCED(FORCE POLYVOX_VERSION) + +SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) +include(FeatureSummary) + +FIND_PACKAGE(Doxygen) +OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) + +SET(LIBRARY_TYPE "DYNAMIC" CACHE STRING "Should the library be STATIC or DYNAMIC") +SET_PROPERTY(CACHE LIBRARY_TYPE PROPERTY STRINGS DYNAMIC STATIC) +IF(WIN32) + SET(LIBRARY_TYPE "STATIC") +ENDIF() + +# Qt is required for building the tests, the example and optionally for bundling the documentation +FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) +INCLUDE(${QT_USE_FILE}) +if(CMAKE_VERSION VERSION_LESS "2.8.6") + set_package_info(Doxygen "API documentation generator" http://www.doxygen.org "Building the API documentation") + set_package_info(Qt4 "C++ framework" http://qt-project.org "Building the examples and tests") +else() + set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") + set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) + set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") + set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") +endif() + + +IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW" + ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode +ENDIF() +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode +endif() + +ADD_SUBDIRECTORY(library) + +OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) +IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) + ADD_SUBDIRECTORY(examples/common) + ADD_SUBDIRECTORY(examples/Basic) + ADD_SUBDIRECTORY(examples/Paging) + ADD_SUBDIRECTORY(examples/OpenGL) + ADD_SUBDIRECTORY(examples/SmoothLOD) + ADD_SUBDIRECTORY(examples/DecodeOnGPU) + ADD_SUBDIRECTORY(examples/Python) + SET(BUILD_EXAMPLES ON) +ELSE() + SET(BUILD_EXAMPLES OFF) +ENDIF() + +INCLUDE(Packaging.cmake) + +OPTION(ENABLE_TESTS "Should the tests be built" ON) +IF(ENABLE_TESTS AND QT_QTTEST_FOUND) + INCLUDE(CTest) + MARK_AS_ADVANCED(FORCE BUILD_TESTING) + ADD_SUBDIRECTORY(tests) + SET(BUILD_TESTS ON) +ELSE() + SET(BUILD_TESTS OFF) +ENDIF() + +#Check if we will building _and_ bundling the docs +IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) + SET(BUILD_AND_BUNDLE_DOCS ON) +ELSE() + SET(BUILD_AND_BUNDLE_DOCS OFF) +ENDIF() + +ADD_SUBDIRECTORY(documentation) + +add_feature_info("Examples" BUILD_EXAMPLES "Examples of PolyVox usage") +add_feature_info("Tests" BUILD_TESTS "Unit tests") +add_feature_info("Bindings" BUILD_BINDINGS "SWIG bindings") +add_feature_info("API docs" DOXYGEN_FOUND "HTML documentation of the API") +add_feature_info("Qt Help" BUILD_AND_BUNDLE_DOCS "API docs in Qt Help format") +add_feature_info("Manual" BUILD_MANUAL "HTML user's manual") + +feature_summary(WHAT ALL) + +# Option summary +MESSAGE(STATUS "") +MESSAGE(STATUS "Summary") +MESSAGE(STATUS "-------") +MESSAGE(STATUS "Library type: " ${LIBRARY_TYPE}) +MESSAGE(STATUS "Build examples: " ${BUILD_EXAMPLES}) +MESSAGE(STATUS "Build tests: " ${BUILD_TESTS}) +MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS}) +MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND}) +MESSAGE(STATUS " - Qt Help bundling: " ${BUILD_AND_BUNDLE_DOCS}) +MESSAGE(STATUS "Build manual: " ${BUILD_MANUAL}) +MESSAGE(STATUS "") diff --git a/CREDITS.txt b/CREDITS.txt index 35f5a606..0b49de4f 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,7 +1,7 @@ -David Williams - Lead programmer. -Matthew Williams - Linux port, build system, support and maintenance. -Oliver Schneider - Very large Volumes - -Acknowledgements ----------------- +David Williams - Lead programmer. +Matthew Williams - Linux port, build system, support and maintenance. +Oliver Schneider - Very large Volumes + +Acknowledgements +---------------- PolyVox uses the 'miniz' for data compression. 'miniz' is public domain software and does not affect the license of PolyVox or of code using PolyVox. More details here: http://code.google.com/p/miniz/ \ No newline at end of file diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 594c47f3..31b87c0c 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,28 +1,28 @@ -# Copyright (c) 2010-2012 Matt Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -set(CTEST_PROJECT_NAME "PolyVox") -set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=PolyVox") -set(CTEST_DROP_SITE_CDASH TRUE) +# Copyright (c) 2010-2012 Matt Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +set(CTEST_PROJECT_NAME "PolyVox") +set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "my.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PolyVox") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/INSTALL.txt b/INSTALL.txt index bcbf500c..6a4ac20d 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,129 +1,129 @@ -**************** -Building PolyVox -**************** - -Requirements -============ - -To build PolyVox you need: - -* `CMake `_ 2.8.3 or greater -* A C++ compiler with support for some C++0x features (GCC 4.3 or VC 2010 seem to work) - -With the following optional packages: - -* `Qt `_ for building the tests and the example applications - * ``qcollectiongenerator`` which comes with Qt Assistant is used for bundling the docs for installation -* `Doxygen `_ for building the documentation. Version 1.5.7 is needed to build the Qt Assistant docs. 1.7.0 or greater is recommended -* `Python `_, `Sphinx `_ and `PyParsing `_ for generating the PolyVox manual in HTML -* `Python development libraries `_, `SWIG `_ for generating the Python bindings - -Linux -===== - -Navigate to the PolyVox source directory (the directory containing ``INSTALL.txt`` etc.) with and then enter the build directory with:: - - cd build - -CMake ------ - -Now, we use CMake to generate the makefiles with:: - - cmake .. - -The ``..`` tells CMake to look in the parent directory for the source. - -By default this will set it to be installed in ``/usr/local`` so if you want to install it elsewhere, set the ``CMAKE_INSTALL_PREFIX`` variable to the path you want to install to. - -You can set CMake variables by passing ``-D:=`` to the ``cmake`` command (the ``:`` part is optional but recommended). For example, to set the install prefix, pass:: - - -DCMAKE_INSTALL_PREFIX:PATH=/whatever/you/want - -The other available settings for PolyVox are: - -``ENABLE_EXAMPLES`` (``ON`` or ``OFF``) - Build the example applications that come with PolyVox. Defaults to ``ON``. - -``ENABLE_TESTS`` (``ON`` or ``OFF``) - Build the test applications that come with PolyVox. Running the tests is detailed in the next section. Defaults to ``ON``. - -``ENABLE_BINDINGS`` (``ON`` or ``OFF``) - Should the Python bindings to PolyVox be built. This requires the Python development libraries and SWIG to be installed. Defaults to ``ON``. - -``LIBRARY_TYPE`` (``DYNAMIC`` or ``STATIC``) - Choose whether static (``.a``) or dynamic libraries (``.so``) should be built. On Linux ``DYNAMIC`` is the default and on Windows ``STATIC`` is the default. - -``CMAKE_BUILD_TYPE`` (``Debug``, ``Release``, ``RelWithDebInfo`` or ``MinSizeRel``) - String option to set the type of build. This will automatically set some compilation flags such as the optimisation level or define ``NDEBUG``. - - For development work against the library - Use ``Debug`` or ``RelWithDebInfo`` - - For your final version - Use ``Release`` - - For building packages (e.g. for Linux distributions) - Use ``RelWithDebInfo`` - -Building and installing ------------------------ - -Once this has completed successfully, simply run:: - - make install - -and all should work. - -Testing -------- - -To run the tests you do not need to have run ``make install``. Simply run:: - - make - make test - -API Documentation ------------------ - -If you want to generate the API documentation, you'll need Doxygen installed. If you saw ``API Docs available: YES`` at the end of the CMake output then you're all set. To generate the docs, just run:: - - make doc - -and the documentation can be browsed in plain HTML form at ``/library/doc/html/index.html``. - -On top of this, if ``qcollectiongenerator`` is installed, PolyVox can also compile and install this documentation as a *Qt Help Collection* file to ``/share/doc/packages/polyvox/qthelp/polyvox.qhc`` (this file is in the build directory as ``/library/doc/qthelp/polyvox.qhc``). To view this file you need Qt Assistant installed. You can open it with:: - - assistant -collectionFile library/doc/qthelp/polyvox.qhc - -This allows indexed searching of the documentation and easier browsing. - -Manual ------- - -As well as the API documentation, PolyVox also provides a user manual. This is written using `Sphinx `_ and so to convert the documentation sources to HTML requires Sphinx and Python to be installed. If these are installed and found then you will see ``Build manual: YES`` in the CMake summary output. If this is the case then just run:: - - make manual - -and the HTML manual will be available at ``/documentation/index.html``. - -If you have Sphinx installed but you do not get the confirmation in the CMake output, you may need to set ``SPHINXBUILD_EXECUTABLE`` to the location of your ``sphinx-build`` executable. - -If you do not have Python and Sphinx installed and do not want to install them then the manual is just plain text (``.rst`` files) which are readable in their plain form in the ``documentation`` directory of the source distribution. - -Windows -======= - -For information about the dependencies, CMake configuration variables and buildable targets look at the Linux build information in the section above. - -CMake ------ - -You need CMake installed so get the binary distribution from `CMake.org `_. Install it and run the CMake GUI. - -Point the source directory to the directory holding this file and the build directory to the ``build`` subdirectory. Then, click the ``Configure`` button. Click through the dialog box that appears and once you've clicked ``Finish`` you should see text appearing in the bottom text area. Once this has finished, some options will appear in the top area. The purpose of these options in detailed in the Linux→CMake section above. Once you have set these options to what you please, click ``Configure`` again. If it completes without errors then you can click ``Generate`` which will generate your compilers project files in the build directory. - -Building --------- - -Open the project files in your IDE and build the project as you normally would. +**************** +Building PolyVox +**************** + +Requirements +============ + +To build PolyVox you need: + +* `CMake `_ 2.8.3 or greater +* A C++ compiler with support for some C++0x features (GCC 4.3 or VC 2010 seem to work) + +With the following optional packages: + +* `Qt `_ for building the tests and the example applications + * ``qcollectiongenerator`` which comes with Qt Assistant is used for bundling the docs for installation +* `Doxygen `_ for building the documentation. Version 1.5.7 is needed to build the Qt Assistant docs. 1.7.0 or greater is recommended +* `Python `_, `Sphinx `_ and `PyParsing `_ for generating the PolyVox manual in HTML +* `Python development libraries `_, `SWIG `_ for generating the Python bindings + +Linux +===== + +Navigate to the PolyVox source directory (the directory containing ``INSTALL.txt`` etc.) with and then enter the build directory with:: + + cd build + +CMake +----- + +Now, we use CMake to generate the makefiles with:: + + cmake .. + +The ``..`` tells CMake to look in the parent directory for the source. + +By default this will set it to be installed in ``/usr/local`` so if you want to install it elsewhere, set the ``CMAKE_INSTALL_PREFIX`` variable to the path you want to install to. + +You can set CMake variables by passing ``-D:=`` to the ``cmake`` command (the ``:`` part is optional but recommended). For example, to set the install prefix, pass:: + + -DCMAKE_INSTALL_PREFIX:PATH=/whatever/you/want + +The other available settings for PolyVox are: + +``ENABLE_EXAMPLES`` (``ON`` or ``OFF``) + Build the example applications that come with PolyVox. Defaults to ``ON``. + +``ENABLE_TESTS`` (``ON`` or ``OFF``) + Build the test applications that come with PolyVox. Running the tests is detailed in the next section. Defaults to ``ON``. + +``ENABLE_BINDINGS`` (``ON`` or ``OFF``) + Should the Python bindings to PolyVox be built. This requires the Python development libraries and SWIG to be installed. Defaults to ``ON``. + +``LIBRARY_TYPE`` (``DYNAMIC`` or ``STATIC``) + Choose whether static (``.a``) or dynamic libraries (``.so``) should be built. On Linux ``DYNAMIC`` is the default and on Windows ``STATIC`` is the default. + +``CMAKE_BUILD_TYPE`` (``Debug``, ``Release``, ``RelWithDebInfo`` or ``MinSizeRel``) + String option to set the type of build. This will automatically set some compilation flags such as the optimisation level or define ``NDEBUG``. + + For development work against the library + Use ``Debug`` or ``RelWithDebInfo`` + + For your final version + Use ``Release`` + + For building packages (e.g. for Linux distributions) + Use ``RelWithDebInfo`` + +Building and installing +----------------------- + +Once this has completed successfully, simply run:: + + make install + +and all should work. + +Testing +------- + +To run the tests you do not need to have run ``make install``. Simply run:: + + make + make test + +API Documentation +----------------- + +If you want to generate the API documentation, you'll need Doxygen installed. If you saw ``API Docs available: YES`` at the end of the CMake output then you're all set. To generate the docs, just run:: + + make doc + +and the documentation can be browsed in plain HTML form at ``/library/doc/html/index.html``. + +On top of this, if ``qcollectiongenerator`` is installed, PolyVox can also compile and install this documentation as a *Qt Help Collection* file to ``/share/doc/packages/polyvox/qthelp/polyvox.qhc`` (this file is in the build directory as ``/library/doc/qthelp/polyvox.qhc``). To view this file you need Qt Assistant installed. You can open it with:: + + assistant -collectionFile library/doc/qthelp/polyvox.qhc + +This allows indexed searching of the documentation and easier browsing. + +Manual +------ + +As well as the API documentation, PolyVox also provides a user manual. This is written using `Sphinx `_ and so to convert the documentation sources to HTML requires Sphinx and Python to be installed. If these are installed and found then you will see ``Build manual: YES`` in the CMake summary output. If this is the case then just run:: + + make manual + +and the HTML manual will be available at ``/documentation/index.html``. + +If you have Sphinx installed but you do not get the confirmation in the CMake output, you may need to set ``SPHINXBUILD_EXECUTABLE`` to the location of your ``sphinx-build`` executable. + +If you do not have Python and Sphinx installed and do not want to install them then the manual is just plain text (``.rst`` files) which are readable in their plain form in the ``documentation`` directory of the source distribution. + +Windows +======= + +For information about the dependencies, CMake configuration variables and buildable targets look at the Linux build information in the section above. + +CMake +----- + +You need CMake installed so get the binary distribution from `CMake.org `_. Install it and run the CMake GUI. + +Point the source directory to the directory holding this file and the build directory to the ``build`` subdirectory. Then, click the ``Configure`` button. Click through the dialog box that appears and once you've clicked ``Finish`` you should see text appearing in the bottom text area. Once this has finished, some options will appear in the top area. The purpose of these options in detailed in the Linux→CMake section above. Once you have set these options to what you please, click ``Configure`` again. If it completes without errors then you can click ``Generate`` which will generate your compilers project files in the build directory. + +Building +-------- + +Open the project files in your IDE and build the project as you normally would. diff --git a/LICENSE.TXT b/LICENSE.TXT index 61903df9..eaa22dde 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,20 +1,20 @@ -Copyright (c) 2005-2012 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. +Copyright (c) 2005-2012 David Williams and Matthew Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. diff --git a/Packaging.cmake b/Packaging.cmake index c8546080..dbe679d9 100644 --- a/Packaging.cmake +++ b/Packaging.cmake @@ -1,55 +1,55 @@ -# Copyright (c) 2009-2012 Matt Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -#INCLUDE(InstallRequiredSystemLibraries) - -SET(CPACK_PACKAGE_NAME "PolyVox SDK") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PolyVox SDK") -SET(CPACK_PACKAGE_VENDOR "Thermite 3D Team") -#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") -#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") -SET(CPACK_PACKAGE_VERSION_MAJOR ${POLYVOX_VERSION_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${POLYVOX_VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${POLYVOX_VERSION_PATCH}) -SET(CPACK_PACKAGE_INSTALL_DIRECTORY "PolyVox SDK ${POLYVOX_VERSION}") -IF(WIN32 AND NOT UNIX) - # There is a bug in NSIS that does not handle full unix paths properly. - # Make sure there is at least one set of four backslashes. - #SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp") - #SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe") - SET(CPACK_NSIS_DISPLAY_NAME "PolyVox SDK ${POLYVOX_VERSION}") - SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\thermite3d.org/phpBB/") - SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\thermite3d.org") - SET(CPACK_NSIS_CONTACT "matt@milliams.com") - SET(CPACK_NSIS_MODIFY_PATH ON) -ELSE(WIN32 AND NOT UNIX) - #SET(CPACK_STRIP_FILES "bin/MyExecutable") - #SET(CPACK_SOURCE_STRIP_FILES "") -ENDIF(WIN32 AND NOT UNIX) -#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") - -INCLUDE(CPack) - -CPACK_ADD_COMPONENT(library DISPLAY_NAME "Library" DESCRIPTION "The runtime libraries" REQUIRED) -CPACK_ADD_COMPONENT(development DISPLAY_NAME "Development" DESCRIPTION "Files required for developing with PolyVox" DEPENDS library) -CPACK_ADD_COMPONENT(example DISPLAY_NAME "OpenGL Example" DESCRIPTION "A PolyVox example application using OpenGL" DEPENDS library) -cpack_add_component_group(bindings DISPLAY_NAME "Bindings" DESCRIPTION "Language bindings") -CPACK_ADD_COMPONENT(python DISPLAY_NAME "Python Bindings" DESCRIPTION "PolyVox bindings for the Python language" DISABLED GROUP bindings DEPENDS library) +# Copyright (c) 2009-2012 Matt Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +#INCLUDE(InstallRequiredSystemLibraries) + +SET(CPACK_PACKAGE_NAME "PolyVox SDK") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PolyVox SDK") +SET(CPACK_PACKAGE_VENDOR "Thermite 3D Team") +#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") +#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") +SET(CPACK_PACKAGE_VERSION_MAJOR ${POLYVOX_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${POLYVOX_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${POLYVOX_VERSION_PATCH}) +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "PolyVox SDK ${POLYVOX_VERSION}") +IF(WIN32 AND NOT UNIX) + # There is a bug in NSIS that does not handle full unix paths properly. + # Make sure there is at least one set of four backslashes. + #SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp") + #SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe") + SET(CPACK_NSIS_DISPLAY_NAME "PolyVox SDK ${POLYVOX_VERSION}") + SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\thermite3d.org/phpBB/") + SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\thermite3d.org") + SET(CPACK_NSIS_CONTACT "matt@milliams.com") + SET(CPACK_NSIS_MODIFY_PATH ON) +ELSE(WIN32 AND NOT UNIX) + #SET(CPACK_STRIP_FILES "bin/MyExecutable") + #SET(CPACK_SOURCE_STRIP_FILES "") +ENDIF(WIN32 AND NOT UNIX) +#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") + +INCLUDE(CPack) + +CPACK_ADD_COMPONENT(library DISPLAY_NAME "Library" DESCRIPTION "The runtime libraries" REQUIRED) +CPACK_ADD_COMPONENT(development DISPLAY_NAME "Development" DESCRIPTION "Files required for developing with PolyVox" DEPENDS library) +CPACK_ADD_COMPONENT(example DISPLAY_NAME "OpenGL Example" DESCRIPTION "A PolyVox example application using OpenGL" DEPENDS library) +cpack_add_component_group(bindings DISPLAY_NAME "Bindings" DESCRIPTION "Language bindings") +CPACK_ADD_COMPONENT(python DISPLAY_NAME "Python Bindings" DESCRIPTION "PolyVox bindings for the Python language" DISABLED GROUP bindings DEPENDS library) diff --git a/README.rst b/README.rst index 9bf85940..3bdf690b 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -PolyVox - The voxel management and manipulation library -======================================================= -PolyVox is the core technology which lies behind our games. It is a fast, lightweight C++ library for the storage and processing of volumetric (voxel-based) environments. It has applications in both games and medical/scientific visualisation, and is released under the terms of the `zlib license `_. - +PolyVox - The voxel management and manipulation library +======================================================= +PolyVox is the core technology which lies behind our games. It is a fast, lightweight C++ library for the storage and processing of volumetric (voxel-based) environments. It has applications in both games and medical/scientific visualisation, and is released under the terms of the `zlib license `_. + PolyVox is a relatively low-level library, and you will need experience in C++ and computer graphics/shaders to use it effectively. It is designed to be easily integrated into existing applications and is independent of your chosen graphics API. For more details please see `this page `_ on our website. \ No newline at end of file diff --git a/TODO.txt b/TODO.txt index 249adc6d..a0e6f26e 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,65 +1,65 @@ -Discussed on forums -=================== -Implement RLE compressor, and use it for blocks in memory and saving to disk. -Replace shared_ptr's with intrinsic_ptrs? -Make decimator work with cubic mesh -Raycaster. - -Short term -========== -Sort awkward use of 'offset' -Replace float with uchar for material. -Mesh smoothing (surface nets?) -Mesh filters/modifiers - A 'translate' modifier? - - -For Version 1.0 -=============== -Implement Memory Pool -Clean up normal code - make normal generation a seperate pass. -Implement mesh smoothing. -Refine interface to mesh generateion - flags structure? -Refine interface to volumes and iterators. -Implement block volume tidy() funtion. -Remove hard-coded region size. -Seperate namespaces - PolyVoxCore, PolyVoxUtil, PolyVoxImpl -Move getChangedRegionGeometry() out of PolyVon and into Thermite? -Remove/refactor IndexedSurfacePatch? Incorporate into RegionGeometry? -Change vertex format to ints? -Check licensing, #regions, etc. -Decimated version of marching cubes should use less memory. -Unit test - compare output to reference implementation -Sort awkward use of 'offset' in decimated marching cubes. -Use of LinearVolume instead of arrays. -Add API docs -Add manual -Finish OpenGL sample. -VolumeChangeTracker can be more conservitive regarding when neighbouring regions are modified. - -For Version 2.0 -=============== -Detect detatched regions. -Handle mesh generation for detatched regions. -Generate ambient lighting from volume? -Utility function for closing outside surfaces? -Consider how seperate surface should be generated for a single region. -Consider transparent materials like glass. -Allow writing meshes into volumes? - -Documentation -============= -Define the following terms: --Voxel --Cell --Volume --Region --Block - -Packaging -========= -Create components for the NSIS installer (Library, bindings, examples, documentation) - Half done -Add License -Add images for installer (and icons) -Set LZMA compression -Find a way to include both debug and release builds? -The .lib files should be part of the 'development' configuration? +Discussed on forums +=================== +Implement RLE compressor, and use it for blocks in memory and saving to disk. +Replace shared_ptr's with intrinsic_ptrs? +Make decimator work with cubic mesh +Raycaster. + +Short term +========== +Sort awkward use of 'offset' +Replace float with uchar for material. +Mesh smoothing (surface nets?) +Mesh filters/modifiers - A 'translate' modifier? + + +For Version 1.0 +=============== +Implement Memory Pool +Clean up normal code - make normal generation a seperate pass. +Implement mesh smoothing. +Refine interface to mesh generateion - flags structure? +Refine interface to volumes and iterators. +Implement block volume tidy() funtion. +Remove hard-coded region size. +Seperate namespaces - PolyVoxCore, PolyVoxUtil, PolyVoxImpl +Move getChangedRegionGeometry() out of PolyVon and into Thermite? +Remove/refactor IndexedSurfacePatch? Incorporate into RegionGeometry? +Change vertex format to ints? +Check licensing, #regions, etc. +Decimated version of marching cubes should use less memory. +Unit test - compare output to reference implementation +Sort awkward use of 'offset' in decimated marching cubes. +Use of LinearVolume instead of arrays. +Add API docs +Add manual +Finish OpenGL sample. +VolumeChangeTracker can be more conservitive regarding when neighbouring regions are modified. + +For Version 2.0 +=============== +Detect detatched regions. +Handle mesh generation for detatched regions. +Generate ambient lighting from volume? +Utility function for closing outside surfaces? +Consider how seperate surface should be generated for a single region. +Consider transparent materials like glass. +Allow writing meshes into volumes? + +Documentation +============= +Define the following terms: +-Voxel +-Cell +-Volume +-Region +-Block + +Packaging +========= +Create components for the NSIS installer (Library, bindings, examples, documentation) - Half done +Add License +Add images for installer (and icons) +Set LZMA compression +Find a way to include both debug and release builds? +The .lib files should be part of the 'development' configuration? diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index 843a0203..a0d0f346 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -1,49 +1,49 @@ -# Copyright (c) 2010-2012 Matt Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -find_program(SPHINXBUILD_EXECUTABLE sphinx-build DOC "The location of the sphinx-build executable") - -#if(SPHINXBUILD_EXECUTABLE AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) -if(SPHINXBUILD_EXECUTABLE) - message(STATUS "Found `sphinx-build` at ${SPHINXBUILD_EXECUTABLE}") - set(BUILD_MANUAL ON PARENT_SCOPE) - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.in.py ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY) - #Generates the HTML docs and the Qt help file which can be opened with "assistant -collectionFile thermite.qhc" - #add_custom_target(manual ${SPHINXBUILD_EXECUTABLE} -b qthelp ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} polyvox.qhcp -o polyvox.qhc) - add_custom_target(manual - ${SPHINXBUILD_EXECUTABLE} -b html - -c ${CMAKE_CURRENT_BINARY_DIR} #Load the conf.py from the binary dir - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Building PolyVox manual" - ) - add_dependencies(manual doc) - set_target_properties(manual PROPERTIES PROJECT_LABEL "Manual") #Set label seen in IDE - SET_PROPERTY(TARGET manual PROPERTY FOLDER "Documentation") -else() - if(NOT SPHINXBUILD_EXECUTABLE) - message(STATUS "`sphinx-build` was not found. Try setting SPHINXBUILD_EXECUTABLE to its location.") - endif() - if(NOT QT_QCOLLECTIONGENERATOR_EXECUTABLE) - message(STATUS "`qhelpgenerator` was not found. Try setting QT_QCOLLECTIONGENERATOR_EXECUTABLE to its location.") - endif() - set(BUILD_MANUAL OFF PARENT_SCOPE) -endif() +# Copyright (c) 2010-2012 Matt Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +find_program(SPHINXBUILD_EXECUTABLE sphinx-build DOC "The location of the sphinx-build executable") + +#if(SPHINXBUILD_EXECUTABLE AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) +if(SPHINXBUILD_EXECUTABLE) + message(STATUS "Found `sphinx-build` at ${SPHINXBUILD_EXECUTABLE}") + set(BUILD_MANUAL ON PARENT_SCOPE) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.in.py ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY) + #Generates the HTML docs and the Qt help file which can be opened with "assistant -collectionFile thermite.qhc" + #add_custom_target(manual ${SPHINXBUILD_EXECUTABLE} -b qthelp ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} polyvox.qhcp -o polyvox.qhc) + add_custom_target(manual + ${SPHINXBUILD_EXECUTABLE} -b html + -c ${CMAKE_CURRENT_BINARY_DIR} #Load the conf.py from the binary dir + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building PolyVox manual" + ) + add_dependencies(manual doc) + set_target_properties(manual PROPERTIES PROJECT_LABEL "Manual") #Set label seen in IDE + SET_PROPERTY(TARGET manual PROPERTY FOLDER "Documentation") +else() + if(NOT SPHINXBUILD_EXECUTABLE) + message(STATUS "`sphinx-build` was not found. Try setting SPHINXBUILD_EXECUTABLE to its location.") + endif() + if(NOT QT_QCOLLECTIONGENERATOR_EXECUTABLE) + message(STATUS "`qhelpgenerator` was not found. Try setting QT_QCOLLECTIONGENERATOR_EXECUTABLE to its location.") + endif() + set(BUILD_MANUAL OFF PARENT_SCOPE) +endif() diff --git a/documentation/FAQ.rst b/documentation/FAQ.rst index 0aceb32d..f9ede06f 100644 --- a/documentation/FAQ.rst +++ b/documentation/FAQ.rst @@ -1,25 +1,25 @@ -************************** -Frequently Asked Questions -************************** - -Should I store my environment in a single big volume or break it down into several smaller ones? ------------------------------------------------------------------------------------------------- -In most cases you should store you data in a single big volume, unless you are sure you understand the implications of doing otherwise. - -Most algorithms in PolyVox operate on only a single volume (the exception to this are some of the image processing algorithms which use source and destination volumes, but even they use a *single* source and a *single* destination). The reason for this is that many algorithms require fast access to the neighbours of any given voxel. As an example, the surface extractors need to look at the neighbours of a voxel in order to determine whether triangles should be generated. - -PolyVox volumes make it easy to access these neighbours, but the situation gets complex on the edge of a volume because the neighbouring voxels may not exist. It is possible to define a border value (which will be returned whenever you try to read a voxel outside the volume) but this doesn't handle all scenarios in the desired way. Often the most practical solution is to make the volume slightly larger than the data it needs to contain, and then avoid having your algorithms go right to the edge. - -Having established that edge cases can be problematic, we can now see that storing your data as a set of adjacent volumes is undesirable because these edge cases then exist throughout the data set. This causes a lot of problems such as gaps between pieces of extracted terrain or discontinuities in the computed normals. - -The usual reason why people attempt to break their terrain into separate volumes is so that they can perform some more advanced memory management for very big terrain, for example by only loading particular volumes into memory when they are within a certain distance from the camera. However, this kind of paging behaviour is already implemented by the LargeVolume class. The LargeVolume internally stores its data as a set of blocks, and does it in such a way that it is able to perform neighbourhood access across block boundaries. Whenever you find yourself trying to break terrain data into separate volumes you should probably use the LargeVolume instead. - -Note that although you should only use a single volume for your data, it is still recommended that you split the mesh data into multiple pieces so that they can be culled against the view frustum, and so that you can update the smaller pieces more quickly when you need to. You can extract meshes from different parts of the volume by passing a Region to the surface extractor. - -Lastly, note that there are exceptions to the 'one volume' rule. An example might be if you had a number of planets in space, in which case each planet could safely be a separate volume. These planets never touch, and so the artifacts which would occur on volume boundaries do not cause a problem. - -Can I combine smooth meshes with cubic ones? --------------------------------------------- -We have never attempted to do this but in theory it should be possible. One option is simply to generate two meshes (one using the MarchingCubesSurfaceExtractor and the other using the CubicSurfaceExtractor) and render them on top of each other while allowing the depth buffer to resolve the intersections. Combining these two meshes into a single mesh is likely to be difficult as they use different vertex formats and have different texturing requirements (see the document on texture mapping). - +************************** +Frequently Asked Questions +************************** + +Should I store my environment in a single big volume or break it down into several smaller ones? +------------------------------------------------------------------------------------------------ +In most cases you should store you data in a single big volume, unless you are sure you understand the implications of doing otherwise. + +Most algorithms in PolyVox operate on only a single volume (the exception to this are some of the image processing algorithms which use source and destination volumes, but even they use a *single* source and a *single* destination). The reason for this is that many algorithms require fast access to the neighbours of any given voxel. As an example, the surface extractors need to look at the neighbours of a voxel in order to determine whether triangles should be generated. + +PolyVox volumes make it easy to access these neighbours, but the situation gets complex on the edge of a volume because the neighbouring voxels may not exist. It is possible to define a border value (which will be returned whenever you try to read a voxel outside the volume) but this doesn't handle all scenarios in the desired way. Often the most practical solution is to make the volume slightly larger than the data it needs to contain, and then avoid having your algorithms go right to the edge. + +Having established that edge cases can be problematic, we can now see that storing your data as a set of adjacent volumes is undesirable because these edge cases then exist throughout the data set. This causes a lot of problems such as gaps between pieces of extracted terrain or discontinuities in the computed normals. + +The usual reason why people attempt to break their terrain into separate volumes is so that they can perform some more advanced memory management for very big terrain, for example by only loading particular volumes into memory when they are within a certain distance from the camera. However, this kind of paging behaviour is already implemented by the LargeVolume class. The LargeVolume internally stores its data as a set of blocks, and does it in such a way that it is able to perform neighbourhood access across block boundaries. Whenever you find yourself trying to break terrain data into separate volumes you should probably use the LargeVolume instead. + +Note that although you should only use a single volume for your data, it is still recommended that you split the mesh data into multiple pieces so that they can be culled against the view frustum, and so that you can update the smaller pieces more quickly when you need to. You can extract meshes from different parts of the volume by passing a Region to the surface extractor. + +Lastly, note that there are exceptions to the 'one volume' rule. An example might be if you had a number of planets in space, in which case each planet could safely be a separate volume. These planets never touch, and so the artifacts which would occur on volume boundaries do not cause a problem. + +Can I combine smooth meshes with cubic ones? +-------------------------------------------- +We have never attempted to do this but in theory it should be possible. One option is simply to generate two meshes (one using the MarchingCubesSurfaceExtractor and the other using the CubicSurfaceExtractor) and render them on top of each other while allowing the depth buffer to resolve the intersections. Combining these two meshes into a single mesh is likely to be difficult as they use different vertex formats and have different texturing requirements (see the document on texture mapping). + An alternative possibility may be to create a new surface extractor based on the Surface Nets (link) algorithm. The idea here is that the mesh would start with a cubic shape, but as the net was stretched it would be smoothed. The degree of smoothing could be controlled by a voxel property which could allow the full range from cubic to smooth to exist in a single mesh. As mentioned above, this may mean that some extra work has to be put into a fragment shader which is capable of texturing this kind of mesh. Come by the forums of you want to discuss this further. \ No newline at end of file diff --git a/documentation/LevelOfDetail.rst b/documentation/LevelOfDetail.rst index 217e318e..4d966974 100644 --- a/documentation/LevelOfDetail.rst +++ b/documentation/LevelOfDetail.rst @@ -1,48 +1,48 @@ -*************** -Level of Detail -*************** -When the PolyVox surface extractors are applied to volume data the resulting mesh can contain a very high number of triangles. For large voxel worlds this can cause both performance and memory problems. The performance problems occur due the the load on the vertex shader which has to process a large number of vertices, and also due to the setup costs of a large number of tiny (possibly sub-pixel) triangles. The memory costs result simply from having a large amount of data which does not actually contribute to the visual appearance of the scene. - -For these reasons it is desirable to reduce the triangle count of the meshes as far as possible, especially as meshes move away from the camera. This document describes the various approaches which are available within PolyVox to achieve this. Generally these approaches are different for cubic meshes vs smooth meshes and so we address these cases separately. - -Cubic Meshes -============ -A naive implementation of a cubic surface extractor would generate a mesh containing a quad for voxel face which lies on the boundary between a solid and an empty voxel. The CubicSurfaceExtractor is indeed capable of generating such a mesh, but it also provides the option to merge adjacent quads into a single quad subject to various conditions being satisfied (e.g. the faces must have the same material). This merging process drastically reduces the amount of geometry which must be drawn but does not modify the shape of the mesh. Because of these desirable properties such merging is performed by default, but it can be disabled if necessary. - -To our knowledge the only drawback of performing this quad merging is that it can create T-junctions in the resulting mesh. T-junctions are an undesirable property of mesh geometry because they can cause tiny cracks (usually just seen as flickering pixels) to occur between quads. The figure below shows a mesh before quad merging, a mesh where the merged quads have caused T-junctions, and how the resulting rendering might look (note the single pixel holes along the quad border). - -*Add figure here...* - -Vertices C and D are supposed to lie exactly along the line which has A and B as its end points, so in theory the mesh should be valid and should render correctly. The reason T-junctions cause a problem in practice is due to limitations of the floating point number representation. Depending on the transformations which are applied, it may be that the positions of C and/or D can not be represented precisely enough to exactly lie on the line between A and B. - -*Demo correct mesh. mention we don't have a solution to generate it.* - -Whether it's a problem in practice depends on hardware precision (16/32 bit), distance from origin, number of transforms which are applied, and probably a number of other factors. We have yet to investigate. - -We don't currently have a real solution to this problem. In Voxeliens the borders between voxels were darkened to simulate ambient occlusion and this had the desirable side effect of making any flickering pixels very hard to see. It's also possible that anti-aliasing strategies can reduce the problem, and storing vertex positions as integers may help as well. Lastly, it may be possible to construct some kind of post-process which would repair the image where it identifies single pixel discontinuities in the depth buffer. - -Smooth Meshes -============= -Level of detail for smooth meshes is a lot more complex than for cubic ones, and we'll admit upfront that we do not currently have a good solution to this problem. None the less, we do have a couple of partial solutions which you might be able to use or adapt for your specific scenario. - -Techniques for performing level of detail on smooth meshes basically fall into two categories. The first category involves reducing the resolution of the volume data and then running the surface extractor on the smaller volume. This naturally generates a lower detail mesh which must then be scaled up to match the other meshes in the scene. The second category involves generating the mesh at full detail and then using traditional mesh simplification techniques to reduces the number of triangles. Both techniques are explored in more detail below. - -Volume Reduction ----------------- -The VolumeResampler class can be used to copy volume data from a source region to a destination region, and it handles the resampling of the voxel values in the event that the source and destination regions are not the same size. This is exactly what we need for implementing level of detail and the principle is demonstrated by the SmoothLOD sample (see the documentation for the SmoothLOD sample for more information). - -One of the problems with this approach is that the lower resolution mesh does not *exactly* line up with the higher resolution mesh, and this can cause cracks to be visible where the two meshes meet. The SmoothLOD sample attempts to avoid this problem by overlapping the meshes slightly but this may not be effective in all situations or from all viewpoints. - -An alternative is the Transvoxel algorithm (link) developed by Eric Lengyel. This essentially extends the original Marching Cubes lookup table with additional entries which handle seamless transitions between LOD levels, and it is a very promising solution to level of detail for voxel terrain. At this point in time we do not have an implementation of this algorithm but work is being undertaking in the area. For the latest developments see: http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=338 - -However, in all volume reduction approaches there is some uncertainty about how materials should be handled. Creating a lower resolution volume means that several voxel values from the high resolution volume need to be combined into a single value. For density values this is straightforward as a simple average gives good results, but it is not clear how this extends to material identifiers. Averaging them doesn't make sense, and it is hard to imagine an approach which would not lead to visible artifacts as LOD levels change. Perhaps the visible effects can be reduced by blending between two LOD levels, but more investigation needs to be done here. - -Mesh Simplification -------------------- -The other main approach is to generate the mesh at the full resolution and then reduce the number of triangles using a postprocessing step. This can draw on the large body of mesh simplification research (link to survey) and typically involves merging adjacent faces or collapsing vertices. When using this approach there are a couple of additional complications compared to the implementations which are normally seen. - -The first additional complication is that the decimation algorithm needs to preserve material boundaries so that they don't move between LOD levels. When choosing whether a particular simplification can be made (i.e deciding if one vertex can be collapsed on to another or whether two faces can be merged) a metric is usually used to determine how much the simplification would affect the visual appearance of the mesh. When working with smooth voxel meshes this metric needs to also consider the material identifiers. - -We also need to ensure that the metric preserves the geometric boundary of the mesh, so that no cracks are visible when a simplified mesh is place next to an original one. Maintaining this geometric boundary can be difficult, as the straightforward approach of locking the edge vertices in place will tend to limit the amount of simplification which can be performed. Alternatively, cracks can be allowed to develop if they are later hidden through the use of 'skirts' around the resulting mesh. - -PolyVox used to contain code for performing simplification of the smooth voxel meshes, but unfortunately it had significant performance and functionality issues. Therefore it has been deprecated and it will be removed in a future version of the library. We will instead investigate the use of external mesh simplification libraries and OpenMesh (link) may be a good candidate here. +*************** +Level of Detail +*************** +When the PolyVox surface extractors are applied to volume data the resulting mesh can contain a very high number of triangles. For large voxel worlds this can cause both performance and memory problems. The performance problems occur due the the load on the vertex shader which has to process a large number of vertices, and also due to the setup costs of a large number of tiny (possibly sub-pixel) triangles. The memory costs result simply from having a large amount of data which does not actually contribute to the visual appearance of the scene. + +For these reasons it is desirable to reduce the triangle count of the meshes as far as possible, especially as meshes move away from the camera. This document describes the various approaches which are available within PolyVox to achieve this. Generally these approaches are different for cubic meshes vs smooth meshes and so we address these cases separately. + +Cubic Meshes +============ +A naive implementation of a cubic surface extractor would generate a mesh containing a quad for voxel face which lies on the boundary between a solid and an empty voxel. The CubicSurfaceExtractor is indeed capable of generating such a mesh, but it also provides the option to merge adjacent quads into a single quad subject to various conditions being satisfied (e.g. the faces must have the same material). This merging process drastically reduces the amount of geometry which must be drawn but does not modify the shape of the mesh. Because of these desirable properties such merging is performed by default, but it can be disabled if necessary. + +To our knowledge the only drawback of performing this quad merging is that it can create T-junctions in the resulting mesh. T-junctions are an undesirable property of mesh geometry because they can cause tiny cracks (usually just seen as flickering pixels) to occur between quads. The figure below shows a mesh before quad merging, a mesh where the merged quads have caused T-junctions, and how the resulting rendering might look (note the single pixel holes along the quad border). + +*Add figure here...* + +Vertices C and D are supposed to lie exactly along the line which has A and B as its end points, so in theory the mesh should be valid and should render correctly. The reason T-junctions cause a problem in practice is due to limitations of the floating point number representation. Depending on the transformations which are applied, it may be that the positions of C and/or D can not be represented precisely enough to exactly lie on the line between A and B. + +*Demo correct mesh. mention we don't have a solution to generate it.* + +Whether it's a problem in practice depends on hardware precision (16/32 bit), distance from origin, number of transforms which are applied, and probably a number of other factors. We have yet to investigate. + +We don't currently have a real solution to this problem. In Voxeliens the borders between voxels were darkened to simulate ambient occlusion and this had the desirable side effect of making any flickering pixels very hard to see. It's also possible that anti-aliasing strategies can reduce the problem, and storing vertex positions as integers may help as well. Lastly, it may be possible to construct some kind of post-process which would repair the image where it identifies single pixel discontinuities in the depth buffer. + +Smooth Meshes +============= +Level of detail for smooth meshes is a lot more complex than for cubic ones, and we'll admit upfront that we do not currently have a good solution to this problem. None the less, we do have a couple of partial solutions which you might be able to use or adapt for your specific scenario. + +Techniques for performing level of detail on smooth meshes basically fall into two categories. The first category involves reducing the resolution of the volume data and then running the surface extractor on the smaller volume. This naturally generates a lower detail mesh which must then be scaled up to match the other meshes in the scene. The second category involves generating the mesh at full detail and then using traditional mesh simplification techniques to reduces the number of triangles. Both techniques are explored in more detail below. + +Volume Reduction +---------------- +The VolumeResampler class can be used to copy volume data from a source region to a destination region, and it handles the resampling of the voxel values in the event that the source and destination regions are not the same size. This is exactly what we need for implementing level of detail and the principle is demonstrated by the SmoothLOD sample (see the documentation for the SmoothLOD sample for more information). + +One of the problems with this approach is that the lower resolution mesh does not *exactly* line up with the higher resolution mesh, and this can cause cracks to be visible where the two meshes meet. The SmoothLOD sample attempts to avoid this problem by overlapping the meshes slightly but this may not be effective in all situations or from all viewpoints. + +An alternative is the Transvoxel algorithm (link) developed by Eric Lengyel. This essentially extends the original Marching Cubes lookup table with additional entries which handle seamless transitions between LOD levels, and it is a very promising solution to level of detail for voxel terrain. At this point in time we do not have an implementation of this algorithm but work is being undertaking in the area. For the latest developments see: http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=338 + +However, in all volume reduction approaches there is some uncertainty about how materials should be handled. Creating a lower resolution volume means that several voxel values from the high resolution volume need to be combined into a single value. For density values this is straightforward as a simple average gives good results, but it is not clear how this extends to material identifiers. Averaging them doesn't make sense, and it is hard to imagine an approach which would not lead to visible artifacts as LOD levels change. Perhaps the visible effects can be reduced by blending between two LOD levels, but more investigation needs to be done here. + +Mesh Simplification +------------------- +The other main approach is to generate the mesh at the full resolution and then reduce the number of triangles using a postprocessing step. This can draw on the large body of mesh simplification research (link to survey) and typically involves merging adjacent faces or collapsing vertices. When using this approach there are a couple of additional complications compared to the implementations which are normally seen. + +The first additional complication is that the decimation algorithm needs to preserve material boundaries so that they don't move between LOD levels. When choosing whether a particular simplification can be made (i.e deciding if one vertex can be collapsed on to another or whether two faces can be merged) a metric is usually used to determine how much the simplification would affect the visual appearance of the mesh. When working with smooth voxel meshes this metric needs to also consider the material identifiers. + +We also need to ensure that the metric preserves the geometric boundary of the mesh, so that no cracks are visible when a simplified mesh is place next to an original one. Maintaining this geometric boundary can be difficult, as the straightforward approach of locking the edge vertices in place will tend to limit the amount of simplification which can be performed. Alternatively, cracks can be allowed to develop if they are later hidden through the use of 'skirts' around the resulting mesh. + +PolyVox used to contain code for performing simplification of the smooth voxel meshes, but unfortunately it had significant performance and functionality issues. Therefore it has been deprecated and it will be removed in a future version of the library. We will instead investigate the use of external mesh simplification libraries and OpenMesh (link) may be a good candidate here. diff --git a/documentation/Lighting.rst b/documentation/Lighting.rst index 569f31cd..5f9b2eb6 100644 --- a/documentation/Lighting.rst +++ b/documentation/Lighting.rst @@ -1,45 +1,45 @@ -******** -Lighting -******** -Lighting is an important part of creating a realistic scene, and fortunately most common lighting solutions can be easily applied to PolyVox meshes. In this document we describe how to implement dynamic lighting and ambient occlusion with PolyVox. - -Dynamic Lighting -================ -In general, any lighting solution for real-time 3D graphics should be directly applicable to PolyVox meshes. - -Normal Calculation for Smooth Meshes ------------------------------------- -When working with smooth voxel terrain meshes, PolyVox provides vertex normals as part of the extracted surface mesh. A common approach for computing these normals would be to compute normals for each face in the mesh, and then compute the vertex normals as a weighted average of the normals of the faces which share it. Actually this is not the approach used by PolyVox, as PolyVox instead computes the vertex normals directly from the underlying volume data. - -More specifically, PolyVox is able to compute the *gradient* of the volume data at any given point using well established image processing methods. The normalised gradient value is used as the vertex normal and in general it is smoother than the value computed by averaging neighbouring faces. Actually there are two approaches to this gradient computation known as *Central Differencing* and *Sobel Filter*. The central differencing approach is generally recommended but the Sobel filter can be used to obtain slightly smoother results but with lower performance. See the MarchingCubesSurfaceExtractor documentation for details on how to select between these (check this exists...). - -Normal Calculation for Cubic Meshes ------------------------------------ -For cubic meshes PolyVox doesn't actually generate any vertex normals at all, and this is often a source of confusion for new users. The reason for this is that we wish to to perform per-face lighting rather than per-vertex lighting. Considering the case of a single cube, if we wanted to perform per-face lighting based on per-vertex normals then the normals cannot be shared between adjacent faces and so each vertex needs to be duplicated three times (one for each face which uses it). This means we would need 24 vertices to represent a cube which intuitively should only need eight vertices. - -Therefore PolyVox does not generate per-vertex normals for cubic meshes, and as a result the cubic mesh's vertices are both smaller and less numerous. Of course, we still need a way to obtain normals for lighting calculations and so our suggestion is to compute the normals in a fragment program using the *derivative operations* which are provided by modern graphics hardware. - -The description here is rather oversimplified, but the idea behind these operation is that they can tell you how much a variable has changed between two adjacent pixels. If we use our fragment world space position as the input to these derivative operations then we can obtain two vectors which lie on the surface of our face. The cross product of these then gives us a vector which is perpendicular to both and which is therefore our normal. - -Further information about the derivative operations can be found in the OpenGL/Direct3D API documentation, but the implementation in code is quite simple. Firstly you need to make sure that you have access to the fragments world space position in your shader, which means you need to pass it through from the vertex shader. Then you can use the following code in your fragment shader: - -.. sourcecode:: glsl - - vec3 worldNormal = cross(dFdy(inWorldPosition.xyz), dFdx(inWorldPosition.xyz)); - worldNormal = normalize(worldNormal); - -**TODO: Check the normal direction** - -Similar code can be implemented in HLSL but you may need to invert the normal due to coordinate system differences between the two APIs. Also, be aware that it may be necessary to use OpenGL ES XXX extension in order to access this derivative functionality on mobile hardware. - -Shadows -------- -To date we have only experimented with shadow maps as a solution to the real time shadowing problem and have found they work very well for both casting and receiving. The approach is essentially the same as for any other geometry and the usual approaches can be used for setting up the projection and for filtering the result. One PolyVox specific tip we can give is that you don't need to take account of materials when rendering into the shadow map as you always draw in black, so if you are splitting you geometry for material blending or for handling a large number of materials then you don't need to do this when rendering shadows. Using separate shadow geometry with all materials combined may decrease your batch count in this case. - -The most widely used alternative to shadow maps is shadow volumes but we have not tested these with PolyVox. We do not expect these will provide a good solution because meshes usually require additional edge information to allow the shadow volume to be extruded from the silhouette and PolyVox does not provide this. Even if this edge information could be calculated, it would be invalidated each time the mesh changed which would make dynamic terrain more difficult. - -Overall we would recommend you make use of shadow maps for dynamic shadows. - -Ambient Occlusion -================= +******** +Lighting +******** +Lighting is an important part of creating a realistic scene, and fortunately most common lighting solutions can be easily applied to PolyVox meshes. In this document we describe how to implement dynamic lighting and ambient occlusion with PolyVox. + +Dynamic Lighting +================ +In general, any lighting solution for real-time 3D graphics should be directly applicable to PolyVox meshes. + +Normal Calculation for Smooth Meshes +------------------------------------ +When working with smooth voxel terrain meshes, PolyVox provides vertex normals as part of the extracted surface mesh. A common approach for computing these normals would be to compute normals for each face in the mesh, and then compute the vertex normals as a weighted average of the normals of the faces which share it. Actually this is not the approach used by PolyVox, as PolyVox instead computes the vertex normals directly from the underlying volume data. + +More specifically, PolyVox is able to compute the *gradient* of the volume data at any given point using well established image processing methods. The normalised gradient value is used as the vertex normal and in general it is smoother than the value computed by averaging neighbouring faces. Actually there are two approaches to this gradient computation known as *Central Differencing* and *Sobel Filter*. The central differencing approach is generally recommended but the Sobel filter can be used to obtain slightly smoother results but with lower performance. See the MarchingCubesSurfaceExtractor documentation for details on how to select between these (check this exists...). + +Normal Calculation for Cubic Meshes +----------------------------------- +For cubic meshes PolyVox doesn't actually generate any vertex normals at all, and this is often a source of confusion for new users. The reason for this is that we wish to to perform per-face lighting rather than per-vertex lighting. Considering the case of a single cube, if we wanted to perform per-face lighting based on per-vertex normals then the normals cannot be shared between adjacent faces and so each vertex needs to be duplicated three times (one for each face which uses it). This means we would need 24 vertices to represent a cube which intuitively should only need eight vertices. + +Therefore PolyVox does not generate per-vertex normals for cubic meshes, and as a result the cubic mesh's vertices are both smaller and less numerous. Of course, we still need a way to obtain normals for lighting calculations and so our suggestion is to compute the normals in a fragment program using the *derivative operations* which are provided by modern graphics hardware. + +The description here is rather oversimplified, but the idea behind these operation is that they can tell you how much a variable has changed between two adjacent pixels. If we use our fragment world space position as the input to these derivative operations then we can obtain two vectors which lie on the surface of our face. The cross product of these then gives us a vector which is perpendicular to both and which is therefore our normal. + +Further information about the derivative operations can be found in the OpenGL/Direct3D API documentation, but the implementation in code is quite simple. Firstly you need to make sure that you have access to the fragments world space position in your shader, which means you need to pass it through from the vertex shader. Then you can use the following code in your fragment shader: + +.. sourcecode:: glsl + + vec3 worldNormal = cross(dFdy(inWorldPosition.xyz), dFdx(inWorldPosition.xyz)); + worldNormal = normalize(worldNormal); + +**TODO: Check the normal direction** + +Similar code can be implemented in HLSL but you may need to invert the normal due to coordinate system differences between the two APIs. Also, be aware that it may be necessary to use OpenGL ES XXX extension in order to access this derivative functionality on mobile hardware. + +Shadows +------- +To date we have only experimented with shadow maps as a solution to the real time shadowing problem and have found they work very well for both casting and receiving. The approach is essentially the same as for any other geometry and the usual approaches can be used for setting up the projection and for filtering the result. One PolyVox specific tip we can give is that you don't need to take account of materials when rendering into the shadow map as you always draw in black, so if you are splitting you geometry for material blending or for handling a large number of materials then you don't need to do this when rendering shadows. Using separate shadow geometry with all materials combined may decrease your batch count in this case. + +The most widely used alternative to shadow maps is shadow volumes but we have not tested these with PolyVox. We do not expect these will provide a good solution because meshes usually require additional edge information to allow the shadow volume to be extruded from the silhouette and PolyVox does not provide this. Even if this edge information could be calculated, it would be invalidated each time the mesh changed which would make dynamic terrain more difficult. + +Overall we would recommend you make use of shadow maps for dynamic shadows. + +Ambient Occlusion +================= This is an area in which we want to undertake more research in order to get effective ambient occlusion into PolyVox scenes. In the mean time SSAO has proved to be a popular solution. \ No newline at end of file diff --git a/documentation/ModifyingTerrain.rst b/documentation/ModifyingTerrain.rst index 64a50f6e..8be6e0cb 100644 --- a/documentation/ModifyingTerrain.rst +++ b/documentation/ModifyingTerrain.rst @@ -1,4 +1,4 @@ -================= -Modifying Terrain -================= +================= +Modifying Terrain +================= This document has yet to be written. \ No newline at end of file diff --git a/documentation/Prerequisites.rst b/documentation/Prerequisites.rst index 04285670..bbb0f808 100644 --- a/documentation/Prerequisites.rst +++ b/documentation/Prerequisites.rst @@ -1,38 +1,38 @@ -************* -Prerequisites -************* -The PolyVox library is aimed at experienced games and graphics programmers who wish to incorporate voxel environments into their applications. It is not a drop in solution, but instead provides a set of building blocks which you can use to construct a complete system. Most of the functionality could be considered quite low-level. For example, it provides mesh extractors to generate a surface from volume data but requires the application developer to handle all tasks related to scene management and rendering of such data. - -As a result you will need a decent amount of graphics programming experience to effectively make use of the library. The purpose of this document is to highlight some of the core areas with which you will need to be familiar. In some cases we also provide links to places where you can find more information about the subject in question. - -You should also be aware that voxel terrain is still an open research area and has not yet seen widespread adoption in games and simulations. There are many questions to which we do not currently know the best answer and so you may have to do some research and experimentation yourself when trying to obtain your desired result. Please do let us know if you come up with a trick or technique which you think could benefit other users. - -Programming -=========== -This section describes some of the programming concepts with which you will need to be familiar: - -**C++:** PolyVox is written using the C++ language and we expect this is what the majority of our users will be developing in. You will need to be familiar with the basic process of building and linking against external libraries as well as setting up your development environment. Note that you do have the option of working with other languages via the SWIG bindings but you may not have as much flexibility with this approach. - -**Templates:** PolyVox also makes heavy use of template programming in order to be both fast and generic, so familiarity with templates will be very useful. You shouldn't need to do much template programming yourself but an understanding of them will help you understand errors and resolve any problems. - -**Callbacks:** Several of the algorithms in PolyVox can be customised through the use of callbacks. In general there are sensible defaults provided, but for maximum control you may wish to learn how to define you own. In general the principle is similar to the way in which callbacks are used in the STL. - -Graphics Concepts -================= -Several core graphics principles will be useful in understanding and using PolyVox: - -**Volume representation:** PolyVox revolves around the idea of storing and manipulating volume data and using this as a representation of a 3d world. This is a fairly intuitive extension of traditional heightmap terrain but does require the ability to 'think in 3D'. You will need to understand that data stored in this way can become very large, and understand the idea that paging and compression can be used to combat this. - -**Mesh representation:** Most PolyVox projects will involve using one of the surface extractors, which output their data as index and vertex buffers. Therefore you will need to understand this representation in order to pass the data to your rendering engine or in order to perform further modifications to it. You can find out about more about this here: (ADD LINK) - -**Image processing:** For certain advanced application an understanding of image processing methods can be useful. For example the process of blurring an image via a low pass filter can be used to effectively smooth out voxel terrain. There are plans to add more image processing operations to PolyVox particularly with regard to morphological operations which you might want to use to modify your environment. - -Rendering -========= -**Runtime geometry creation:** PolyVox is independent of any particular graphics API which means it outputs its data using API-neutral structures such as index and vertex buffers (as mentioned above). You will need to write the code which converts these structures into a format which your API or engine can understand. This is not a difficult task but does require some knowledge of the rendering technology which you are using. - -**Scene management:** PolyVox is only responsible for providing you with the mesh data to be displayed, so you application or engine will need to make sensible decisions about how this data should be organised in terms of a spatial structure (octree, bounding volumes tree, etc). It will also need to provide some approach to visibility determination such as frustum culling or a more advanced approach. If you are integrating PolyVox with an existing rendering engine then you should find that many of these aspects are already handled for you. - -**Shader programming:** The meshes which are generated by PolyVox are very basic in terms of the vertex data they provide. You get vertex positions, a material identifier, and sometimes vertex normals. It is the responsibility of application programmer to decide how to use this data to create visually interesting renderings. This means you will almost certainly want to make use of shader programs. Of course, in our texturing (LINK) and lighting (LINK) documents you will find many ideas and common solutions, but you will need strong shader programming experience to make effective use of these. - +************* +Prerequisites +************* +The PolyVox library is aimed at experienced games and graphics programmers who wish to incorporate voxel environments into their applications. It is not a drop in solution, but instead provides a set of building blocks which you can use to construct a complete system. Most of the functionality could be considered quite low-level. For example, it provides mesh extractors to generate a surface from volume data but requires the application developer to handle all tasks related to scene management and rendering of such data. + +As a result you will need a decent amount of graphics programming experience to effectively make use of the library. The purpose of this document is to highlight some of the core areas with which you will need to be familiar. In some cases we also provide links to places where you can find more information about the subject in question. + +You should also be aware that voxel terrain is still an open research area and has not yet seen widespread adoption in games and simulations. There are many questions to which we do not currently know the best answer and so you may have to do some research and experimentation yourself when trying to obtain your desired result. Please do let us know if you come up with a trick or technique which you think could benefit other users. + +Programming +=========== +This section describes some of the programming concepts with which you will need to be familiar: + +**C++:** PolyVox is written using the C++ language and we expect this is what the majority of our users will be developing in. You will need to be familiar with the basic process of building and linking against external libraries as well as setting up your development environment. Note that you do have the option of working with other languages via the SWIG bindings but you may not have as much flexibility with this approach. + +**Templates:** PolyVox also makes heavy use of template programming in order to be both fast and generic, so familiarity with templates will be very useful. You shouldn't need to do much template programming yourself but an understanding of them will help you understand errors and resolve any problems. + +**Callbacks:** Several of the algorithms in PolyVox can be customised through the use of callbacks. In general there are sensible defaults provided, but for maximum control you may wish to learn how to define you own. In general the principle is similar to the way in which callbacks are used in the STL. + +Graphics Concepts +================= +Several core graphics principles will be useful in understanding and using PolyVox: + +**Volume representation:** PolyVox revolves around the idea of storing and manipulating volume data and using this as a representation of a 3d world. This is a fairly intuitive extension of traditional heightmap terrain but does require the ability to 'think in 3D'. You will need to understand that data stored in this way can become very large, and understand the idea that paging and compression can be used to combat this. + +**Mesh representation:** Most PolyVox projects will involve using one of the surface extractors, which output their data as index and vertex buffers. Therefore you will need to understand this representation in order to pass the data to your rendering engine or in order to perform further modifications to it. You can find out about more about this here: (ADD LINK) + +**Image processing:** For certain advanced application an understanding of image processing methods can be useful. For example the process of blurring an image via a low pass filter can be used to effectively smooth out voxel terrain. There are plans to add more image processing operations to PolyVox particularly with regard to morphological operations which you might want to use to modify your environment. + +Rendering +========= +**Runtime geometry creation:** PolyVox is independent of any particular graphics API which means it outputs its data using API-neutral structures such as index and vertex buffers (as mentioned above). You will need to write the code which converts these structures into a format which your API or engine can understand. This is not a difficult task but does require some knowledge of the rendering technology which you are using. + +**Scene management:** PolyVox is only responsible for providing you with the mesh data to be displayed, so you application or engine will need to make sensible decisions about how this data should be organised in terms of a spatial structure (octree, bounding volumes tree, etc). It will also need to provide some approach to visibility determination such as frustum culling or a more advanced approach. If you are integrating PolyVox with an existing rendering engine then you should find that many of these aspects are already handled for you. + +**Shader programming:** The meshes which are generated by PolyVox are very basic in terms of the vertex data they provide. You get vertex positions, a material identifier, and sometimes vertex normals. It is the responsibility of application programmer to decide how to use this data to create visually interesting renderings. This means you will almost certainly want to make use of shader programs. Of course, in our texturing (LINK) and lighting (LINK) documents you will find many ideas and common solutions, but you will need strong shader programming experience to make effective use of these. + If you don't have much experience with shader programming then there are many free resources available. The Cg Tutorial (LINK) provides a good introduction here (the concepts are applicable to other shader languages) as does the documentation for the main graphics (LINK to OpenGL docs) APIs (Link to D3D docs). there is nothing special about PolyVox meshes so you would be advised to practice development on simple meshes such as spheres and cubes before trying to apply it to the output of the mesh extractors. \ No newline at end of file diff --git a/documentation/TextureMapping.rst b/documentation/TextureMapping.rst index f9b3ca2f..de9ac0fd 100644 --- a/documentation/TextureMapping.rst +++ b/documentation/TextureMapping.rst @@ -1,151 +1,151 @@ -*************** -Texture Mapping -*************** -The PolyVox library is only concerned with operations on volume data (such as extracting a mesh from from a volume) and deliberately avoids the issue of rendering any resulting polygon meshes. This means PolyVox is not tied to any particular graphics API or rendering engine, and makes it much easier to integrate PolyVox with existing technology, because in general a PolyVox mesh can be treated the same as any other mesh. However, the texturing of a PolyVox mesh is usually handled a little differently, and so the purpose of this document is to provide some ideas about where to start with this process. - -This document is aimed at readers in one of two positions: - -1. You are trying to texture 'Minecraft-style' terrain with cubic blocks and a number of different materials. -2. You are trying to texture smooth terrain produced by the Marching Cubes (or similar) algorithm. - -These are certainly not the limit of PolyVox, and you can choose much more advanced texturing approaches if you wish. For example, in the past we have texture mapped a voxel Earth from a cube map and used an animated *procedural* texture (based on Perlin noise) for the magma at the center of the Earth. However, if you are aiming for such advanced techniques then we assume you understand the basics in this document and have enough knowledge to expand the ideas yourself. But do feel free to drop by and ask questions on our forum. - -Traditionally meshes are textured by providing a pair of UV texture coordinates for each vertex, and these UV coordinates determine which parts of a texture maps to each vertex. The process of texturing PolyVox meshes is more complex for a couple of reasons: - -1. PolyVox does not provide UV coordinates for each vertex. -2. Voxel terrain (particularly Minecraft-style) often involves many more textures than the GPU can read at a time. - -By reading this document you should learn how to work around the above problems, though you will almost certainly need to follow provided links and do some further reading as we have only summarised the key ideas here. - -Mapping textures to mesh geometry -================================= -The lack of UV coordinates means some lateral thinking is required in order to apply texture maps to meshes. But before we get to that, we will first try to explain the rational behind PolyVox not providing UV coordinates in the first place. This rational is different for the smooth voxel meshes vs the cubic voxel meshes. - -Rational --------- -The problem with texturing smooth voxel meshes is that the geometry can get very complex and it is not clear how the mapping between mesh geometry and a texture should be performed. In a traditional heightmap-based terrain this relationship is obvious as the texture map and heightmap simply line up directly. But for more complex shapes some form of 'UV unwrapping' is usually performed to define this relationship. This is usually done by an artist with the help of a 3D modeling package and so is a semi-automatic process, but it is time consuming and driven by the artists idea of what looks right for their particular scene. Even though fully automatic UV unwrapping is possible it is usually prohibitively slow. - -Even if such an unwrapping were possible in a reasonable time frame, the next problem is that it would be invalidated as soon as the mesh changed. Enabling dynamic manipulation is one of the appealing factors of voxel terrain, and if this use case were discarded then the user may as well just model their terrain in an existing 3D modelling package and texture there. For these reasons we do not attempt to generate UV coordinates for smooth voxel meshes. - -The rational in the cubic case is almost the opposite. For Minecraft style terrain you want to simply line up an instance of a texture with each face of a cube, and generating the texture coordinates for this is very easy. In fact it's so easy that there's no point in doing it - the logic can instead be implemented in a shader which in turn allows the amount of data in each vertex to be reduced. - -Triplanar Texturing -------------------- -The most common approach to texture mapping smooth voxel terrain is to use *triplanar texturing*. The basic idea is to project a texture along all three main axes and blend between the three texture samples according to the surface normal. As an example, suppose that we wish to write a fragment shader to apply a single texture to our terrain, and assume that we have access to both the world space position of the fragment and also its normalised surface normal. Also, note that your textures should be set to wrap because the world space position will quickly go outside the bounds of 0.0-1.0. The world space position will need to have been passed through from earlier in the pipeline while the normal can be computed using one of the approaches in the lighting (link) document. The shader code would then look something like this [footnote: code is untested as is simplified compared to real world code. hopefully it compiles, but if not it should still give you an idea of how it works]: - -.. sourcecode:: glsl - - // Take the three texture samples - vec4 sampleX = texture2d(inputTexture, worldSpacePos.yz); // Project along x axis - vec4 sampleY = texture2d(inputTexture, worldSpacePos.xz); // Project along y axis - vec4 sampleZ = texture2d(inputTexture, worldSpacePos.xy); // Project along z axis - - // Blend the samples according to the normal - vec4 blendedColour = sampleX * normal.x + sampleY * normal.y + sampleZ * normal.z; - -Note that this approach will lead to the texture repeating once every world unit, and so in practice you may wish to scale the world space positions to make the texture appear the desired size. Also this technique can be extended to work with normal mapping though we won't go into the details here. - -This idea of triplanar texturing can be applied to the cubic meshes as well, and in some ways it can be considered to be even simpler. With cubic meshes the normal always points exactly along one of the main axes, and so it is not necessary to sample the texture three times nor to blend the results. Instead you can use conditional branching in the fragment shader to determine which pair of values out of {x,y,z} should be used as the texture coordinates. Something like: - -.. sourcecode:: glsl - - vec4 sample = vec4(0, 0, 0, 0); // We'll fill this in below - // Assume the normal is normalised. - if(normal.x > 0.9) // x must be one while y and z are zero - { - //Project onto yz plane - sample = texture2D(inputTexture, worldSpacePos.yz); - } - // Now similar logic for the other two axes. - . - . - . - -You might also choose to sample a different texture for each of the axes, in order to apply a different texture to each face of your cube. If so, you probably want to pack your different face textures together using an approach similar to those described later in this document for multiple material textures. Another (untested) idea would be to use the normal to select a face on a 1x1x1 cubemap, and have the cubemap face contain an index value for addressing the correct face texture. This could bypass the conditional logic above. - -Using the material identifier ------------------------------ -So far we have assumed that only a single material is being used for the entire voxel world, but this is seldom the case. It is common to associate a particular material with each voxel so that it can represent rock, wood, sand or any other type of material as required. The usual approach is to store a simple integer identifier with each voxel, and then map this identifier to material properties within your application. - -Both the CubicSurfaceExtractor and the MarchingCubesSurfacExtractor understand the concept of a material being associated with a voxel, and they will take this into account when generating a mesh. Specifically, they will both copy the material identifier into the vertex data of the output mesh, so you can pass it through to your shaders and use it to affect the way the surface is rendered. - -The following code snippet assumes that you have passed the material identifier to your shaders and that you can access it in the fragment shader. It then chooses which colour to draw the polygon based on this identifier: - -.. sourcecode:: glsl - - vec4 fragmentColour = vec4(1, 1, 1, 1); // Default value - if(materialId < 0.5) //Avoid '==' when working with floats. - { - fragmentColour = vec4(1, 0, 0, 1) // Draw material 0 as red. - } - else if(materialId < 1.5) //Avoid '==' when working with floats. - { - fragmentColour = vec4(0, 1, 0, 1) // Draw material 1 as green. - } - else if(materialId < 2.5) //Avoid '==' when working with floats. - { - fragmentColour = vec4(0, 0, 1, 1) // Draw material 2 as blue. - } - . - . - . - -This is a very simple example, and such use of conditional branching within the shader may not be the best approach as it incurs some performance overhead and becomes unwieldy with a large number of materials. Other approaches include encoding a colour directly into the material identifier, or using the identifier as an index into a texture atlas or array. - -Note that PolyVox currently stores that material identifier for the vertex as a float, but this will probably change in the future to use the same type as is stored in the volume. It will then be up to you which type you pass to the GPU (older GPUs may not support integer values) but if you do use floats then watch out for precision issues and avoid equality comparisons. - -Blending between materials --------------------------- -An additional complication when working with smooth voxel terrain is that it is usually desirable to blend smoothly between adjacent voxels with different materials. This situation does not occur with cubic meshes because the texture is considered to be per-face instead of per-vertex, and PolyVox enforces this by ensuring that all the vertices of a given face have the same material. - -With a smooth mesh it is possible for each of the three vertices of any given triangle to have different material identifiers. If this is not explicitly handled then the graphics hardware will interpolate these material values across the face of the triangle. Fundamentally, the concept of interpolating between material identifiers does not make sense, because if we have (for example) 1='grass', 2='rock' and 3='sand' then it does not make sense to say rock is the average of grass and sand. - -Correctly handling of this is a surprising difficult problem. For now, the best approach is described in our article 'Volumetric representation of virtual terrain' which appeared in Game Engine Gems Volume 1 and which is freely available through the Google Books preview here: http://books.google.com/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game%20engine%20gems&pg=PA39#v=onepage&q&f=false - -As off October 2012 we are actively researching alternative solutions to this problem though it will be some time before the results become available. - -Actual implementation of these material blending approaches is left as an exercise to the reader, though it is possible that in the future we will add some utility functions to PolyVox to assist with tasks such as splitting the mesh or adding the required extra vertex attributes. Our test implementations have performed the mesh processing on the CPU before the mesh is uploaded to the graphics card, but it does seem like there is a lot of potential for implementing these approaches in the geometry shader. - -Storage of textures -=================== -The other major challenge in texturing voxel based geometry is handling the large number of textures which such environments often require. As an example, a game like Minecraft has hundreds of different material types each with their own texture. The traditional approach to mesh texturing is to bind textures to *texture units* on the GPU before rendering a batch, but even modern GPUs only allow between 16-64 textures to be bound at a time. In this section we discuss various solutions to overcoming this limitation. - -There are various trade offs involved, but if you are targeting hardware with support for *texture arrays* (available from OpenGL 3 and Direct3D 10 on-wards) then we can save you some time and tell you that they are almost certainly the best solution. Otherwise you have to understand the various pros and cons of the other approaches described below. - -Separate texture units ----------------------- -Before we make things unnecessarily complicated, you should consider whether you do actually need the hundreds of textures discussed earlier. If you actually only need a few textures then the simplest solution may indeed be to pass them in via different texture units. You can then select the desired textures using a series of if statements, or a switch statement if the material identifiers are integer values. There is probably some performance overhead here, but you may find it is acceptable for a small number of textures. Keep in mind that you may need to reserve some texture units for additional texture data such as normal maps or shadow maps. - -Splitting the mesh ------------------- -If your required number of textures do indeed exceed the available number of textures units then one option is to break the mesh down into a number of pieces. Let's say you have a mesh which contains one hundred different materials. As an extreme solution you could break it down into one hundred separate meshes, and for each mesh you could then bind the required single texture before drawing the geometry. Obviously this will dramatically increase the batch count of your scene and so is not recommended. - -A more practical approach would be to break the mesh into a smaller number of pieces such that each mesh uses several textures but less than the maximum number of texture units. For example, our mesh with one hundred materials could be split into ten meshes, the first of which contains those triangles using materials 0-9, the seconds contains those triangles using materials 10-19, and so forth. There is a trade off here between the number of batches and the number of textures units used per batch. - -Furthermore, you could realise that although your terrain may use hundreds of different textures, any given region is likely to use only a small fraction of those. We have yet to experiment with this, but it seems if you region uses only (for example) materials 12, 47, and 231, then you could conceptually map these materials to the first three textures slots. This means that for each region you draw the mapping between material IDs and texture units would be different. This may require some complex logic in the application but could allow you to do much more with only a few texture units. We will investigate this further in the future. - -Texture atlases ---------------- -Probably the most widely used method is to pack a number of textures together into a single large texture, and to our knowledge this is the approach used by Minecraft. For example, if each of your textures are 256x256 texels, and if the maximum texture size supported by your target hardware is 4096x4096 texels, then you can pack 16 x 16 = 256 small textures into the larger one. If this isn't enough (or if your input textures are larger than 256x256) then you can also combine this approach with multiple texture units or with the mesh splitting described previously. - -However, there are a number of problems with packing textures like this. Most obviously, it limits the size of your textures as they now have to be significantly smaller then the maximum texture size. Whether this is a problem will really depend on your application. - -Next, it means you have to adjust your UV coordinates to correctly address a given texture inside the atlas. UV coordinates for a single texture would normally vary between 0.0 and 1.0 in both dimensions, but when packed into a texture atlas each texture uses only a small part of this range. You will need to apply offsets and scaling factors to your UV coordinates to address your texture correctly. - -However, the biggest problem with texture atlases is that they causes problems with texture filtering and with mipmaps. The filtering problem occurs because graphics hardware usually samples the surrounding texels and performs linear interpolation to compute the colour of a given sample point, but when multiple textures are packed together these surrounding texels can actually come from a neighbouring packed texture rather than wrapping round to sample on the other side of the same packed texture. The mipmap problem occurs because for the highest mipmap levels (such as 1x1 or 2x2) multiple textures are being are being averaged together. - -It is possible to combat these problems but the solutions are non-trivial. You will want to limit the number of miplevels which you use, and probably provide custom shader code to handle the wrapping of texture coordinates, the sampling of MIP maps, and the calculation of interpolated values. You can also try adding a border around all your packed textures, perhaps by duplicating each texture and offsetting by half its size. Even so, it's not clear to us at this point whether the the various artifacts can be completely removed. Minecraft handles it by completely disabling texture filtering and using the resulting pixelated look as part of its aesthetic. - -3D texture slices ------------------ -The idea here is similar to the texture atlas approach, but rather than packing texture side-by-side in an atlas they are instead packed as slices in a 3D texture. We haven't actually tested this but in theory it may have a couple of benefits. Firstly, it simplifies the addressing of the texture as there is no need to offset/scale the UV coordinates, and the W coordinate (the slice index) can be more easily computed from the material identifier. Secondly, a single volume texture will usually be able to hold more texels than a single 2D texture (for example, 512x512x512 is bigger than 4096x4096). Lastly, it should simplify the filtering problem as packed textures are no longer tiled and so should wrap correctly. - -However, MIP mapping will probably be more complex than the texture atlas case because even the first MIP level will involve combining adjacent slices. Volume textures are also not so widely supported and may be particularly problematic on mobile hardware. - -Texture arrays --------------- -These provide the perfect solution to the problem of handling a large number of textures... at least if they are supported by your hardware. They were introduced with OpenGL 3 and Direct3D 10 but older versions of OpenGL may still be able to access the functionality via extensions. They allow you to bind an array of textures to the shader, and the advantage compared to a texture atlas is that the hardware understands that the textures are separate and so avoids the filtering and mipmapping issues. Beyond the hardware requirements, the only real limitation is that all the textures must be the same size. - -Bindless rendering ------------------- +*************** +Texture Mapping +*************** +The PolyVox library is only concerned with operations on volume data (such as extracting a mesh from from a volume) and deliberately avoids the issue of rendering any resulting polygon meshes. This means PolyVox is not tied to any particular graphics API or rendering engine, and makes it much easier to integrate PolyVox with existing technology, because in general a PolyVox mesh can be treated the same as any other mesh. However, the texturing of a PolyVox mesh is usually handled a little differently, and so the purpose of this document is to provide some ideas about where to start with this process. + +This document is aimed at readers in one of two positions: + +1. You are trying to texture 'Minecraft-style' terrain with cubic blocks and a number of different materials. +2. You are trying to texture smooth terrain produced by the Marching Cubes (or similar) algorithm. + +These are certainly not the limit of PolyVox, and you can choose much more advanced texturing approaches if you wish. For example, in the past we have texture mapped a voxel Earth from a cube map and used an animated *procedural* texture (based on Perlin noise) for the magma at the center of the Earth. However, if you are aiming for such advanced techniques then we assume you understand the basics in this document and have enough knowledge to expand the ideas yourself. But do feel free to drop by and ask questions on our forum. + +Traditionally meshes are textured by providing a pair of UV texture coordinates for each vertex, and these UV coordinates determine which parts of a texture maps to each vertex. The process of texturing PolyVox meshes is more complex for a couple of reasons: + +1. PolyVox does not provide UV coordinates for each vertex. +2. Voxel terrain (particularly Minecraft-style) often involves many more textures than the GPU can read at a time. + +By reading this document you should learn how to work around the above problems, though you will almost certainly need to follow provided links and do some further reading as we have only summarised the key ideas here. + +Mapping textures to mesh geometry +================================= +The lack of UV coordinates means some lateral thinking is required in order to apply texture maps to meshes. But before we get to that, we will first try to explain the rational behind PolyVox not providing UV coordinates in the first place. This rational is different for the smooth voxel meshes vs the cubic voxel meshes. + +Rational +-------- +The problem with texturing smooth voxel meshes is that the geometry can get very complex and it is not clear how the mapping between mesh geometry and a texture should be performed. In a traditional heightmap-based terrain this relationship is obvious as the texture map and heightmap simply line up directly. But for more complex shapes some form of 'UV unwrapping' is usually performed to define this relationship. This is usually done by an artist with the help of a 3D modeling package and so is a semi-automatic process, but it is time consuming and driven by the artists idea of what looks right for their particular scene. Even though fully automatic UV unwrapping is possible it is usually prohibitively slow. + +Even if such an unwrapping were possible in a reasonable time frame, the next problem is that it would be invalidated as soon as the mesh changed. Enabling dynamic manipulation is one of the appealing factors of voxel terrain, and if this use case were discarded then the user may as well just model their terrain in an existing 3D modelling package and texture there. For these reasons we do not attempt to generate UV coordinates for smooth voxel meshes. + +The rational in the cubic case is almost the opposite. For Minecraft style terrain you want to simply line up an instance of a texture with each face of a cube, and generating the texture coordinates for this is very easy. In fact it's so easy that there's no point in doing it - the logic can instead be implemented in a shader which in turn allows the amount of data in each vertex to be reduced. + +Triplanar Texturing +------------------- +The most common approach to texture mapping smooth voxel terrain is to use *triplanar texturing*. The basic idea is to project a texture along all three main axes and blend between the three texture samples according to the surface normal. As an example, suppose that we wish to write a fragment shader to apply a single texture to our terrain, and assume that we have access to both the world space position of the fragment and also its normalised surface normal. Also, note that your textures should be set to wrap because the world space position will quickly go outside the bounds of 0.0-1.0. The world space position will need to have been passed through from earlier in the pipeline while the normal can be computed using one of the approaches in the lighting (link) document. The shader code would then look something like this [footnote: code is untested as is simplified compared to real world code. hopefully it compiles, but if not it should still give you an idea of how it works]: + +.. sourcecode:: glsl + + // Take the three texture samples + vec4 sampleX = texture2d(inputTexture, worldSpacePos.yz); // Project along x axis + vec4 sampleY = texture2d(inputTexture, worldSpacePos.xz); // Project along y axis + vec4 sampleZ = texture2d(inputTexture, worldSpacePos.xy); // Project along z axis + + // Blend the samples according to the normal + vec4 blendedColour = sampleX * normal.x + sampleY * normal.y + sampleZ * normal.z; + +Note that this approach will lead to the texture repeating once every world unit, and so in practice you may wish to scale the world space positions to make the texture appear the desired size. Also this technique can be extended to work with normal mapping though we won't go into the details here. + +This idea of triplanar texturing can be applied to the cubic meshes as well, and in some ways it can be considered to be even simpler. With cubic meshes the normal always points exactly along one of the main axes, and so it is not necessary to sample the texture three times nor to blend the results. Instead you can use conditional branching in the fragment shader to determine which pair of values out of {x,y,z} should be used as the texture coordinates. Something like: + +.. sourcecode:: glsl + + vec4 sample = vec4(0, 0, 0, 0); // We'll fill this in below + // Assume the normal is normalised. + if(normal.x > 0.9) // x must be one while y and z are zero + { + //Project onto yz plane + sample = texture2D(inputTexture, worldSpacePos.yz); + } + // Now similar logic for the other two axes. + . + . + . + +You might also choose to sample a different texture for each of the axes, in order to apply a different texture to each face of your cube. If so, you probably want to pack your different face textures together using an approach similar to those described later in this document for multiple material textures. Another (untested) idea would be to use the normal to select a face on a 1x1x1 cubemap, and have the cubemap face contain an index value for addressing the correct face texture. This could bypass the conditional logic above. + +Using the material identifier +----------------------------- +So far we have assumed that only a single material is being used for the entire voxel world, but this is seldom the case. It is common to associate a particular material with each voxel so that it can represent rock, wood, sand or any other type of material as required. The usual approach is to store a simple integer identifier with each voxel, and then map this identifier to material properties within your application. + +Both the CubicSurfaceExtractor and the MarchingCubesSurfacExtractor understand the concept of a material being associated with a voxel, and they will take this into account when generating a mesh. Specifically, they will both copy the material identifier into the vertex data of the output mesh, so you can pass it through to your shaders and use it to affect the way the surface is rendered. + +The following code snippet assumes that you have passed the material identifier to your shaders and that you can access it in the fragment shader. It then chooses which colour to draw the polygon based on this identifier: + +.. sourcecode:: glsl + + vec4 fragmentColour = vec4(1, 1, 1, 1); // Default value + if(materialId < 0.5) //Avoid '==' when working with floats. + { + fragmentColour = vec4(1, 0, 0, 1) // Draw material 0 as red. + } + else if(materialId < 1.5) //Avoid '==' when working with floats. + { + fragmentColour = vec4(0, 1, 0, 1) // Draw material 1 as green. + } + else if(materialId < 2.5) //Avoid '==' when working with floats. + { + fragmentColour = vec4(0, 0, 1, 1) // Draw material 2 as blue. + } + . + . + . + +This is a very simple example, and such use of conditional branching within the shader may not be the best approach as it incurs some performance overhead and becomes unwieldy with a large number of materials. Other approaches include encoding a colour directly into the material identifier, or using the identifier as an index into a texture atlas or array. + +Note that PolyVox currently stores that material identifier for the vertex as a float, but this will probably change in the future to use the same type as is stored in the volume. It will then be up to you which type you pass to the GPU (older GPUs may not support integer values) but if you do use floats then watch out for precision issues and avoid equality comparisons. + +Blending between materials +-------------------------- +An additional complication when working with smooth voxel terrain is that it is usually desirable to blend smoothly between adjacent voxels with different materials. This situation does not occur with cubic meshes because the texture is considered to be per-face instead of per-vertex, and PolyVox enforces this by ensuring that all the vertices of a given face have the same material. + +With a smooth mesh it is possible for each of the three vertices of any given triangle to have different material identifiers. If this is not explicitly handled then the graphics hardware will interpolate these material values across the face of the triangle. Fundamentally, the concept of interpolating between material identifiers does not make sense, because if we have (for example) 1='grass', 2='rock' and 3='sand' then it does not make sense to say rock is the average of grass and sand. + +Correctly handling of this is a surprising difficult problem. For now, the best approach is described in our article 'Volumetric representation of virtual terrain' which appeared in Game Engine Gems Volume 1 and which is freely available through the Google Books preview here: http://books.google.com/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game%20engine%20gems&pg=PA39#v=onepage&q&f=false + +As off October 2012 we are actively researching alternative solutions to this problem though it will be some time before the results become available. + +Actual implementation of these material blending approaches is left as an exercise to the reader, though it is possible that in the future we will add some utility functions to PolyVox to assist with tasks such as splitting the mesh or adding the required extra vertex attributes. Our test implementations have performed the mesh processing on the CPU before the mesh is uploaded to the graphics card, but it does seem like there is a lot of potential for implementing these approaches in the geometry shader. + +Storage of textures +=================== +The other major challenge in texturing voxel based geometry is handling the large number of textures which such environments often require. As an example, a game like Minecraft has hundreds of different material types each with their own texture. The traditional approach to mesh texturing is to bind textures to *texture units* on the GPU before rendering a batch, but even modern GPUs only allow between 16-64 textures to be bound at a time. In this section we discuss various solutions to overcoming this limitation. + +There are various trade offs involved, but if you are targeting hardware with support for *texture arrays* (available from OpenGL 3 and Direct3D 10 on-wards) then we can save you some time and tell you that they are almost certainly the best solution. Otherwise you have to understand the various pros and cons of the other approaches described below. + +Separate texture units +---------------------- +Before we make things unnecessarily complicated, you should consider whether you do actually need the hundreds of textures discussed earlier. If you actually only need a few textures then the simplest solution may indeed be to pass them in via different texture units. You can then select the desired textures using a series of if statements, or a switch statement if the material identifiers are integer values. There is probably some performance overhead here, but you may find it is acceptable for a small number of textures. Keep in mind that you may need to reserve some texture units for additional texture data such as normal maps or shadow maps. + +Splitting the mesh +------------------ +If your required number of textures do indeed exceed the available number of textures units then one option is to break the mesh down into a number of pieces. Let's say you have a mesh which contains one hundred different materials. As an extreme solution you could break it down into one hundred separate meshes, and for each mesh you could then bind the required single texture before drawing the geometry. Obviously this will dramatically increase the batch count of your scene and so is not recommended. + +A more practical approach would be to break the mesh into a smaller number of pieces such that each mesh uses several textures but less than the maximum number of texture units. For example, our mesh with one hundred materials could be split into ten meshes, the first of which contains those triangles using materials 0-9, the seconds contains those triangles using materials 10-19, and so forth. There is a trade off here between the number of batches and the number of textures units used per batch. + +Furthermore, you could realise that although your terrain may use hundreds of different textures, any given region is likely to use only a small fraction of those. We have yet to experiment with this, but it seems if you region uses only (for example) materials 12, 47, and 231, then you could conceptually map these materials to the first three textures slots. This means that for each region you draw the mapping between material IDs and texture units would be different. This may require some complex logic in the application but could allow you to do much more with only a few texture units. We will investigate this further in the future. + +Texture atlases +--------------- +Probably the most widely used method is to pack a number of textures together into a single large texture, and to our knowledge this is the approach used by Minecraft. For example, if each of your textures are 256x256 texels, and if the maximum texture size supported by your target hardware is 4096x4096 texels, then you can pack 16 x 16 = 256 small textures into the larger one. If this isn't enough (or if your input textures are larger than 256x256) then you can also combine this approach with multiple texture units or with the mesh splitting described previously. + +However, there are a number of problems with packing textures like this. Most obviously, it limits the size of your textures as they now have to be significantly smaller then the maximum texture size. Whether this is a problem will really depend on your application. + +Next, it means you have to adjust your UV coordinates to correctly address a given texture inside the atlas. UV coordinates for a single texture would normally vary between 0.0 and 1.0 in both dimensions, but when packed into a texture atlas each texture uses only a small part of this range. You will need to apply offsets and scaling factors to your UV coordinates to address your texture correctly. + +However, the biggest problem with texture atlases is that they causes problems with texture filtering and with mipmaps. The filtering problem occurs because graphics hardware usually samples the surrounding texels and performs linear interpolation to compute the colour of a given sample point, but when multiple textures are packed together these surrounding texels can actually come from a neighbouring packed texture rather than wrapping round to sample on the other side of the same packed texture. The mipmap problem occurs because for the highest mipmap levels (such as 1x1 or 2x2) multiple textures are being are being averaged together. + +It is possible to combat these problems but the solutions are non-trivial. You will want to limit the number of miplevels which you use, and probably provide custom shader code to handle the wrapping of texture coordinates, the sampling of MIP maps, and the calculation of interpolated values. You can also try adding a border around all your packed textures, perhaps by duplicating each texture and offsetting by half its size. Even so, it's not clear to us at this point whether the the various artifacts can be completely removed. Minecraft handles it by completely disabling texture filtering and using the resulting pixelated look as part of its aesthetic. + +3D texture slices +----------------- +The idea here is similar to the texture atlas approach, but rather than packing texture side-by-side in an atlas they are instead packed as slices in a 3D texture. We haven't actually tested this but in theory it may have a couple of benefits. Firstly, it simplifies the addressing of the texture as there is no need to offset/scale the UV coordinates, and the W coordinate (the slice index) can be more easily computed from the material identifier. Secondly, a single volume texture will usually be able to hold more texels than a single 2D texture (for example, 512x512x512 is bigger than 4096x4096). Lastly, it should simplify the filtering problem as packed textures are no longer tiled and so should wrap correctly. + +However, MIP mapping will probably be more complex than the texture atlas case because even the first MIP level will involve combining adjacent slices. Volume textures are also not so widely supported and may be particularly problematic on mobile hardware. + +Texture arrays +-------------- +These provide the perfect solution to the problem of handling a large number of textures... at least if they are supported by your hardware. They were introduced with OpenGL 3 and Direct3D 10 but older versions of OpenGL may still be able to access the functionality via extensions. They allow you to bind an array of textures to the shader, and the advantage compared to a texture atlas is that the hardware understands that the textures are separate and so avoids the filtering and mipmapping issues. Beyond the hardware requirements, the only real limitation is that all the textures must be the same size. + +Bindless rendering +------------------ We don't have much to say about this option as it needs significant research, but bindless rendering is one of the new OpenGL extensions to come out of Nvidia. The idea is that it removes the abstraction of needing to 'bind' a texture to a particular texture unit, and instead allows more direct access to the texture data on the GPU. This means you can have access to a much larger number of textures from your shader. Sounds useful, but we've yet to investigate it. \ No newline at end of file diff --git a/documentation/Threading.rst b/documentation/Threading.rst index fc4d2245..c36d26df 100644 --- a/documentation/Threading.rst +++ b/documentation/Threading.rst @@ -1,69 +1,69 @@ -********* -Threading -********* -Modern computing hardware typically contains a large number of processors, and so users of PolyVox often want to know how they can best make use of these from their applications. - -PolyVox does not make any guarantees about thread-safety, and does not contain any threading primitives to protect access to data structures. You can still make use of PolyVox from multiple threads, but you will have to take responsibility for enforcing thread safety yourself (e.g. by providing thread safe wrappers around the volume classes). If you do want to use PolyVox is a multi-threaded context then this document provides some tips and tricks that you might find useful. - -However, be aware that we do not have a lot of expertise in threading, and this is part of the reason why it is not explicitly addressed within PolyVox. If you do have more experience and believe any of this information to be misleading then please do post on the forums to discuss it. - -Volumes -======= -Volumes are a core aspect of PolyVox, and so a natural question is whether it is safe to simultaneously access a given volume from multiple threads. The answer to this is actually fairly complex and is also dependent on the type of volume which is being used. - -RawVolume ---------- -The RawVolume has a very simple internal structure in which the data is stored as a single array which is never moved or resized. Because of this property it is indeed safe to perform multiple simultaneous *reads* of the data from different threads. However, it is generally not safe to perform simultaneous writes from different threads, or even to write from only one thread while other threads are reading. - -The reason why simultaneous writes can be problematic should be fairly obvious - if two different threads try to write to the same voxel then the result will depend on which thread writes first. But why can't we write from one thread and read from another one? The problem here is that the the CPU may implement some kind of caching mechanism and/or choose to store data in registers. If a write operation occurs before a read, then the read *may* still obtain the old value because the cache has not been updated yet. There may even be a cache for each thread (particularly if running on multiple processors). - -If we assume for a moment that each voxel is a simple integer, then the rules for accessing a single voxel from multiple threads are the same as the rules for accessing integers from multiple threads. There is some useful information about this available on the web, including a discussion on StackOverflow: http://stackoverflow.com/questions/4588915/can-an-integer-be-shared-between-threads-safely - -If nothing else, this serves to illustrate that multi-threaded access even to something as simple as an integer can be surprisingly complex and architecture dependant. - -However, all this has been in the context of accessing a *single* voxel from multiple threads... what if we carefully design our algorithm such that different threads access different parts of the volume which never overlap? Unfortunately I don't believe this is a solution either. Caching mechanisms seldom operate on individual elements but instead tend to cache larger chunks of data on the grounds that data accesses are usually localised. So it's quite possible that accessing a given voxel will cause another voxel to be cached. - -C++ does provide the 'volatile' keyword which can be used to ensure a variable is updated immediately (rather than being cached) but this is still not sufficient for thread safe code. It also has performance implications which we would like to avoid. More information about volatile and multitheaded programming can be found here: http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/ - -Lastly, note that PolyVox volumes are templatised which means the voxel type might be something other than a simple int. However we don't think this actually makes a difference given that so few guarantees are made anyway, and it should still be safe to perform multiple concurrent reads for more complex types. - -PagedVolume ------------ -NOTE: The info below is based on LargeVolume, which PagedVolume has replaced. It is likely that the same limitations apply but this has not been well tested. We do intend to improve the thread safty of PagedVolume in the future. - -The LargeVolume provides even less thread safety than the RawVolume, in that even concurrent read operations can cause problems. The reason for this is the more complex memory management which is performed behind the scenes, and which allows pieces of volume data to be moved around and deleted. For example, a read of a single voxel may mean that the block of data associated with that voxel has to be paged in to memory, which in turn may mean that another block of data has to be paged out of memory. If second thread was halfway through reading a voxel in this second block of data then a problem will occur. - -In the future we may do a more comprehensive analysis of thread safety in the LargeVolume, but for now you should assume that any multithreaded access can cause problems. - -Consequences of abuse ---------------------- -We have outlined above the rules for multithreaded access of volumes, but what actually happens if you violate these? There's a couple of things to watch out for: - -- As mentioned, performing unprotected writes to the volume can cause problems because the data may be copied into the CPU cache and/or registers, and so a subsequent read could retrieve the old value. This is not what you want but probably won't be fatal (i.e. it shouldn't crash). It would basically manifest itself as data corruption. -- If you access the LargeVolume in a multithreaded fashion then you risk trying to access data which has been removed by another thread, and in this case you will get undefined behaviour. This will probably be a crash (out of bounds access) but really anything could happen. - -Surface Extraction -================== -Despite the lack of thread safety built in to PolyVox, it is still possible and often desirable to make use of multiple threads for tasks such as surface extraction. Performing surface extraction does not require write access to the data, and we've already established that you can safely perform reads from different threads *provided you are not using the LargeVolume*. - -Combining multiple surface extraction threads with the *LargeVolume* is something we will need to experiment with in the future, to determine how it can be improved. - -In the future we will expand this section to discuss how to split surface extraction across a number of threads, but for now please see Section XX of the book chapter 'Volumetric Representation of Virtual environments', available for free here: http://books.google.nl/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game+engine+gems&pg=PA39&redir_esc=y#v=onepage&q&f=false - -GPU thread safety -================= -Be aware that even if you successfully perform surface across multiple threads you still need to take care when uploading the data to the GPU. For Direct3D 9.0 and OpenGL 2.0 it is only possible to upload data from the main thread (or more accurately the one which owns the rendering context). So after you have performed your multi-threaded surface extraction you need to bring the data back to the main thread for uploading to the GPU. - -More recent versions of the Direct3D and OpenGL APIs lift this restriction and provide means of accessing GPU resources from multiple threads. Please consult the documentation for your API for details. - -Future work -=========== -Threading support is not a high priority for PolyVox because it can be implemented by the user at a higher level. However, there are a couple of areas we may investigate in the future. - -Thread safe volume wrapper --------------------------- -It might be useful to provide a thread safe wrapper around the volume classes, and this could possibly be included in the PolyVox utilities or as a extra library. This thread safe wrapper could be templatised to work with any internal volume type, and could itself be a volume so that it can be used directly with the existing algorithms. - -OpenMP ------- +********* +Threading +********* +Modern computing hardware typically contains a large number of processors, and so users of PolyVox often want to know how they can best make use of these from their applications. + +PolyVox does not make any guarantees about thread-safety, and does not contain any threading primitives to protect access to data structures. You can still make use of PolyVox from multiple threads, but you will have to take responsibility for enforcing thread safety yourself (e.g. by providing thread safe wrappers around the volume classes). If you do want to use PolyVox is a multi-threaded context then this document provides some tips and tricks that you might find useful. + +However, be aware that we do not have a lot of expertise in threading, and this is part of the reason why it is not explicitly addressed within PolyVox. If you do have more experience and believe any of this information to be misleading then please do post on the forums to discuss it. + +Volumes +======= +Volumes are a core aspect of PolyVox, and so a natural question is whether it is safe to simultaneously access a given volume from multiple threads. The answer to this is actually fairly complex and is also dependent on the type of volume which is being used. + +RawVolume +--------- +The RawVolume has a very simple internal structure in which the data is stored as a single array which is never moved or resized. Because of this property it is indeed safe to perform multiple simultaneous *reads* of the data from different threads. However, it is generally not safe to perform simultaneous writes from different threads, or even to write from only one thread while other threads are reading. + +The reason why simultaneous writes can be problematic should be fairly obvious - if two different threads try to write to the same voxel then the result will depend on which thread writes first. But why can't we write from one thread and read from another one? The problem here is that the the CPU may implement some kind of caching mechanism and/or choose to store data in registers. If a write operation occurs before a read, then the read *may* still obtain the old value because the cache has not been updated yet. There may even be a cache for each thread (particularly if running on multiple processors). + +If we assume for a moment that each voxel is a simple integer, then the rules for accessing a single voxel from multiple threads are the same as the rules for accessing integers from multiple threads. There is some useful information about this available on the web, including a discussion on StackOverflow: http://stackoverflow.com/questions/4588915/can-an-integer-be-shared-between-threads-safely + +If nothing else, this serves to illustrate that multi-threaded access even to something as simple as an integer can be surprisingly complex and architecture dependant. + +However, all this has been in the context of accessing a *single* voxel from multiple threads... what if we carefully design our algorithm such that different threads access different parts of the volume which never overlap? Unfortunately I don't believe this is a solution either. Caching mechanisms seldom operate on individual elements but instead tend to cache larger chunks of data on the grounds that data accesses are usually localised. So it's quite possible that accessing a given voxel will cause another voxel to be cached. + +C++ does provide the 'volatile' keyword which can be used to ensure a variable is updated immediately (rather than being cached) but this is still not sufficient for thread safe code. It also has performance implications which we would like to avoid. More information about volatile and multitheaded programming can be found here: http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/ + +Lastly, note that PolyVox volumes are templatised which means the voxel type might be something other than a simple int. However we don't think this actually makes a difference given that so few guarantees are made anyway, and it should still be safe to perform multiple concurrent reads for more complex types. + +PagedVolume +----------- +NOTE: The info below is based on LargeVolume, which PagedVolume has replaced. It is likely that the same limitations apply but this has not been well tested. We do intend to improve the thread safty of PagedVolume in the future. + +The LargeVolume provides even less thread safety than the RawVolume, in that even concurrent read operations can cause problems. The reason for this is the more complex memory management which is performed behind the scenes, and which allows pieces of volume data to be moved around and deleted. For example, a read of a single voxel may mean that the block of data associated with that voxel has to be paged in to memory, which in turn may mean that another block of data has to be paged out of memory. If second thread was halfway through reading a voxel in this second block of data then a problem will occur. + +In the future we may do a more comprehensive analysis of thread safety in the LargeVolume, but for now you should assume that any multithreaded access can cause problems. + +Consequences of abuse +--------------------- +We have outlined above the rules for multithreaded access of volumes, but what actually happens if you violate these? There's a couple of things to watch out for: + +- As mentioned, performing unprotected writes to the volume can cause problems because the data may be copied into the CPU cache and/or registers, and so a subsequent read could retrieve the old value. This is not what you want but probably won't be fatal (i.e. it shouldn't crash). It would basically manifest itself as data corruption. +- If you access the LargeVolume in a multithreaded fashion then you risk trying to access data which has been removed by another thread, and in this case you will get undefined behaviour. This will probably be a crash (out of bounds access) but really anything could happen. + +Surface Extraction +================== +Despite the lack of thread safety built in to PolyVox, it is still possible and often desirable to make use of multiple threads for tasks such as surface extraction. Performing surface extraction does not require write access to the data, and we've already established that you can safely perform reads from different threads *provided you are not using the LargeVolume*. + +Combining multiple surface extraction threads with the *LargeVolume* is something we will need to experiment with in the future, to determine how it can be improved. + +In the future we will expand this section to discuss how to split surface extraction across a number of threads, but for now please see Section XX of the book chapter 'Volumetric Representation of Virtual environments', available for free here: http://books.google.nl/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game+engine+gems&pg=PA39&redir_esc=y#v=onepage&q&f=false + +GPU thread safety +================= +Be aware that even if you successfully perform surface across multiple threads you still need to take care when uploading the data to the GPU. For Direct3D 9.0 and OpenGL 2.0 it is only possible to upload data from the main thread (or more accurately the one which owns the rendering context). So after you have performed your multi-threaded surface extraction you need to bring the data back to the main thread for uploading to the GPU. + +More recent versions of the Direct3D and OpenGL APIs lift this restriction and provide means of accessing GPU resources from multiple threads. Please consult the documentation for your API for details. + +Future work +=========== +Threading support is not a high priority for PolyVox because it can be implemented by the user at a higher level. However, there are a couple of areas we may investigate in the future. + +Thread safe volume wrapper +-------------------------- +It might be useful to provide a thread safe wrapper around the volume classes, and this could possibly be included in the PolyVox utilities or as a extra library. This thread safe wrapper could be templatised to work with any internal volume type, and could itself be a volume so that it can be used directly with the existing algorithms. + +OpenMP +------ This is a standard for extending C++ with compiler directives which allow the compiler to automatically parallelise sections of code. Most likely this could be used to parallelise some of the loops which occur in image processing tasks. \ No newline at end of file diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 9d6e280e..ea00da94 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -1,4 +1,4 @@ -Changelog -######### - -.. include:: ../CHANGELOG.txt +Changelog +######### + +.. include:: ../CHANGELOG.txt diff --git a/documentation/conf.in.py b/documentation/conf.in.py index 8b8e3a41..c7c6afac 100644 --- a/documentation/conf.in.py +++ b/documentation/conf.in.py @@ -1,232 +1,232 @@ -# -*- coding: utf-8 -*- -# -# PolyVox documentation build configuration file, created by -# sphinx-quickstart on Tue Jul 6 14:46:57 2010. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@/_extensions') - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinxcontrib.doxylink'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'PolyVox' -copyright = u'2013, David Williams, Matt Williams' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '@POLYVOX_VERSION@' -# The full version, including alpha/beta/rc tags. -release = '@POLYVOX_VERSION@' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -language = "en" - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -#htmlhelp_basename = 'PolyVoxdoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'PolyVox.tex', u'PolyVox Documentation', - u'David Williams, Matt Williams', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'polyvox', u'PolyVox Documentation', - [u'David Williams, Matt Williams'], 1) -] - - -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} - -doxylink = { - 'polyvox' : ('@CMAKE_CURRENT_BINARY_DIR@/../library/PolyVox.tag', '../library/doc/html/') #Make this '../api/' for uploading -} - -#This must be lowercase for QtHelp -qthelp_basename = "polyvox" - -primary_domain = "c++" - -# Default higlighting scheme to use for `code-block` directives -highlight_language = "c++" +# -*- coding: utf-8 -*- +# +# PolyVox documentation build configuration file, created by +# sphinx-quickstart on Tue Jul 6 14:46:57 2010. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@/_extensions') + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinxcontrib.doxylink'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'PolyVox' +copyright = u'2013, David Williams, Matt Williams' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '@POLYVOX_VERSION@' +# The full version, including alpha/beta/rc tags. +release = '@POLYVOX_VERSION@' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +language = "en" + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +#htmlhelp_basename = 'PolyVoxdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'PolyVox.tex', u'PolyVox Documentation', + u'David Williams, Matt Williams', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'polyvox', u'PolyVox Documentation', + [u'David Williams, Matt Williams'], 1) +] + + +# Example configuration for intersphinx: refer to the Python standard library. +#intersphinx_mapping = {'http://docs.python.org/': None} + +doxylink = { + 'polyvox' : ('@CMAKE_CURRENT_BINARY_DIR@/../library/PolyVox.tag', '../library/doc/html/') #Make this '../api/' for uploading +} + +#This must be lowercase for QtHelp +qthelp_basename = "polyvox" + +primary_domain = "c++" + +# Default higlighting scheme to use for `code-block` directives +highlight_language = "c++" diff --git a/documentation/index.rst b/documentation/index.rst index 8f5ac27b..3918eb49 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -1,41 +1,41 @@ -Welcome to PolyVox's documentation! -=================================== - -User Guide: - -.. toctree:: - :maxdepth: 1 - - Prerequisites - install - principles - Lighting - TextureMapping - ModifyingTerrain - LevelOfDetail - Threading - ErrorHandling - -Examples: - -.. toctree:: - :maxdepth: 1 - - tutorial1 - python-bindings - -Other Information: - -.. toctree:: - :maxdepth: 1 - - changelog - FAQ - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`search` - +Welcome to PolyVox's documentation! +=================================== + +User Guide: + +.. toctree:: + :maxdepth: 1 + + Prerequisites + install + principles + Lighting + TextureMapping + ModifyingTerrain + LevelOfDetail + Threading + ErrorHandling + +Examples: + +.. toctree:: + :maxdepth: 1 + + tutorial1 + python-bindings + +Other Information: + +.. toctree:: + :maxdepth: 1 + + changelog + FAQ + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` + diff --git a/documentation/install.rst b/documentation/install.rst index cafb3133..6e95c518 100644 --- a/documentation/install.rst +++ b/documentation/install.rst @@ -1 +1 @@ -.. include:: ../INSTALL.txt +.. include:: ../INSTALL.txt diff --git a/documentation/make.bat b/documentation/make.bat index 121e2f90..b0fa8d43 100644 --- a/documentation/make.bat +++ b/documentation/make.bat @@ -1,155 +1,155 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PolyVox.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PolyVox.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PolyVox.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PolyVox.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/documentation/principles.rst b/documentation/principles.rst index ecfbcef1..b7c9c1b4 100644 --- a/documentation/principles.rst +++ b/documentation/principles.rst @@ -1,14 +1,14 @@ -********************** -Principles of PolyVox -********************** - -.. warning :: - This section is being written and is just a skeleton for now - -PolyVox provides a library for managing 3D arrays (volumes) of data (voxels). It gives you the tools to iterate through, randomly access, read and write volumes. It supports any type you'd like to represent each voxel whether it's just an ``int`` or a class which encapsulates both density and colour. - -Once you have a volume, PolyVox provides a number of tools for turning it into something that you can pass to your rendering engine. These are called `surface extractors`. - -Each surface extractor needs to be told how to interperet your voxel type and that is done using... - -Link to a page describing how to write your own voxel type and link it to a surface extractor... +********************** +Principles of PolyVox +********************** + +.. warning :: + This section is being written and is just a skeleton for now + +PolyVox provides a library for managing 3D arrays (volumes) of data (voxels). It gives you the tools to iterate through, randomly access, read and write volumes. It supports any type you'd like to represent each voxel whether it's just an ``int`` or a class which encapsulates both density and colour. + +Once you have a volume, PolyVox provides a number of tools for turning it into something that you can pass to your rendering engine. These are called `surface extractors`. + +Each surface extractor needs to be told how to interperet your voxel type and that is done using... + +Link to a page describing how to write your own voxel type and link it to a surface extractor... diff --git a/documentation/tutorial1.rst b/documentation/tutorial1.rst index 44660cb5..ec89b8cd 100644 --- a/documentation/tutorial1.rst +++ b/documentation/tutorial1.rst @@ -1,166 +1,166 @@ -********************** -Tutorial 1 - Basic use -********************** - -Introduction -============ -This tutorial covers the basic use of the PolyVox API. After reading this tutorial you should have a good idea how to create a PolyVox volume and fill it with data, extract a triangle mesh representing the surface, and render the result. This tutorial assumes you are already familiar with the basic concepts behind PolyVox (see the :doc:`principles of polyvox ` document if not), and are reasonably confident with 3D graphics and C++. It also assumes you have already got PolyVox installed on your system, if this is not the case then please consult :doc:`installation guide `. - -The code samples and text in this tutorial correspond directly to the BasicExample which comes with PolyVox. This example uses the Qt toolkit for window and input handling, and for providing an OpenGL context to render into. In this tutorial we will omit code which performs these tasks and will instead focus on on the PolyVox code. You can consult the `Qt documentation `_ if you want more information about these other aspects of the system. - -Creating a volume -================= -To get started, we need to include the following headers: - -.. sourcecode:: c++ - - #include "PolyVoxCore/CubicSurfaceExtractorWithNormals.h" - #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" - #include "PolyVoxCore/SurfaceMesh.h" - #include "PolyVoxCore/SimpleVolume.h" - -The most fundamental construct when working with PolyVox is that of the volume. This is represented by the :polyvox:`SimpleVolume` class which stores a 3D grid of voxels. Our basic example application creates a volume with the following line of code: - -.. sourcecode:: c++ - - SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); - -As can be seen, the SimpleVolume class is templated upon the voxel type. This means it is straightforward to create a volume of integers, floats, or a custom voxel type (see the :polyvox:`SimpleVolume documentation ` for more details). In this particular case we have created a volume in which each voxel is of type `uint8_t` which is an unsigned 8-bit integer. - -Next, we set some of the voxels in the volume to be 'solid' in order to create a large sphere in the centre of the volume. We do this with the following function call: - -.. sourcecode:: c++ - - createSphereInVolume(volData, 30); - -Note that this function is part of the BasicExample (rather than being part of the PolyVox library) and is implemented as follows: - -.. sourcecode:: c++ - - void createSphereInVolume(SimpleVolume& volData, float fRadius) - { - //This vector hold the position of the center of the volume - Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); - - //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getDepth(); z++) - { - for (int y = 0; y < volData.getHeight(); y++) - { - for (int x = 0; x < volData.getWidth(); x++) - { - //Store our current position as a vector... - Vector3DFloat v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - uint8_t uVoxelValue = 0; - - //If the current voxel is less than 'radius' units from the center then we make it solid. - if(fDistToCenter <= fRadius) - { - //Our new voxel value - uVoxelValue = 255; - } - - //Wrte the voxel value into the volume - volData.setVoxelAt(x, y, z, uVoxelValue); - } - } - } - } - -This function takes as input the :polyvox:`SimpleVolume` in which we want to create the sphere, and also a radius specifying how large we want the sphere to be. In our case we have specified a radius of 30 voxels, which will fit nicely inside our :polyvox:`SimpleVolume` of dimensions 64x64x64. - -Because this is a simple example function it always places the sphere at the centre of the volume. It computes this centre by halving the dimensions of the volume as given by the functions :polyvox:`SimpleVolume::getWidth`, :polyvox:`SimpleVolume::getHeight` and :polyvox:`SimpleVolume::getDepth`. The resulting position is stored using a :polyvox:`Vector3DFloat`. This is simply a typedef from our templatised :polyvox:`Vector` class, meaning that other sizes and storage types are available if you need them. - -Next, the function uses a three-level 'for' loop to iterate over each voxel in the volume. For each voxel it computes the distance from the voxel to the centre of the volume. If this distance is less than or equal to the specified radius then the voxel forms part of the sphere and is made solid. During surface extraction, the voxel will be considered empty if it has a value of zero, and otherwise it will be considered solid. In our case we simply set it to 255 which is the largest value a uint8_t can contain. - -Extracting the surface -====================== -Now that we have built our volume we need to convert it into a triangle mesh for rendering. This process can be performed by the :polyvox:`CubicSurfaceExtractorWithNormals` class. An instance of the :polyvox:`CubicSurfaceExtractorWithNormals` is created as follows: - -.. sourcecode:: c++ - - SurfaceMesh mesh; - CubicSurfaceExtractorWithNormals< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); - -The :polyvox:`CubicSurfaceExtractorWithNormals` takes a pointer to the volume data, and also it needs to be told which :polyvox:`Region` of the volume the extraction should be performed on (in more advanced applications this is useful for extracting only those parts of the volume which have been modified since the last extraction). For our purpose the :polyvox:`SimpleVolume` class provides a convenient :polyvox:`SimpleVolume::getEnclosingRegion` function which returns a :polyvox:`Region` representing the whole volume. The constructor also takes a pointer to a :polyvox:`SurfaceMesh` object where it will store the result, so we need to create one of these before we can construct the :polyvox:`CubicSurfaceExtractorWithNormals`. - -The actual extraction happens in the :polyvox:`CubicSurfaceExtractorWithNormals::execute` function. This means you can set up a :polyvox:`CubicSurfaceExtractorWithNormals` with the required parameters and then actually execute it later. For this example we just call it straight away. - -.. sourcecode:: c++ - - surfaceExtractor.execute(); - -This fills in our :polyvox:`SurfaceMesh` object, which basically contains an index and vertex buffer representing the desired triangle mesh. - -Note: If you like you can try swapping the :polyvox:`CubicSurfaceExtractorWithNormals` for :polyvox:`MarchingCubesSurfaceExtractor`. We have already included the relevant header, and in the BasicExample you just need to change which line in commented out. The :polyvox:`MarchingCubesSurfaceExtractor` makes use of a smooth density field and will consider a voxel to be solid if it is above a threshold of half the voxel's maximum value (so in this case that's half of 255, which is 127). - -Rendering the surface -===================== -Rendering the surface with OpenGL is handled by the OpenGLWidget class. Again, this is not part of PolyVox, it is simply an example based on Qt and OpenGL which demonstrates how rendering can be performed. Within this class there are mainly two functions which are of interest - the OpenGLWidget::setSurfaceMeshToRender() function which constructs OpenGL buffers from our :polyvox:`SurfaceMesh` and the OpenGLWidget::paintGL() function which is called each frame to perform the rendering. - -The OpenGLWidget::setSurfaceMeshToRender() function is implemented as follows: - -.. sourcecode:: c++ - - void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) - { - //Convienient access to the vertices and indices - const vector& vecIndices = surfaceMesh.getIndices(); - const vector& vecVertices = surfaceMesh.getVertices(); - - //Build an OpenGL index buffer - glGenBuffers(1, &indexBuffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - const GLvoid* pIndices = static_cast(&(vecIndices[0])); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); - - //Build an OpenGL vertex buffer - glGenBuffers(1, &vertexBuffer); - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - const GLvoid* pVertices = static_cast(&(vecVertices[0])); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); - - m_uBeginIndex = 0; - m_uEndIndex = vecIndices.size(); - } - -We begin by obtaining direct access to the index and vertex buffer in the :polyvox:`SurfaceMesh` class in order to make the following code slightly cleaner. Both the :polyvox:`SurfaceMesh::getIndices` and :polyvox:`SurfaceMesh::getVertices` functions return an std::vector containing the relevant data. - -The OpenGL functions which are called to construct the index and vertex buffer are best explained by the OpenGL documentation. In both cases we are making an exact copy of the data stored in the :polyvox:`SurfaceMesh`. - -The begin and end indices are used in the OpenGLWidget::paintGL() to control what part of the index buffer is actually rendered. For this simple example we will render the whole buffer from '0' to 'vecIndices.size()'. - -With the OpenGL index and vertex buffers set up, we can now look at the code which is called each frame to render them: - -.. sourcecode:: c++ - - void OpenGLWidget::paintGL() - { - //Clear the screen - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - //Set up the viewing transformation - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0f,0.0f,-100.0f); //Centre volume and move back - glRotatef(-m_xRotation, 0.0f, 1.0f, 0.0f); - glRotatef(-m_yRotation, 1.0f, 0.0f, 0.0f); - glTranslatef(-32.0f,-32.0f,-32.0f); //Centre volume and move back - - //Bind the index buffer - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); - - //Bind the vertex buffer - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); - glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); - - glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); - - //Error checking code here... - } - +********************** +Tutorial 1 - Basic use +********************** + +Introduction +============ +This tutorial covers the basic use of the PolyVox API. After reading this tutorial you should have a good idea how to create a PolyVox volume and fill it with data, extract a triangle mesh representing the surface, and render the result. This tutorial assumes you are already familiar with the basic concepts behind PolyVox (see the :doc:`principles of polyvox ` document if not), and are reasonably confident with 3D graphics and C++. It also assumes you have already got PolyVox installed on your system, if this is not the case then please consult :doc:`installation guide `. + +The code samples and text in this tutorial correspond directly to the BasicExample which comes with PolyVox. This example uses the Qt toolkit for window and input handling, and for providing an OpenGL context to render into. In this tutorial we will omit code which performs these tasks and will instead focus on on the PolyVox code. You can consult the `Qt documentation `_ if you want more information about these other aspects of the system. + +Creating a volume +================= +To get started, we need to include the following headers: + +.. sourcecode:: c++ + + #include "PolyVoxCore/CubicSurfaceExtractorWithNormals.h" + #include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" + #include "PolyVoxCore/SurfaceMesh.h" + #include "PolyVoxCore/SimpleVolume.h" + +The most fundamental construct when working with PolyVox is that of the volume. This is represented by the :polyvox:`SimpleVolume` class which stores a 3D grid of voxels. Our basic example application creates a volume with the following line of code: + +.. sourcecode:: c++ + + SimpleVolume volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63))); + +As can be seen, the SimpleVolume class is templated upon the voxel type. This means it is straightforward to create a volume of integers, floats, or a custom voxel type (see the :polyvox:`SimpleVolume documentation ` for more details). In this particular case we have created a volume in which each voxel is of type `uint8_t` which is an unsigned 8-bit integer. + +Next, we set some of the voxels in the volume to be 'solid' in order to create a large sphere in the centre of the volume. We do this with the following function call: + +.. sourcecode:: c++ + + createSphereInVolume(volData, 30); + +Note that this function is part of the BasicExample (rather than being part of the PolyVox library) and is implemented as follows: + +.. sourcecode:: c++ + + void createSphereInVolume(SimpleVolume& volData, float fRadius) + { + //This vector hold the position of the center of the volume + Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + uint8_t uVoxelValue = 0; + + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new voxel value + uVoxelValue = 255; + } + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, uVoxelValue); + } + } + } + } + +This function takes as input the :polyvox:`SimpleVolume` in which we want to create the sphere, and also a radius specifying how large we want the sphere to be. In our case we have specified a radius of 30 voxels, which will fit nicely inside our :polyvox:`SimpleVolume` of dimensions 64x64x64. + +Because this is a simple example function it always places the sphere at the centre of the volume. It computes this centre by halving the dimensions of the volume as given by the functions :polyvox:`SimpleVolume::getWidth`, :polyvox:`SimpleVolume::getHeight` and :polyvox:`SimpleVolume::getDepth`. The resulting position is stored using a :polyvox:`Vector3DFloat`. This is simply a typedef from our templatised :polyvox:`Vector` class, meaning that other sizes and storage types are available if you need them. + +Next, the function uses a three-level 'for' loop to iterate over each voxel in the volume. For each voxel it computes the distance from the voxel to the centre of the volume. If this distance is less than or equal to the specified radius then the voxel forms part of the sphere and is made solid. During surface extraction, the voxel will be considered empty if it has a value of zero, and otherwise it will be considered solid. In our case we simply set it to 255 which is the largest value a uint8_t can contain. + +Extracting the surface +====================== +Now that we have built our volume we need to convert it into a triangle mesh for rendering. This process can be performed by the :polyvox:`CubicSurfaceExtractorWithNormals` class. An instance of the :polyvox:`CubicSurfaceExtractorWithNormals` is created as follows: + +.. sourcecode:: c++ + + SurfaceMesh mesh; + CubicSurfaceExtractorWithNormals< SimpleVolume > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); + +The :polyvox:`CubicSurfaceExtractorWithNormals` takes a pointer to the volume data, and also it needs to be told which :polyvox:`Region` of the volume the extraction should be performed on (in more advanced applications this is useful for extracting only those parts of the volume which have been modified since the last extraction). For our purpose the :polyvox:`SimpleVolume` class provides a convenient :polyvox:`SimpleVolume::getEnclosingRegion` function which returns a :polyvox:`Region` representing the whole volume. The constructor also takes a pointer to a :polyvox:`SurfaceMesh` object where it will store the result, so we need to create one of these before we can construct the :polyvox:`CubicSurfaceExtractorWithNormals`. + +The actual extraction happens in the :polyvox:`CubicSurfaceExtractorWithNormals::execute` function. This means you can set up a :polyvox:`CubicSurfaceExtractorWithNormals` with the required parameters and then actually execute it later. For this example we just call it straight away. + +.. sourcecode:: c++ + + surfaceExtractor.execute(); + +This fills in our :polyvox:`SurfaceMesh` object, which basically contains an index and vertex buffer representing the desired triangle mesh. + +Note: If you like you can try swapping the :polyvox:`CubicSurfaceExtractorWithNormals` for :polyvox:`MarchingCubesSurfaceExtractor`. We have already included the relevant header, and in the BasicExample you just need to change which line in commented out. The :polyvox:`MarchingCubesSurfaceExtractor` makes use of a smooth density field and will consider a voxel to be solid if it is above a threshold of half the voxel's maximum value (so in this case that's half of 255, which is 127). + +Rendering the surface +===================== +Rendering the surface with OpenGL is handled by the OpenGLWidget class. Again, this is not part of PolyVox, it is simply an example based on Qt and OpenGL which demonstrates how rendering can be performed. Within this class there are mainly two functions which are of interest - the OpenGLWidget::setSurfaceMeshToRender() function which constructs OpenGL buffers from our :polyvox:`SurfaceMesh` and the OpenGLWidget::paintGL() function which is called each frame to perform the rendering. + +The OpenGLWidget::setSurfaceMeshToRender() function is implemented as follows: + +.. sourcecode:: c++ + + void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh& surfaceMesh) + { + //Convienient access to the vertices and indices + const vector& vecIndices = surfaceMesh.getIndices(); + const vector& vecVertices = surfaceMesh.getVertices(); + + //Build an OpenGL index buffer + glGenBuffers(1, &indexBuffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); + const GLvoid* pIndices = static_cast(&(vecIndices[0])); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); + + //Build an OpenGL vertex buffer + glGenBuffers(1, &vertexBuffer); + glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); + const GLvoid* pVertices = static_cast(&(vecVertices[0])); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(PositionMaterialNormal), pVertices, GL_STATIC_DRAW); + + m_uBeginIndex = 0; + m_uEndIndex = vecIndices.size(); + } + +We begin by obtaining direct access to the index and vertex buffer in the :polyvox:`SurfaceMesh` class in order to make the following code slightly cleaner. Both the :polyvox:`SurfaceMesh::getIndices` and :polyvox:`SurfaceMesh::getVertices` functions return an std::vector containing the relevant data. + +The OpenGL functions which are called to construct the index and vertex buffer are best explained by the OpenGL documentation. In both cases we are making an exact copy of the data stored in the :polyvox:`SurfaceMesh`. + +The begin and end indices are used in the OpenGLWidget::paintGL() to control what part of the index buffer is actually rendered. For this simple example we will render the whole buffer from '0' to 'vecIndices.size()'. + +With the OpenGL index and vertex buffers set up, we can now look at the code which is called each frame to render them: + +.. sourcecode:: c++ + + void OpenGLWidget::paintGL() + { + //Clear the screen + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + //Set up the viewing transformation + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f,0.0f,-100.0f); //Centre volume and move back + glRotatef(-m_xRotation, 0.0f, 1.0f, 0.0f); + glRotatef(-m_yRotation, 1.0f, 0.0f, 0.0f); + glTranslatef(-32.0f,-32.0f,-32.0f); //Centre volume and move back + + //Bind the index buffer + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); + + //Bind the vertex buffer + glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); + glVertexPointer(3, GL_FLOAT, sizeof(PositionMaterialNormal), 0); + glNormalPointer(GL_FLOAT, sizeof(PositionMaterialNormal), (GLvoid*)12); + + glDrawRangeElements(GL_TRIANGLES, m_uBeginIndex, m_uEndIndex-1, m_uEndIndex - m_uBeginIndex, GL_UNSIGNED_INT, 0); + + //Error checking code here... + } + Again, the explanation of this code is best left to the OpenGL documentation. Note that is is called automatically by Qt each time the display needs to be updated. \ No newline at end of file diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index c34dc96c..66546f66 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -1,74 +1,74 @@ -# Copyright (c) 2010-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(BasicExample) - -#Projects source files -SET(SRC_FILES - main.cpp - ../common/OpenGLWidget.cpp -) - -#Projects headers files -SET(INC_FILES - OpenGLWidget.h -) - -add_definitions(-DGLEW_STATIC) - -FIND_PACKAGE(OpenGL REQUIRED) - -#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) - -#This will include the shader files inside the compiled binary -QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) - -# Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) - -#Build -ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) -IF(MSVC) - SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) -SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") - -#Install - Only install the example in Windows -IF(WIN32) - INSTALL(TARGETS BasicExample - RUNTIME DESTINATION Examples/OpenGL/bin - LIBRARY DESTINATION Examples/OpenGL/lib - ARCHIVE DESTINATION Examples/OpenGL/lib - COMPONENT example - ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) -ENDIF(WIN32) +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(BasicExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp +) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS BasicExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index a3fdbbd5..b2d7bb3d 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -1,95 +1,95 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLWidget.h" - -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" - -#include - -//Use the PolyVox namespace -using namespace PolyVox; - -void createSphereInVolume(PagedVolume& volData, float fRadius) -{ - //This vector hold the position of the center of the volume - Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); - - //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getDepth(); z++) - { - for (int y = 0; y < volData.getHeight(); y++) - { - for (int x = 0; x < volData.getWidth(); x++) - { - //Store our current position as a vector... - Vector3DFloat v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - uint8_t uVoxelValue = 0; - - //If the current voxel is less than 'radius' units from the center then we make it solid. - if(fDistToCenter <= fRadius) - { - //Our new voxel value - uVoxelValue = 255; - } - - //Wrte the voxel value into the volume - volData.setVoxelAt(x, y, z, uVoxelValue); - } - } - } -} - -int main(int argc, char *argv[]) -{ - //Create and show the Qt OpenGL window - QApplication app(argc, argv); - OpenGLWidget openGLWidget(0); - openGLWidget.show(); - - //Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "OpenGLWidget.h" + +#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/PagedVolume.h" + +#include + +//Use the PolyVox namespace +using namespace PolyVox; + +void createSphereInVolume(PagedVolume& volData, float fRadius) +{ + //This vector hold the position of the center of the volume + Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + uint8_t uVoxelValue = 0; + + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new voxel value + uVoxelValue = 255; + } + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, uVoxelValue); + } + } + } +} + +int main(int argc, char *argv[]) +{ + //Create and show the Qt OpenGL window + QApplication app(argc, argv); + OpenGLWidget openGLWidget(0); + openGLWidget.show(); + + //Create an empty volume and then place a sphere in it + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. auto decodedMesh = decodeMesh(mesh); - - //Pass the surface to the OpenGL window - openGLWidget.addMesh(decodedMesh); - //openGLWidget.addMesh(mesh2); - openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - - //Run the message pump. - return app.exec(); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(decodedMesh); + //openGLWidget.addMesh(mesh2); + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + + //Run the message pump. + return app.exec(); } \ No newline at end of file diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt index 07f87101..a812c2b5 100644 --- a/examples/DecodeOnGPU/CMakeLists.txt +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -1,75 +1,75 @@ -# Copyright (c) 2010-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(DecodeOnGPUExample) - -#Projects source files -SET(SRC_FILES - main.cpp - ../common/OpenGLWidget.cpp -) - -#Projects headers files -SET(INC_FILES - OpenGLWidget.h -) - -add_definitions(-DGLEW_STATIC) - -FIND_PACKAGE(OpenGL REQUIRED) - -#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) - -#This will include the shader files inside the compiled binary -QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) -QT4_ADD_RESOURCES(DECODE_RESOURCES_RCC decode.qrc) - -# Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} decode.qrc ${DECODE_RESOURCES_RCC}) - -#Build -ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${DECODE_RESOURCES_RCC}) -IF(MSVC) - SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) -SET_PROPERTY(TARGET DecodeOnGPUExample PROPERTY FOLDER "Examples") - -#Install - Only install the example in Windows -IF(WIN32) - INSTALL(TARGETS DecodeOnGPUExample - RUNTIME DESTINATION Examples/OpenGL/bin - LIBRARY DESTINATION Examples/OpenGL/lib - ARCHIVE DESTINATION Examples/OpenGL/lib - COMPONENT example - ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) -ENDIF(WIN32) +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(DecodeOnGPUExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp +) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +QT4_ADD_RESOURCES(DECODE_RESOURCES_RCC decode.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} decode.qrc ${DECODE_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${DECODE_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET DecodeOnGPUExample PROPERTY FOLDER "Examples") + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS DecodeOnGPUExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index 19ef97fd..a13dd677 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -1,167 +1,167 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLWidget.h" - -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" - -#include - -//Use the PolyVox namespace -using namespace PolyVox; - -void createSphereInVolume(PagedVolume& volData, float fRadius) -{ - //This vector hold the position of the center of the volume - Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); - - //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getDepth(); z++) - { - for (int y = 0; y < volData.getHeight(); y++) - { - for (int x = 0; x < volData.getWidth(); x++) - { - //Store our current position as a vector... - Vector3DFloat v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - uint8_t uVoxelValue = 0; - - //If the current voxel is less than 'radius' units from the center then we make it solid. - if(fDistToCenter <= fRadius) - { - //Our new voxel value - uVoxelValue = 255; - } - - //Wrte the voxel value into the volume - volData.setVoxelAt(x, y, z, uVoxelValue); - } - } - } -} - -OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) -{ - // Convienient access to the vertices and indices - const auto& vecIndices = surfaceMesh.getIndices(); - const auto& vecVertices = surfaceMesh.getVertices(); - - // This struct holds the OpenGL properties (buffer handles, etc) which will be used - // to render our mesh. We copy the data from the PolyVox mesh into this structure. - OpenGLMeshData meshData; - - // Create the VAO for the mesh - glGenVertexArrays(1, &(meshData.vertexArrayObject)); - glBindVertexArray(meshData.vertexArrayObject); - - // The GL_ARRAY_BUFFER will contain the list of vertex positions - glGenBuffers(1, &(meshData.vertexBuffer)); - glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex< uint8_t >), vecVertices.data(), GL_STATIC_DRAW); - - // and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(meshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); - - // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out - glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribIPointer(0, 3, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedPosition))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - - // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor - // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the - // shader. This is mostly just to simplify this example code - in a real application you will know whether your - // chosen surface extractor generates normals and can skip uploading them if not. - glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribIPointer(1, 1, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedNormal))); - - // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code - // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. - glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(uint8_t), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, data))); - - // We're done uploading and can now unbind. - glBindVertexArray(0); - - // A few additional properties can be copied across for use during rendering. - meshData.noOfIndices = vecIndices.size(); - meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); - meshData.scale = scale; - - // Set 16 or 32-bit index buffer size. - meshData.indexType = sizeof(PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; - - return meshData; -} - -int main(int argc, char *argv[]) -{ - //Create and show the Qt OpenGL window - QApplication app(argc, argv); - OpenGLWidget openGLWidget(0); - openGLWidget.show(); - - QSharedPointer shader(new QGLShaderProgram); - - if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/decode.vert")) - { - std::cerr << shader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/decode.frag")) - { - std::cerr << shader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - openGLWidget.setShader(shader); - - //Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "OpenGLWidget.h" + +#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/PagedVolume.h" + +#include + +//Use the PolyVox namespace +using namespace PolyVox; + +void createSphereInVolume(PagedVolume& volData, float fRadius) +{ + //This vector hold the position of the center of the volume + Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + uint8_t uVoxelValue = 0; + + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new voxel value + uVoxelValue = 255; + } + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, uVoxelValue); + } + } + } +} + +OpenGLMeshData buildOpenGLMeshData(const PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) +{ + // Convienient access to the vertices and indices + const auto& vecIndices = surfaceMesh.getIndices(); + const auto& vecVertices = surfaceMesh.getVertices(); + + // This struct holds the OpenGL properties (buffer handles, etc) which will be used + // to render our mesh. We copy the data from the PolyVox mesh into this structure. + OpenGLMeshData meshData; + + // Create the VAO for the mesh + glGenVertexArrays(1, &(meshData.vertexArrayObject)); + glBindVertexArray(meshData.vertexArrayObject); + + // The GL_ARRAY_BUFFER will contain the list of vertex positions + glGenBuffers(1, &(meshData.vertexBuffer)); + glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MarchingCubesVertex< uint8_t >), vecVertices.data(), GL_STATIC_DRAW); + + // and GL_ELEMENT_ARRAY_BUFFER will contain the indices + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); + + // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out + glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions + glVertexAttribIPointer(0, 3, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedPosition))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor + // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the + // shader. This is mostly just to simplify this example code - in a real application you will know whether your + // chosen surface extractor generates normals and can skip uploading them if not. + glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. + glVertexAttribIPointer(1, 1, GL_UNSIGNED_SHORT, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, encodedNormal))); + + // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code + // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. + glEnableVertexAttribArray(2); //We're talking about shader attribute '2' + GLint size = (std::min)(sizeof(uint8_t), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MarchingCubesVertex< uint8_t >), (GLvoid*)(offsetof(MarchingCubesVertex< uint8_t >, data))); + + // We're done uploading and can now unbind. + glBindVertexArray(0); + + // A few additional properties can be copied across for use during rendering. + meshData.noOfIndices = vecIndices.size(); + meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); + meshData.scale = scale; + + // Set 16 or 32-bit index buffer size. + meshData.indexType = sizeof(PolyVox::Mesh< PolyVox::MarchingCubesVertex< uint8_t > >::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; + + return meshData; +} + +int main(int argc, char *argv[]) +{ + //Create and show the Qt OpenGL window + QApplication app(argc, argv); + OpenGLWidget openGLWidget(0); + openGLWidget.show(); + + QSharedPointer shader(new QGLShaderProgram); + + if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/decode.vert")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/decode.frag")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + openGLWidget.setShader(shader); + + //Create an empty volume and then place a sphere in it + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion()); auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion()); // The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to // decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code. //auto decodedMesh = decodeMesh(mesh); - - //Pass the surface to the OpenGL window - OpenGLMeshData meshData = buildOpenGLMeshData(mesh); - openGLWidget.addMeshData(meshData); - - openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - - //Run the message pump. - return app.exec(); + + //Pass the surface to the OpenGL window + OpenGLMeshData meshData = buildOpenGLMeshData(mesh); + openGLWidget.addMeshData(meshData); + + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + + //Run the message pump. + return app.exec(); } \ No newline at end of file diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 14e9f4d1..910ea0fb 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -1,77 +1,77 @@ -# Copyright (c) 2010-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(OpenGLExample) - -#Projects source files -SET(SRC_FILES - main.cpp - ../common/OpenGLWidget.cpp - Shapes.cpp - ) - -#Projects headers files -SET(INC_FILES - OpenGLWidget.h - Shapes.h -) - -add_definitions(-DGLEW_STATIC) - -FIND_PACKAGE(OpenGL REQUIRED) - -#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) - -#This will include the shader files inside the compiled binary -QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) -QT4_ADD_RESOURCES(OPENGLEXAMPLE_RESOURCES_RCC openglexample.qrc) - -# Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} openglexample.qrc ${OPENGLEXAMPLE_RESOURCES_RCC}) - -#Build -ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPLE_RESOURCES_RCC}) -IF(MSVC) - SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) -SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") - -#Install - Only install the example in Windows -IF(WIN32) - INSTALL(TARGETS OpenGLExample - RUNTIME DESTINATION Examples/OpenGL/bin - LIBRARY DESTINATION Examples/OpenGL/lib - ARCHIVE DESTINATION Examples/OpenGL/lib - COMPONENT example - ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) -ENDIF(WIN32) +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(OpenGLExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp + Shapes.cpp + ) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h + Shapes.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) +QT4_ADD_RESOURCES(OPENGLEXAMPLE_RESOURCES_RCC openglexample.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC} openglexample.qrc ${OPENGLEXAMPLE_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPLE_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS OpenGLExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 419359d0..434ff1ca 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -1,73 +1,73 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "Shapes.h" - -#include "PolyVoxCore/MaterialDensityPair.h" - -using namespace PolyVox; - -void createSphereInVolume(PagedVolume& volData, float fRadius, uint8_t uValue) -{ - //This vector hold the position of the center of the volume - Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); - - //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getDepth(); z++) - { - for (int y = 0; y < volData.getHeight(); y++) - { - for (int x = 0; x < volData.getWidth(); x++) - { - //Store our current position as a vector... - Vector3DInt32 v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - double fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - //If the current voxel is less than 'radius' units from the center - //then we make it solid, otherwise we make it empty space. - if(fDistToCenter <= fRadius) - { - volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? MaterialDensityPair88::getMaxDensity() : MaterialDensityPair88::getMinDensity())); - } - } - } - } -} - -void createCubeInVolume(PagedVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) -{ - uint8_t maxDen = MaterialDensityPair88::getMaxDensity(); - uint8_t minDen = MaterialDensityPair88::getMinDensity(); - //This three-level for loop iterates over every voxel between the specified corners - for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++) - { - for (int y = lowerCorner.getY(); y <= upperCorner.getY(); y++) - { - for (int x = lowerCorner.getX() ; x <= upperCorner.getX(); x++) - { - volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? maxDen : minDen)); - } - } - } +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "Shapes.h" + +#include "PolyVoxCore/MaterialDensityPair.h" + +using namespace PolyVox; + +void createSphereInVolume(PagedVolume& volData, float fRadius, uint8_t uValue) +{ + //This vector hold the position of the center of the volume + Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DInt32 v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + double fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + //If the current voxel is less than 'radius' units from the center + //then we make it solid, otherwise we make it empty space. + if(fDistToCenter <= fRadius) + { + volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? MaterialDensityPair88::getMaxDensity() : MaterialDensityPair88::getMinDensity())); + } + } + } + } +} + +void createCubeInVolume(PagedVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) +{ + uint8_t maxDen = MaterialDensityPair88::getMaxDensity(); + uint8_t minDen = MaterialDensityPair88::getMinDensity(); + //This three-level for loop iterates over every voxel between the specified corners + for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++) + { + for (int y = lowerCorner.getY(); y <= upperCorner.getY(); y++) + { + for (int x = lowerCorner.getX() ; x <= upperCorner.getX(); x++) + { + volData.setVoxelAt(x,y,z, MaterialDensityPair88(uValue, uValue > 0 ? maxDen : minDen)); + } + } + } } \ No newline at end of file diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index 25f2acfc..140fdea3 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -1,33 +1,33 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __OpenGLExample_Shapes_H__ -#define __OpenGLExample_Shapes_H__ - -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/MaterialDensityPair.h" - -void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); -void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __OpenGLExample_Shapes_H__ +#define __OpenGLExample_Shapes_H__ + +#include "PolyVoxCore/PagedVolume.h" +#include "PolyVoxCore/MaterialDensityPair.h" + +void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); +void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); + #endif //__OpenGLExample_Shapes_H__ \ No newline at end of file diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index edd7cdbc..a76c2800 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -1,146 +1,146 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/LowPassFilter.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/Impl/Utility.h" - -#include "Shapes.h" - -#include "OpenGLWidget.h" - -#ifdef WIN32 -#include // Standard Header For Most Programs -#endif - -#include -#include - -//Some namespaces we need -using namespace std; -using namespace PolyVox; -using namespace std; - -const int32_t g_uVolumeSideLength = 128; - -int main(int argc, char *argv[]) -{ - FilePager* pager = new FilePager("."); - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); - - //Make our volume contain a sphere in the center. - int32_t minPos = 0; - int32_t midPos = g_uVolumeSideLength / 2; - int32_t maxPos = g_uVolumeSideLength - 1; - - cout << "Creating sphere 1" << std::endl; - createSphereInVolume(volData, 60.0f, 5); - cout << "Creating sphere 2" << std::endl; - createSphereInVolume(volData, 50.0f, 4); - cout << "Creating sphere 3" << std::endl; - createSphereInVolume(volData, 40.0f, 3); - cout << "Creating sphere 4" << std::endl; - createSphereInVolume(volData, 30.0f, 2); - cout << "Creating sphere 5" << std::endl; - createSphereInVolume(volData, 20.0f, 1); - - cout << "Creating cubes" << std::endl; - createCubeInVolume(volData, Vector3DInt32(minPos, minPos, minPos), Vector3DInt32(midPos-1, midPos-1, midPos-1), 0); - createCubeInVolume(volData, Vector3DInt32(midPos+1, midPos+1, minPos), Vector3DInt32(maxPos, maxPos, midPos-1), 0); - createCubeInVolume(volData, Vector3DInt32(midPos+1, minPos, midPos+1), Vector3DInt32(maxPos, midPos-1, maxPos), 0); - createCubeInVolume(volData, Vector3DInt32(minPos, midPos+1, midPos+1), Vector3DInt32(midPos-1, maxPos, maxPos), 0); - - createCubeInVolume(volData, Vector3DInt32(1, midPos-10, midPos-10), Vector3DInt32(maxPos-1, midPos+10, midPos+10), MaterialDensityPair44::getMaxDensity()); - createCubeInVolume(volData, Vector3DInt32(midPos-10, 1, midPos-10), Vector3DInt32(midPos+10, maxPos-1, midPos+10), MaterialDensityPair44::getMaxDensity()); - createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity()); - - QApplication app(argc, argv); - - OpenGLWidget openGLWidget(0); - - - openGLWidget.show(); - - QSharedPointer shader(new QGLShaderProgram); - - if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/openglexample.vert")) - { - std::cerr << shader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/openglexample.frag")) - { - std::cerr << shader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - openGLWidget.setShader(shader); - - QTime time; - time.start(); - //openGLWidget.setVolume(&volData); - cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl; - - const int32_t extractedRegionSize = 32; - int meshCounter = 0; - - for (int32_t z = 0; z < volData.getDepth(); z += extractedRegionSize) - { - for (int32_t y = 0; y < volData.getHeight(); y += extractedRegionSize) - { - for (int32_t x = 0; x < volData.getWidth(); x += extractedRegionSize) - { - // Specify the region to extract based on a starting position and the desired region sze. - PolyVox::Region regToExtract(x, y, z, x + extractedRegionSize, y + extractedRegionSize, z + extractedRegionSize); - - // If you uncomment this line you will be able to see that the volume is rendered as multiple seperate meshes. - //regToExtract.shrink(1); - - // Perform the extraction for this region of the volume - auto mesh = extractMarchingCubesMesh(&volData, regToExtract); - - // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMesh = decodeMesh(mesh); - - // Pass the surface to the OpenGL window. Note that we are also passing an offset in this multi-mesh example. This is because - // the surface extractors return a mesh with 'local space' positions to reduce storage requirements and precision problems. - openGLWidget.addMesh(decodedMesh, decodedMesh.getOffset()); - - meshCounter++; - } - } - } - - cout << "Rendering volume as " << meshCounter << " seperate meshes" << endl; - - - openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - - - return app.exec(); -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/FilePager.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/LowPassFilter.h" +#include "PolyVoxCore/RawVolume.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/Impl/Utility.h" + +#include "Shapes.h" + +#include "OpenGLWidget.h" + +#ifdef WIN32 +#include // Standard Header For Most Programs +#endif + +#include +#include + +//Some namespaces we need +using namespace std; +using namespace PolyVox; +using namespace std; + +const int32_t g_uVolumeSideLength = 128; + +int main(int argc, char *argv[]) +{ + FilePager* pager = new FilePager("."); + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); + + //Make our volume contain a sphere in the center. + int32_t minPos = 0; + int32_t midPos = g_uVolumeSideLength / 2; + int32_t maxPos = g_uVolumeSideLength - 1; + + cout << "Creating sphere 1" << std::endl; + createSphereInVolume(volData, 60.0f, 5); + cout << "Creating sphere 2" << std::endl; + createSphereInVolume(volData, 50.0f, 4); + cout << "Creating sphere 3" << std::endl; + createSphereInVolume(volData, 40.0f, 3); + cout << "Creating sphere 4" << std::endl; + createSphereInVolume(volData, 30.0f, 2); + cout << "Creating sphere 5" << std::endl; + createSphereInVolume(volData, 20.0f, 1); + + cout << "Creating cubes" << std::endl; + createCubeInVolume(volData, Vector3DInt32(minPos, minPos, minPos), Vector3DInt32(midPos-1, midPos-1, midPos-1), 0); + createCubeInVolume(volData, Vector3DInt32(midPos+1, midPos+1, minPos), Vector3DInt32(maxPos, maxPos, midPos-1), 0); + createCubeInVolume(volData, Vector3DInt32(midPos+1, minPos, midPos+1), Vector3DInt32(maxPos, midPos-1, maxPos), 0); + createCubeInVolume(volData, Vector3DInt32(minPos, midPos+1, midPos+1), Vector3DInt32(midPos-1, maxPos, maxPos), 0); + + createCubeInVolume(volData, Vector3DInt32(1, midPos-10, midPos-10), Vector3DInt32(maxPos-1, midPos+10, midPos+10), MaterialDensityPair44::getMaxDensity()); + createCubeInVolume(volData, Vector3DInt32(midPos-10, 1, midPos-10), Vector3DInt32(midPos+10, maxPos-1, midPos+10), MaterialDensityPair44::getMaxDensity()); + createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity()); + + QApplication app(argc, argv); + + OpenGLWidget openGLWidget(0); + + + openGLWidget.show(); + + QSharedPointer shader(new QGLShaderProgram); + + if (!shader->addShaderFromSourceFile(QGLShader::Vertex, ":/openglexample.vert")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + if (!shader->addShaderFromSourceFile(QGLShader::Fragment, ":/openglexample.frag")) + { + std::cerr << shader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + openGLWidget.setShader(shader); + + QTime time; + time.start(); + //openGLWidget.setVolume(&volData); + cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl; + + const int32_t extractedRegionSize = 32; + int meshCounter = 0; + + for (int32_t z = 0; z < volData.getDepth(); z += extractedRegionSize) + { + for (int32_t y = 0; y < volData.getHeight(); y += extractedRegionSize) + { + for (int32_t x = 0; x < volData.getWidth(); x += extractedRegionSize) + { + // Specify the region to extract based on a starting position and the desired region sze. + PolyVox::Region regToExtract(x, y, z, x + extractedRegionSize, y + extractedRegionSize, z + extractedRegionSize); + + // If you uncomment this line you will be able to see that the volume is rendered as multiple seperate meshes. + //regToExtract.shrink(1); + + // Perform the extraction for this region of the volume + auto mesh = extractMarchingCubesMesh(&volData, regToExtract); + + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMesh = decodeMesh(mesh); + + // Pass the surface to the OpenGL window. Note that we are also passing an offset in this multi-mesh example. This is because + // the surface extractors return a mesh with 'local space' positions to reduce storage requirements and precision problems. + openGLWidget.addMesh(decodedMesh, decodedMesh.getOffset()); + + meshCounter++; + } + } + } + + cout << "Rendering volume as " << meshCounter << " seperate meshes" << endl; + + + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + + + return app.exec(); +} diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index 95a3ef8a..db2f9028 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -1,79 +1,79 @@ -# Copyright (c) 2010-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(PagingExample) - -#Projects source files -SET(SRC_FILES - main.cpp - ../common/OpenGLWidget.cpp - Perlin.cpp -) - -#Projects headers files -SET(INC_FILES - OpenGLWidget.h - Perlin.h -) - -add_definitions(-DGLEW_STATIC) - -FIND_PACKAGE(OpenGL REQUIRED) - -#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) - -#This will include the shader files inside the compiled binary -QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) - -# Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) - -#Build -ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) -IF(MSVC) - SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) -SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples") - -configure_file(../common/example.vert example.vert COPYONLY) -configure_file(../common/example.frag example.frag COPYONLY) - -#Install - Only install the example in Windows -IF(WIN32) - INSTALL(TARGETS PagingExample - RUNTIME DESTINATION Examples/OpenGL/bin - LIBRARY DESTINATION Examples/OpenGL/lib - ARCHIVE DESTINATION Examples/OpenGL/lib - COMPONENT example - ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) -ENDIF(WIN32) +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(PagingExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp + Perlin.cpp +) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h + Perlin.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples") + +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS PagingExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/Paging/Perlin.cpp b/examples/Paging/Perlin.cpp index e0b08512..59da2c6e 100644 --- a/examples/Paging/Perlin.cpp +++ b/examples/Paging/Perlin.cpp @@ -1,265 +1,265 @@ -// Code from http://www.flipcode.com/archives/Perlin_Noise_Class.shtml -// This is only in PolyVox for the purpose of the examples. It was not written by -// the PolyVox authors and cannot be assumed to be under the same license as PolyVox. - -/* coherent noise function over 1, 2 or 3 dimensions */ -/* (copyright Ken Perlin) */ - -#include -#include -#include - -#include "Perlin.h" - -#define B SAMPLE_SIZE -#define BM (SAMPLE_SIZE-1) - -#define N 0x1000 -#define NP 12 /* 2^N */ -#define NM 0xfff - -#define s_curve(t) ( t * t * (3.0f - 2.0f * t) ) -#define lerp(t, a, b) ( a + t * (b - a) ) - -#define setup(i,b0,b1,r0,r1)\ - t = vec[i] + N;\ - b0 = ((int)t) & BM;\ - b1 = (b0+1) & BM;\ - r0 = t - (int)t;\ - r1 = r0 - 1.0f; - -float Perlin::noise1(float arg) -{ - int bx0, bx1; - float rx0, rx1, sx, t, u, v, vec[1]; - - vec[0] = arg; - - if (mStart) - { - srand(mSeed); - mStart = false; - init(); - } - - setup(0, bx0,bx1, rx0,rx1); - - sx = s_curve(rx0); - - u = rx0 * g1[ p[ bx0 ] ]; - v = rx1 * g1[ p[ bx1 ] ]; - - return lerp(sx, u, v); -} - -float Perlin::noise2(float vec[2]) -{ - int bx0, bx1, by0, by1, b00, b10, b01, b11; - float rx0, rx1, ry0, ry1, *q, sx, sy, a, b, t, u, v; - int i, j; - - if (mStart) - { - srand(mSeed); - mStart = false; - init(); - } - - setup(0,bx0,bx1,rx0,rx1); - setup(1,by0,by1,ry0,ry1); - - i = p[bx0]; - j = p[bx1]; - - b00 = p[i + by0]; - b10 = p[j + by0]; - b01 = p[i + by1]; - b11 = p[j + by1]; - - sx = s_curve(rx0); - sy = s_curve(ry0); - - #define at2(rx,ry) ( rx * q[0] + ry * q[1] ) - - q = g2[b00]; - u = at2(rx0,ry0); - q = g2[b10]; - v = at2(rx1,ry0); - a = lerp(sx, u, v); - - q = g2[b01]; - u = at2(rx0,ry1); - q = g2[b11]; - v = at2(rx1,ry1); - b = lerp(sx, u, v); - - return lerp(sy, a, b); -} - -float Perlin::noise3(float vec[3]) -{ - int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; - float rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v; - int i, j; - - if (mStart) - { - srand(mSeed); - mStart = false; - init(); - } - - setup(0, bx0,bx1, rx0,rx1); - setup(1, by0,by1, ry0,ry1); - setup(2, bz0,bz1, rz0,rz1); - - i = p[ bx0 ]; - j = p[ bx1 ]; - - b00 = p[ i + by0 ]; - b10 = p[ j + by0 ]; - b01 = p[ i + by1 ]; - b11 = p[ j + by1 ]; - - t = s_curve(rx0); - sy = s_curve(ry0); - sz = s_curve(rz0); - - #define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] ) - - q = g3[ b00 + bz0 ] ; u = at3(rx0,ry0,rz0); - q = g3[ b10 + bz0 ] ; v = at3(rx1,ry0,rz0); - a = lerp(t, u, v); - - q = g3[ b01 + bz0 ] ; u = at3(rx0,ry1,rz0); - q = g3[ b11 + bz0 ] ; v = at3(rx1,ry1,rz0); - b = lerp(t, u, v); - - c = lerp(sy, a, b); - - q = g3[ b00 + bz1 ] ; u = at3(rx0,ry0,rz1); - q = g3[ b10 + bz1 ] ; v = at3(rx1,ry0,rz1); - a = lerp(t, u, v); - - q = g3[ b01 + bz1 ] ; u = at3(rx0,ry1,rz1); - q = g3[ b11 + bz1 ] ; v = at3(rx1,ry1,rz1); - b = lerp(t, u, v); - - d = lerp(sy, a, b); - - return lerp(sz, c, d); -} - -void Perlin::normalize2(float v[2]) -{ - float s; - - s = (float)sqrt(v[0] * v[0] + v[1] * v[1]); - s = 1.0f/s; - v[0] = v[0] * s; - v[1] = v[1] * s; -} - -void Perlin::normalize3(float v[3]) -{ - float s; - - s = (float)sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - s = 1.0f/s; - - v[0] = v[0] * s; - v[1] = v[1] * s; - v[2] = v[2] * s; -} - -void Perlin::init(void) -{ - int i, j, k; - - for (i = 0 ; i < B ; i++) - { - p[i] = i; - g1[i] = (float)((rand() % (B + B)) - B) / B; - for (j = 0 ; j < 2 ; j++) - g2[i][j] = (float)((rand() % (B + B)) - B) / B; - normalize2(g2[i]); - for (j = 0 ; j < 3 ; j++) - g3[i][j] = (float)((rand() % (B + B)) - B) / B; - normalize3(g3[i]); - } - - while (--i) - { - k = p[i]; - p[i] = p[j = rand() % B]; - p[j] = k; - } - - for (i = 0 ; i < B + 2 ; i++) - { - p[B + i] = p[i]; - g1[B + i] = g1[i]; - for (j = 0 ; j < 2 ; j++) - g2[B + i][j] = g2[i][j]; - for (j = 0 ; j < 3 ; j++) - g3[B + i][j] = g3[i][j]; - } - -} - - -float Perlin::perlin_noise_2D(float vec[2]) -{ - int terms = mOctaves; - float result = 0.0f; - float amp = mAmplitude; - - vec[0]*=mFrequency; - vec[1]*=mFrequency; - - for( int i=0; i +#include +#include + +#include "Perlin.h" + +#define B SAMPLE_SIZE +#define BM (SAMPLE_SIZE-1) + +#define N 0x1000 +#define NP 12 /* 2^N */ +#define NM 0xfff + +#define s_curve(t) ( t * t * (3.0f - 2.0f * t) ) +#define lerp(t, a, b) ( a + t * (b - a) ) + +#define setup(i,b0,b1,r0,r1)\ + t = vec[i] + N;\ + b0 = ((int)t) & BM;\ + b1 = (b0+1) & BM;\ + r0 = t - (int)t;\ + r1 = r0 - 1.0f; + +float Perlin::noise1(float arg) +{ + int bx0, bx1; + float rx0, rx1, sx, t, u, v, vec[1]; + + vec[0] = arg; + + if (mStart) + { + srand(mSeed); + mStart = false; + init(); + } + + setup(0, bx0,bx1, rx0,rx1); + + sx = s_curve(rx0); + + u = rx0 * g1[ p[ bx0 ] ]; + v = rx1 * g1[ p[ bx1 ] ]; + + return lerp(sx, u, v); +} + +float Perlin::noise2(float vec[2]) +{ + int bx0, bx1, by0, by1, b00, b10, b01, b11; + float rx0, rx1, ry0, ry1, *q, sx, sy, a, b, t, u, v; + int i, j; + + if (mStart) + { + srand(mSeed); + mStart = false; + init(); + } + + setup(0,bx0,bx1,rx0,rx1); + setup(1,by0,by1,ry0,ry1); + + i = p[bx0]; + j = p[bx1]; + + b00 = p[i + by0]; + b10 = p[j + by0]; + b01 = p[i + by1]; + b11 = p[j + by1]; + + sx = s_curve(rx0); + sy = s_curve(ry0); + + #define at2(rx,ry) ( rx * q[0] + ry * q[1] ) + + q = g2[b00]; + u = at2(rx0,ry0); + q = g2[b10]; + v = at2(rx1,ry0); + a = lerp(sx, u, v); + + q = g2[b01]; + u = at2(rx0,ry1); + q = g2[b11]; + v = at2(rx1,ry1); + b = lerp(sx, u, v); + + return lerp(sy, a, b); +} + +float Perlin::noise3(float vec[3]) +{ + int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; + float rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v; + int i, j; + + if (mStart) + { + srand(mSeed); + mStart = false; + init(); + } + + setup(0, bx0,bx1, rx0,rx1); + setup(1, by0,by1, ry0,ry1); + setup(2, bz0,bz1, rz0,rz1); + + i = p[ bx0 ]; + j = p[ bx1 ]; + + b00 = p[ i + by0 ]; + b10 = p[ j + by0 ]; + b01 = p[ i + by1 ]; + b11 = p[ j + by1 ]; + + t = s_curve(rx0); + sy = s_curve(ry0); + sz = s_curve(rz0); + + #define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] ) + + q = g3[ b00 + bz0 ] ; u = at3(rx0,ry0,rz0); + q = g3[ b10 + bz0 ] ; v = at3(rx1,ry0,rz0); + a = lerp(t, u, v); + + q = g3[ b01 + bz0 ] ; u = at3(rx0,ry1,rz0); + q = g3[ b11 + bz0 ] ; v = at3(rx1,ry1,rz0); + b = lerp(t, u, v); + + c = lerp(sy, a, b); + + q = g3[ b00 + bz1 ] ; u = at3(rx0,ry0,rz1); + q = g3[ b10 + bz1 ] ; v = at3(rx1,ry0,rz1); + a = lerp(t, u, v); + + q = g3[ b01 + bz1 ] ; u = at3(rx0,ry1,rz1); + q = g3[ b11 + bz1 ] ; v = at3(rx1,ry1,rz1); + b = lerp(t, u, v); + + d = lerp(sy, a, b); + + return lerp(sz, c, d); +} + +void Perlin::normalize2(float v[2]) +{ + float s; + + s = (float)sqrt(v[0] * v[0] + v[1] * v[1]); + s = 1.0f/s; + v[0] = v[0] * s; + v[1] = v[1] * s; +} + +void Perlin::normalize3(float v[3]) +{ + float s; + + s = (float)sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + s = 1.0f/s; + + v[0] = v[0] * s; + v[1] = v[1] * s; + v[2] = v[2] * s; +} + +void Perlin::init(void) +{ + int i, j, k; + + for (i = 0 ; i < B ; i++) + { + p[i] = i; + g1[i] = (float)((rand() % (B + B)) - B) / B; + for (j = 0 ; j < 2 ; j++) + g2[i][j] = (float)((rand() % (B + B)) - B) / B; + normalize2(g2[i]); + for (j = 0 ; j < 3 ; j++) + g3[i][j] = (float)((rand() % (B + B)) - B) / B; + normalize3(g3[i]); + } + + while (--i) + { + k = p[i]; + p[i] = p[j = rand() % B]; + p[j] = k; + } + + for (i = 0 ; i < B + 2 ; i++) + { + p[B + i] = p[i]; + g1[B + i] = g1[i]; + for (j = 0 ; j < 2 ; j++) + g2[B + i][j] = g2[i][j]; + for (j = 0 ; j < 3 ; j++) + g3[B + i][j] = g3[i][j]; + } + +} + + +float Perlin::perlin_noise_2D(float vec[2]) +{ + int terms = mOctaves; + float result = 0.0f; + float amp = mAmplitude; + + vec[0]*=mFrequency; + vec[1]*=mFrequency; + + for( int i=0; i - - -#define SAMPLE_SIZE 1024 - -class Perlin -{ -public: - - Perlin(int octaves,float freq,float amp,int seed); - - - float Get(float x,float y) - { - float vec[2]; - vec[0] = x; - vec[1] = y; - return perlin_noise_2D(vec); - }; - - float Get3D(float x,float y,float z) - { - float vec[3]; - vec[0] = x; - vec[1] = y; - vec[2] = z; - return perlin_noise_3D(vec); - }; - -private: - void init_perlin(int n,float p); - float perlin_noise_2D(float vec[2]); - float perlin_noise_3D(float vec[3]); - - float noise1(float arg); - float noise2(float vec[2]); - float noise3(float vec[3]); - void normalize2(float v[2]); - void normalize3(float v[3]); - void init(void); - - int mOctaves; - float mFrequency; - float mAmplitude; - int mSeed; - - int p[SAMPLE_SIZE + SAMPLE_SIZE + 2]; - float g3[SAMPLE_SIZE + SAMPLE_SIZE + 2][3]; - float g2[SAMPLE_SIZE + SAMPLE_SIZE + 2][2]; - float g1[SAMPLE_SIZE + SAMPLE_SIZE + 2]; - bool mStart; - -}; - -#endif - +// Code from http://www.flipcode.com/archives/Perlin_Noise_Class.shtml +// This is only in PolyVox for the purpose of the examples. It was not written by +// the PolyVox authors and cannot be assumed to be under the same license as PolyVox. + +#ifndef PERLIN_H_ + +#define PERLIN_H_ + +#include + + +#define SAMPLE_SIZE 1024 + +class Perlin +{ +public: + + Perlin(int octaves,float freq,float amp,int seed); + + + float Get(float x,float y) + { + float vec[2]; + vec[0] = x; + vec[1] = y; + return perlin_noise_2D(vec); + }; + + float Get3D(float x,float y,float z) + { + float vec[3]; + vec[0] = x; + vec[1] = y; + vec[2] = z; + return perlin_noise_3D(vec); + }; + +private: + void init_perlin(int n,float p); + float perlin_noise_2D(float vec[2]); + float perlin_noise_3D(float vec[3]); + + float noise1(float arg); + float noise2(float vec[2]); + float noise3(float vec[3]); + void normalize2(float v[2]); + void normalize3(float v[3]); + void init(void); + + int mOctaves; + float mFrequency; + float mAmplitude; + int mSeed; + + int p[SAMPLE_SIZE + SAMPLE_SIZE + 2]; + float g3[SAMPLE_SIZE + SAMPLE_SIZE + 2][3]; + float g2[SAMPLE_SIZE + SAMPLE_SIZE + 2][2]; + float g1[SAMPLE_SIZE + SAMPLE_SIZE + 2]; + bool mStart; + +}; + +#endif + diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 95c93972..86e52aff 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -1,186 +1,186 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLWidget.h" -#include "Perlin.h" - -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" - -#include - -//Use the PolyVox namespace -using namespace PolyVox; - -void createSphereInVolume(PagedVolume& volData, Vector3DFloat v3dVolCenter, float fRadius) -{ - //This vector hold the position of the center of the volume - //Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); - - int iRadius = fRadius; - - //This three-level for loop iterates over every voxel in the volume - for (int z = v3dVolCenter.getZ() - iRadius; z <= v3dVolCenter.getZ() + iRadius; z++) - { - for (int y = v3dVolCenter.getY() - iRadius; y <= v3dVolCenter.getY() + iRadius; y++) - { - for (int x = v3dVolCenter.getX() - iRadius; x <= v3dVolCenter.getX() + iRadius; x++) - { - //Store our current position as a vector... - Vector3DFloat v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - //If the current voxel is less than 'radius' units from the center then we make it solid. - if(fDistToCenter <= fRadius) - { - //Our new density value - uint8_t uDensity = MaterialDensityPair44::getMaxDensity(); - - //Get the old voxel - MaterialDensityPair44 voxel = volData.getVoxel(x,y,z); - - //Modify the density - voxel.setDensity(uDensity); - - //Wrte the voxel value into the volume - volData.setVoxelAt(x, y, z, voxel); - } - } - } - } -} - -/** - * Generates data using Perlin noise. - */ -class PerlinNoisePager : public PolyVox::PagedVolume::Pager -{ -public: - /// Constructor - PerlinNoisePager() - :PagedVolume::Pager() - { - } - - /// Destructor - virtual ~PerlinNoisePager() {}; - - virtual void pageIn(const PolyVox::Region& region, PagedVolume::Chunk* pChunk) - { - Perlin perlin(2,2,1,234); - - for(int x = region.getLowerX(); x <= region.getUpperX(); x++) - { - for(int y = region.getLowerY(); y <= region.getUpperY(); y++) - { - float perlinVal = perlin.Get(x / static_cast(255-1), y / static_cast(255-1)); - perlinVal += 1.0f; - perlinVal *= 0.5f; - perlinVal *= 255; - for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) - { - MaterialDensityPair44 voxel; - if(z < perlinVal) - { - const int xpos = 50; - const int zpos = 100; - if((x-xpos)*(x-xpos) + (z-zpos)*(z-zpos) < 200) { - // tunnel - voxel.setMaterial(0); - voxel.setDensity(MaterialDensityPair44::getMinDensity()); - } else { - // solid - voxel.setMaterial(245); - voxel.setDensity(MaterialDensityPair44::getMaxDensity()); - } - } - else - { - voxel.setMaterial(0); - voxel.setDensity(MaterialDensityPair44::getMinDensity()); - } - - // Voxel position within a chunk always start from zero. So if a chunk represents region (4, 8, 12) to (11, 19, 15) - // then the valid chunk voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the - // region from the volume space position in order to get the chunk space position. - pChunk->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); - } - } - } - } - - virtual void pageOut(const PolyVox::Region& region, PagedVolume::Chunk* /*pChunk*/) - { - std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; - } -}; - -int main(int argc, char *argv[]) -{ - //Create and show the Qt OpenGL window - QApplication app(argc, argv); - OpenGLWidget openGLWidget(0); - openGLWidget.show(); - - PerlinNoisePager* pager = new PerlinNoisePager(); - PagedVolume volData(PolyVox::Region::MaxRegion, pager, 64); - volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb - - //createSphereInVolume(volData, 30); - //createPerlinTerrain(volData); - //createPerlinVolumeSlow(volData); - std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - PolyVox::Region reg(Vector3DInt32(-255,0,0), Vector3DInt32(255,255,255)); - std::cout << "Prefetching region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; - volData.prefetch(reg); - std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - PolyVox::Region reg2(Vector3DInt32(0,0,0), Vector3DInt32(255,255,255)); - std::cout << "Flushing region: " << reg2.getLowerCorner() << " -> " << reg2.getUpperCorner() << std::endl; - volData.flush(reg2); - std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - std::cout << "Flushing entire volume" << std::endl; - volData.flushAll(); - std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; - //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; - - //Extract the surface - auto mesh = extractCubicMesh(&volData, reg2); - std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; - - auto decodedMesh = decodeMesh(mesh); - - //Pass the surface to the OpenGL window - openGLWidget.addMesh(decodedMesh); - - openGLWidget.setViewableRegion(reg2); - - //Run the message pump. - return app.exec(); -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "OpenGLWidget.h" +#include "Perlin.h" + +#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/PagedVolume.h" + +#include + +//Use the PolyVox namespace +using namespace PolyVox; + +void createSphereInVolume(PagedVolume& volData, Vector3DFloat v3dVolCenter, float fRadius) +{ + //This vector hold the position of the center of the volume + //Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + int iRadius = fRadius; + + //This three-level for loop iterates over every voxel in the volume + for (int z = v3dVolCenter.getZ() - iRadius; z <= v3dVolCenter.getZ() + iRadius; z++) + { + for (int y = v3dVolCenter.getY() - iRadius; y <= v3dVolCenter.getY() + iRadius; y++) + { + for (int x = v3dVolCenter.getX() - iRadius; x <= v3dVolCenter.getX() + iRadius; x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + //If the current voxel is less than 'radius' units from the center then we make it solid. + if(fDistToCenter <= fRadius) + { + //Our new density value + uint8_t uDensity = MaterialDensityPair44::getMaxDensity(); + + //Get the old voxel + MaterialDensityPair44 voxel = volData.getVoxel(x,y,z); + + //Modify the density + voxel.setDensity(uDensity); + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, voxel); + } + } + } + } +} + +/** + * Generates data using Perlin noise. + */ +class PerlinNoisePager : public PolyVox::PagedVolume::Pager +{ +public: + /// Constructor + PerlinNoisePager() + :PagedVolume::Pager() + { + } + + /// Destructor + virtual ~PerlinNoisePager() {}; + + virtual void pageIn(const PolyVox::Region& region, PagedVolume::Chunk* pChunk) + { + Perlin perlin(2,2,1,234); + + for(int x = region.getLowerX(); x <= region.getUpperX(); x++) + { + for(int y = region.getLowerY(); y <= region.getUpperY(); y++) + { + float perlinVal = perlin.Get(x / static_cast(255-1), y / static_cast(255-1)); + perlinVal += 1.0f; + perlinVal *= 0.5f; + perlinVal *= 255; + for(int z = region.getLowerZ(); z <= region.getUpperZ(); z++) + { + MaterialDensityPair44 voxel; + if(z < perlinVal) + { + const int xpos = 50; + const int zpos = 100; + if((x-xpos)*(x-xpos) + (z-zpos)*(z-zpos) < 200) { + // tunnel + voxel.setMaterial(0); + voxel.setDensity(MaterialDensityPair44::getMinDensity()); + } else { + // solid + voxel.setMaterial(245); + voxel.setDensity(MaterialDensityPair44::getMaxDensity()); + } + } + else + { + voxel.setMaterial(0); + voxel.setDensity(MaterialDensityPair44::getMinDensity()); + } + + // Voxel position within a chunk always start from zero. So if a chunk represents region (4, 8, 12) to (11, 19, 15) + // then the valid chunk voxels are from (0, 0, 0) to (7, 11, 3). Hence we subtract the lower corner position of the + // region from the volume space position in order to get the chunk space position. + pChunk->setVoxelAt(x - region.getLowerX(), y - region.getLowerY(), z - region.getLowerZ(), voxel); + } + } + } + } + + virtual void pageOut(const PolyVox::Region& region, PagedVolume::Chunk* /*pChunk*/) + { + std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; + } +}; + +int main(int argc, char *argv[]) +{ + //Create and show the Qt OpenGL window + QApplication app(argc, argv); + OpenGLWidget openGLWidget(0); + openGLWidget.show(); + + PerlinNoisePager* pager = new PerlinNoisePager(); + PagedVolume volData(PolyVox::Region::MaxRegion, pager, 64); + volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb + + //createSphereInVolume(volData, 30); + //createPerlinTerrain(volData); + //createPerlinVolumeSlow(volData); + std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + PolyVox::Region reg(Vector3DInt32(-255,0,0), Vector3DInt32(255,255,255)); + std::cout << "Prefetching region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; + volData.prefetch(reg); + std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + PolyVox::Region reg2(Vector3DInt32(0,0,0), Vector3DInt32(255,255,255)); + std::cout << "Flushing region: " << reg2.getLowerCorner() << " -> " << reg2.getUpperCorner() << std::endl; + volData.flush(reg2); + std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + std::cout << "Flushing entire volume" << std::endl; + volData.flushAll(); + std::cout << "Memory usage: " << (volData.calculateSizeInBytes()/1024.0/1024.0) << "MB" << std::endl; + //std::cout << "Compression ratio: 1 to " << (1.0/(volData.calculateCompressionRatio())) << std::endl; + + //Extract the surface + auto mesh = extractCubicMesh(&volData, reg2); + std::cout << "#vertices: " << mesh.getNoOfVertices() << std::endl; + + auto decodedMesh = decodeMesh(mesh); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(decodedMesh); + + openGLWidget.setViewableRegion(reg2); + + //Run the message pump. + return app.exec(); +} diff --git a/examples/Python/CMakeLists.txt b/examples/Python/CMakeLists.txt index dd7176a7..ff6342bb 100644 --- a/examples/Python/CMakeLists.txt +++ b/examples/Python/CMakeLists.txt @@ -1,24 +1,24 @@ -# Copyright (c) 2010-2013 Matt Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -PROJECT(PythonExample) - -configure_file(PythonExample.py PythonExample.py COPYONLY) +# Copyright (c) 2010-2013 Matt Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +PROJECT(PythonExample) + +configure_file(PythonExample.py PythonExample.py COPYONLY) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index abdc59e5..15bbd4b9 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -1,77 +1,77 @@ -# Copyright (c) 2010-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(SmoothLODExample) - -#Projects source files -SET(SRC_FILES - main.cpp - ../common/OpenGLWidget.cpp -) - -#Projects headers files -SET(INC_FILES - OpenGLWidget.h -) - -add_definitions(-DGLEW_STATIC) - -FIND_PACKAGE(OpenGL REQUIRED) - -#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) - -#This will include the shader files inside the compiled binary -QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) - -# Put the resources in a seperate folder in Visual Studio -SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) - -#Build -ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) -IF(MSVC) - SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) -SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples") - -configure_file(../common/example.vert example.vert COPYONLY) -configure_file(../common/example.frag example.frag COPYONLY) - -#Install - Only install the example in Windows -IF(WIN32) - INSTALL(TARGETS SmoothLODExample - RUNTIME DESTINATION Examples/OpenGL/bin - LIBRARY DESTINATION Examples/OpenGL/lib - ARCHIVE DESTINATION Examples/OpenGL/lib - COMPONENT example - ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) -ENDIF(WIN32) +# Copyright (c) 2010-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(SmoothLODExample) + +#Projects source files +SET(SRC_FILES + main.cpp + ../common/OpenGLWidget.cpp +) + +#Projects headers files +SET(INC_FILES + OpenGLWidget.h +) + +add_definitions(-DGLEW_STATIC) + +FIND_PACKAGE(OpenGL REQUIRED) + +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) + +#This will include the shader files inside the compiled binary +QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) + +# Put the resources in a seperate folder in Visual Studio +SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC}) + +#Build +ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) +IF(MSVC) + SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples") + +configure_file(../common/example.vert example.vert COPYONLY) +configure_file(../common/example.frag example.frag COPYONLY) + +#Install - Only install the example in Windows +IF(WIN32) + INSTALL(TARGETS SmoothLODExample + RUNTIME DESTINATION Examples/OpenGL/bin + LIBRARY DESTINATION Examples/OpenGL/lib + ARCHIVE DESTINATION Examples/OpenGL/lib + COMPONENT example + ) + + #.dlls should be installed in shared builds. + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) + + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) + #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) +ENDIF(WIN32) diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 978f9935..da90282c 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -1,110 +1,110 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "OpenGLWidget.h" - -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/VolumeResampler.h" - -#include - -//Use the PolyVox namespace -using namespace PolyVox; - -void createSphereInVolume(PagedVolume& volData, float fRadius) -{ - //This vector hold the position of the center of the volume - Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); - - //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getDepth(); z++) - { - for (int y = 0; y < volData.getHeight(); y++) - { - for (int x = 0; x < volData.getWidth(); x++) - { - //Store our current position as a vector... - Vector3DFloat v3dCurrentPos(x,y,z); - //And compute how far the current position is from the center of the volume - float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); - - if(fDistToCenter <= fRadius) - { - //Our new density value - uint8_t uDensity = std::numeric_limits::max(); - - //Wrte the voxel value into the volume - volData.setVoxelAt(x, y, z, uDensity); - } - - //144 in the middle, (144 - 32) at the edges. Threshold of 128 is between these - //volData.setVoxelAt(x, y, z, 144 - fDistToCenter); - } - } - } -} - -int main(int argc, char *argv[]) -{ - //Create and show the Qt OpenGL window - QApplication app(argc, argv); - OpenGLWidget openGLWidget(0); - openGLWidget.show(); - - //Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); - createSphereInVolume(volData, 28); - - //Smooth the data - should reimplement this using LowPassFilter - //smoothRegion(volData, volData.getEnclosingRegion()); - //smoothRegion(volData, volData.getEnclosingRegion()); - //smoothRegion(volData, volData.getEnclosingRegion()); - - RawVolume volDataLowLOD(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(15, 31, 31))); - - VolumeResampler< PagedVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); - volumeResampler.execute(); - - //Extract the surface - auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); - // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMeshLowLOD = decodeMesh(meshLowLOD); - - //Extract the surface - auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); - // The returned mesh needs to be decoded to be appropriate for GPU rendering. - auto decodedMeshHighLOD = decodeMesh(meshHighLOD); - - //Pass the surface to the OpenGL window - openGLWidget.addMesh(decodedMeshHighLOD, Vector3DInt32(30, 0, 0)); - openGLWidget.addMesh(decodedMeshLowLOD, Vector3DInt32(0, 0, 0), 63.0f / 31.0f); - - openGLWidget.setViewableRegion(volData.getEnclosingRegion()); - - //Run the message pump. - return app.exec(); -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "OpenGLWidget.h" + +#include "PolyVoxCore/Density.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/RawVolume.h" +#include "PolyVoxCore/PagedVolume.h" +#include "PolyVoxCore/VolumeResampler.h" + +#include + +//Use the PolyVox namespace +using namespace PolyVox; + +void createSphereInVolume(PagedVolume& volData, float fRadius) +{ + //This vector hold the position of the center of the volume + Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); + + //This three-level for loop iterates over every voxel in the volume + for (int z = 0; z < volData.getDepth(); z++) + { + for (int y = 0; y < volData.getHeight(); y++) + { + for (int x = 0; x < volData.getWidth(); x++) + { + //Store our current position as a vector... + Vector3DFloat v3dCurrentPos(x,y,z); + //And compute how far the current position is from the center of the volume + float fDistToCenter = (v3dCurrentPos - v3dVolCenter).length(); + + if(fDistToCenter <= fRadius) + { + //Our new density value + uint8_t uDensity = std::numeric_limits::max(); + + //Wrte the voxel value into the volume + volData.setVoxelAt(x, y, z, uDensity); + } + + //144 in the middle, (144 - 32) at the edges. Threshold of 128 is between these + //volData.setVoxelAt(x, y, z, 144 - fDistToCenter); + } + } + } +} + +int main(int argc, char *argv[]) +{ + //Create and show the Qt OpenGL window + QApplication app(argc, argv); + OpenGLWidget openGLWidget(0); + openGLWidget.show(); + + //Create an empty volume and then place a sphere in it + PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); + createSphereInVolume(volData, 28); + + //Smooth the data - should reimplement this using LowPassFilter + //smoothRegion(volData, volData.getEnclosingRegion()); + //smoothRegion(volData, volData.getEnclosingRegion()); + //smoothRegion(volData, volData.getEnclosingRegion()); + + RawVolume volDataLowLOD(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(15, 31, 31))); + + VolumeResampler< PagedVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + volumeResampler.execute(); + + //Extract the surface + auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMeshLowLOD = decodeMesh(meshLowLOD); + + //Extract the surface + auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63))); + // The returned mesh needs to be decoded to be appropriate for GPU rendering. + auto decodedMeshHighLOD = decodeMesh(meshHighLOD); + + //Pass the surface to the OpenGL window + openGLWidget.addMesh(decodedMeshHighLOD, Vector3DInt32(30, 0, 0)); + openGLWidget.addMesh(decodedMeshLowLOD, Vector3DInt32(0, 0, 0), 63.0f / 31.0f); + + openGLWidget.setViewableRegion(volData.getEnclosingRegion()); + + //Run the message pump. + return app.exec(); +} diff --git a/examples/common/OpenGLWidget.cpp b/examples/common/OpenGLWidget.cpp index 44747f2b..d685a3ac 100644 --- a/examples/common/OpenGLWidget.cpp +++ b/examples/common/OpenGLWidget.cpp @@ -1,196 +1,196 @@ -#include "OpenGLWidget.h" - -#include -#include -#include -//#include - -using namespace PolyVox; -using namespace std; - -//////////////////////////////////////////////////////////////////////////////// -// Public functions -//////////////////////////////////////////////////////////////////////////////// -OpenGLWidget::OpenGLWidget(QWidget *parent) - :QGLWidget(parent) - ,m_viewableRegion(PolyVox::Region(0, 0, 0, 255, 255, 255)) - ,m_xRotation(0) - ,m_yRotation(0) -{ -} - -void OpenGLWidget::setShader(QSharedPointer shader) -{ - mShader = shader; -} - -void OpenGLWidget::setViewableRegion(PolyVox::Region viewableRegion) -{ - m_viewableRegion = viewableRegion; - - // The user has specifed a new viewable region - // so we need to regenerate our camera matrix. - setupWorldToCameraMatrix(); -} - -void OpenGLWidget::mousePressEvent(QMouseEvent* event) -{ - // Initialise these variables which will be used when the mouse actually moves. - m_CurrentMousePos = event->pos(); - m_LastFrameMousePos = m_CurrentMousePos; -} - -void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) -{ - // Update the x and y rotations based on the mouse movement. - m_CurrentMousePos = event->pos(); - QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; - m_xRotation += diff.x(); - m_yRotation += diff.y(); - m_LastFrameMousePos = m_CurrentMousePos; - - // The camera rotation has changed so we need to regenerate the matrix. - setupWorldToCameraMatrix(); - - // Re-render. - update(); -} - -//////////////////////////////////////////////////////////////////////////////// -// Protected functions -//////////////////////////////////////////////////////////////////////////////// -void OpenGLWidget::initializeGL() -{ - GLenum err = glewInit(); - if (GLEW_OK != err) - { - /* Problem: glewInit failed, something is seriously wrong. */ - std::cout << "GLEW Error: " << glewGetErrorString(err) << std::endl; - } - - //Print out some information about the OpenGL implementation. - std::cout << "OpenGL Implementation Details:" << std::endl; - if(glGetString(GL_VENDOR)) - std::cout << "\tGL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; - if(glGetString(GL_RENDERER)) - std::cout << "\tGL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; - if(glGetString(GL_VERSION)) - std::cout << "\tGL_VERSION: " << glGetString(GL_VERSION) << std::endl; - if(glGetString(GL_SHADING_LANGUAGE_VERSION)) - std::cout << "\tGL_SHADING_LANGUAGE_VERSION: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; - - //Set up the clear colour - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClearDepth(1.0f); - - glEnable(GL_DEPTH_TEST); - glDepthMask(GL_TRUE); - glDepthFunc(GL_LEQUAL); - glDepthRange(0.0, 1.0); - - mShader = QSharedPointer(new QGLShaderProgram); - - // This is basically a simple fallback vertex shader which does the most basic rendering possible. - // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceFile(QGLShader::Vertex, ":/example.vert")) - { - std::cerr << mShader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - // This is basically a simple fallback fragment shader which does the most basic rendering possible. - // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. - if (!mShader->addShaderFromSourceFile(QGLShader::Fragment, ":/example.frag")) - { - std::cerr << mShader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - // Bind the position semantic - this is defined in the vertex shader above. - mShader->bindAttributeLocation("position", 0); - - // Bind the other semantics. Note that these don't actually exist in our example shader above! However, other - // example shaders may choose to provide them and having the binding code here does not seem to cause any problems. - mShader->bindAttributeLocation("normal", 1); - mShader->bindAttributeLocation("material", 2); - - if (!mShader->link()) - { - std::cerr << mShader->log().toStdString() << std::endl; - exit(EXIT_FAILURE); - } - - // Initial setup of camera. - setupWorldToCameraMatrix(); -} - -void OpenGLWidget::resizeGL(int w, int h) -{ - //Setup the viewport - glViewport(0, 0, w, h); - - auto aspectRatio = w / (float)h; - float zNear = 1.0; - float zFar = 1000.0; - - cameraToClipMatrix.setToIdentity(); - cameraToClipMatrix.frustum(-aspectRatio, aspectRatio, -1, 1, zNear, zFar); -} - -void OpenGLWidget::paintGL() -{ - //Clear the screen - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Our example framework only uses a single shader for the scene (for all meshes). - mShader->bind(); - - // These two matrices are constant for all meshes. - mShader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); - mShader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); - - // Iterate over each mesh which the user added to our list, and render it. - for (OpenGLMeshData meshData : mMeshData) - { - //Set up the model matrrix based on provided translation and scale. - QMatrix4x4 modelToWorldMatrix; - modelToWorldMatrix.translate(meshData.translation); - modelToWorldMatrix.scale(meshData.scale); - mShader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); - - // Bind the vertex array for the current mesh - glBindVertexArray(meshData.vertexArrayObject); - // Draw the mesh - glDrawElements(GL_TRIANGLES, meshData.noOfIndices, meshData.indexType, 0); - // Unbind the vertex array. - glBindVertexArray(0); - } - - // We're done with the shader for this frame. - mShader->release(); - - // Check for errors. - GLenum errCode = glGetError(); - if(errCode != GL_NO_ERROR) - { - std::cerr << "OpenGL Error: " << errCode << std::endl; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Private functions -//////////////////////////////////////////////////////////////////////////////// -void OpenGLWidget::setupWorldToCameraMatrix() -{ - QVector3D lowerCorner(m_viewableRegion.getLowerX(), m_viewableRegion.getLowerY(), m_viewableRegion.getLowerZ()); - QVector3D upperCorner(m_viewableRegion.getUpperX(), m_viewableRegion.getUpperY(), m_viewableRegion.getUpperZ()); - - QVector3D centerPoint = (lowerCorner + upperCorner) * 0.5; - float fDiagonalLength = (upperCorner - lowerCorner).length(); - - worldToCameraMatrix.setToIdentity(); - worldToCameraMatrix.translate(0, 0, -fDiagonalLength / 2.0f); //Move the camera back by the required amount - worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis - worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis - worldToCameraMatrix.translate(-centerPoint); //centre the model on the origin +#include "OpenGLWidget.h" + +#include +#include +#include +//#include + +using namespace PolyVox; +using namespace std; + +//////////////////////////////////////////////////////////////////////////////// +// Public functions +//////////////////////////////////////////////////////////////////////////////// +OpenGLWidget::OpenGLWidget(QWidget *parent) + :QGLWidget(parent) + ,m_viewableRegion(PolyVox::Region(0, 0, 0, 255, 255, 255)) + ,m_xRotation(0) + ,m_yRotation(0) +{ +} + +void OpenGLWidget::setShader(QSharedPointer shader) +{ + mShader = shader; +} + +void OpenGLWidget::setViewableRegion(PolyVox::Region viewableRegion) +{ + m_viewableRegion = viewableRegion; + + // The user has specifed a new viewable region + // so we need to regenerate our camera matrix. + setupWorldToCameraMatrix(); +} + +void OpenGLWidget::mousePressEvent(QMouseEvent* event) +{ + // Initialise these variables which will be used when the mouse actually moves. + m_CurrentMousePos = event->pos(); + m_LastFrameMousePos = m_CurrentMousePos; +} + +void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) +{ + // Update the x and y rotations based on the mouse movement. + m_CurrentMousePos = event->pos(); + QPoint diff = m_CurrentMousePos - m_LastFrameMousePos; + m_xRotation += diff.x(); + m_yRotation += diff.y(); + m_LastFrameMousePos = m_CurrentMousePos; + + // The camera rotation has changed so we need to regenerate the matrix. + setupWorldToCameraMatrix(); + + // Re-render. + update(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Protected functions +//////////////////////////////////////////////////////////////////////////////// +void OpenGLWidget::initializeGL() +{ + GLenum err = glewInit(); + if (GLEW_OK != err) + { + /* Problem: glewInit failed, something is seriously wrong. */ + std::cout << "GLEW Error: " << glewGetErrorString(err) << std::endl; + } + + //Print out some information about the OpenGL implementation. + std::cout << "OpenGL Implementation Details:" << std::endl; + if(glGetString(GL_VENDOR)) + std::cout << "\tGL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; + if(glGetString(GL_RENDERER)) + std::cout << "\tGL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; + if(glGetString(GL_VERSION)) + std::cout << "\tGL_VERSION: " << glGetString(GL_VERSION) << std::endl; + if(glGetString(GL_SHADING_LANGUAGE_VERSION)) + std::cout << "\tGL_SHADING_LANGUAGE_VERSION: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; + + //Set up the clear colour + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClearDepth(1.0f); + + glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); + glDepthFunc(GL_LEQUAL); + glDepthRange(0.0, 1.0); + + mShader = QSharedPointer(new QGLShaderProgram); + + // This is basically a simple fallback vertex shader which does the most basic rendering possible. + // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. + if (!mShader->addShaderFromSourceFile(QGLShader::Vertex, ":/example.vert")) + { + std::cerr << mShader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + // This is basically a simple fallback fragment shader which does the most basic rendering possible. + // PolyVox examples are able to provide their own shaders to demonstrate certain effects if desired. + if (!mShader->addShaderFromSourceFile(QGLShader::Fragment, ":/example.frag")) + { + std::cerr << mShader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + // Bind the position semantic - this is defined in the vertex shader above. + mShader->bindAttributeLocation("position", 0); + + // Bind the other semantics. Note that these don't actually exist in our example shader above! However, other + // example shaders may choose to provide them and having the binding code here does not seem to cause any problems. + mShader->bindAttributeLocation("normal", 1); + mShader->bindAttributeLocation("material", 2); + + if (!mShader->link()) + { + std::cerr << mShader->log().toStdString() << std::endl; + exit(EXIT_FAILURE); + } + + // Initial setup of camera. + setupWorldToCameraMatrix(); +} + +void OpenGLWidget::resizeGL(int w, int h) +{ + //Setup the viewport + glViewport(0, 0, w, h); + + auto aspectRatio = w / (float)h; + float zNear = 1.0; + float zFar = 1000.0; + + cameraToClipMatrix.setToIdentity(); + cameraToClipMatrix.frustum(-aspectRatio, aspectRatio, -1, 1, zNear, zFar); +} + +void OpenGLWidget::paintGL() +{ + //Clear the screen + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // Our example framework only uses a single shader for the scene (for all meshes). + mShader->bind(); + + // These two matrices are constant for all meshes. + mShader->setUniformValue("worldToCameraMatrix", worldToCameraMatrix); + mShader->setUniformValue("cameraToClipMatrix", cameraToClipMatrix); + + // Iterate over each mesh which the user added to our list, and render it. + for (OpenGLMeshData meshData : mMeshData) + { + //Set up the model matrrix based on provided translation and scale. + QMatrix4x4 modelToWorldMatrix; + modelToWorldMatrix.translate(meshData.translation); + modelToWorldMatrix.scale(meshData.scale); + mShader->setUniformValue("modelToWorldMatrix", modelToWorldMatrix); + + // Bind the vertex array for the current mesh + glBindVertexArray(meshData.vertexArrayObject); + // Draw the mesh + glDrawElements(GL_TRIANGLES, meshData.noOfIndices, meshData.indexType, 0); + // Unbind the vertex array. + glBindVertexArray(0); + } + + // We're done with the shader for this frame. + mShader->release(); + + // Check for errors. + GLenum errCode = glGetError(); + if(errCode != GL_NO_ERROR) + { + std::cerr << "OpenGL Error: " << errCode << std::endl; + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Private functions +//////////////////////////////////////////////////////////////////////////////// +void OpenGLWidget::setupWorldToCameraMatrix() +{ + QVector3D lowerCorner(m_viewableRegion.getLowerX(), m_viewableRegion.getLowerY(), m_viewableRegion.getLowerZ()); + QVector3D upperCorner(m_viewableRegion.getUpperX(), m_viewableRegion.getUpperY(), m_viewableRegion.getUpperZ()); + + QVector3D centerPoint = (lowerCorner + upperCorner) * 0.5; + float fDiagonalLength = (upperCorner - lowerCorner).length(); + + worldToCameraMatrix.setToIdentity(); + worldToCameraMatrix.translate(0, 0, -fDiagonalLength / 2.0f); //Move the camera back by the required amount + worldToCameraMatrix.rotate(m_xRotation, 0, 1, 0); //rotate around y-axis + worldToCameraMatrix.rotate(m_yRotation, 1, 0, 0); //rotate around x-axis + worldToCameraMatrix.translate(-centerPoint); //centre the model on the origin } \ No newline at end of file diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 5ceb28ae..4112a2fa 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -1,160 +1,160 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __BasicExample_OpenGLWidget_H__ -#define __BasicExample_OpenGLWidget_H__ - -#include "PolyVoxCore/Mesh.h" - -#include "glew/glew.h" - -#include -#include - -// This structure holds all the data required -// to render one of our meshes through OpenGL. -struct OpenGLMeshData -{ - GLuint noOfIndices; - GLenum indexType; - GLuint indexBuffer; - GLuint vertexBuffer; - GLuint vertexArrayObject; - QVector3D translation; - float scale; -}; - -// Our OpenGLWidget is used by all the examples to render the extracted meshes. It is -// fairly specific to our needs (you probably won't want to use it in your own project) -// but should provide a useful illustration of how PolyVox meshes can be rendered. -class OpenGLWidget : public QGLWidget -{ -public: - // Constructor - OpenGLWidget(QWidget *parent); - - // Convert a PolyVox mesh to OpenGL index/vertex buffers. Inlined because it's templatised. - template - void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) - { - // Convienient access to the vertices and indices - const auto& vecIndices = surfaceMesh.getIndices(); - const auto& vecVertices = surfaceMesh.getVertices(); - - // This struct holds the OpenGL properties (buffer handles, etc) which will be used - // to render our mesh. We copy the data from the PolyVox mesh into this structure. - OpenGLMeshData meshData; - - // Create the VAO for the mesh - glGenVertexArrays(1, &(meshData.vertexArrayObject)); - glBindVertexArray(meshData.vertexArrayObject); - - // The GL_ARRAY_BUFFER will contain the list of vertex positions - glGenBuffers(1, &(meshData.vertexBuffer)); - glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(typename MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); - - // and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(meshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(typename MeshType::IndexType), vecIndices.data(), GL_STATIC_DRAW); - - // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out - glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) - - // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor - // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the - // shader. This is mostly just to simplify this example code - in a real application you will know whether your - // chosen surface extractor generates normals and can skip uploading them if not. - glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, normal))); - - // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code - // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. - glEnableVertexAttribArray(2); //We're talking about shader attribute '2' - GLint size = (std::min)(sizeof(typename MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) - glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, data))); - - // We're done uploading and can now unbind. - glBindVertexArray(0); - - // A few additional properties can be copied across for use during rendering. - meshData.noOfIndices = vecIndices.size(); - meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); - meshData.scale = scale; - - // Set 16 or 32-bit index buffer size. - meshData.indexType = sizeof(typename MeshType::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; - - // Now add the mesh to the list of meshes to render. - addMeshData(meshData); - } - - void addMeshData(OpenGLMeshData meshData) - { - mMeshData.push_back(meshData); - } - - // For our purposes we use a single shader for the whole volume, and - // this example framework is only meant to show a single volume at a time - void setShader(QSharedPointer shader); - - // The viewable region can be adjusted so that this example framework can be used for different volume sizes. - void setViewableRegion(PolyVox::Region viewableRegion); - - // Mouse handling - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - -protected: - - // Qt OpenGL functions - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - -private: - - void setupWorldToCameraMatrix(); - - // Index/vertex buffer data - std::vector mMeshData; - - QSharedPointer mShader; - - // Matrices - QMatrix4x4 worldToCameraMatrix; - QMatrix4x4 cameraToClipMatrix; - - // Mouse data - QPoint m_LastFrameMousePos; - QPoint m_CurrentMousePos; - - // Camera setup - PolyVox::Region m_viewableRegion; - int m_xRotation; - int m_yRotation; -}; - -#endif //__BasicExample_OpenGLWidget_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*******************************************************************************/ + +#ifndef __BasicExample_OpenGLWidget_H__ +#define __BasicExample_OpenGLWidget_H__ + +#include "PolyVoxCore/Mesh.h" + +#include "glew/glew.h" + +#include +#include + +// This structure holds all the data required +// to render one of our meshes through OpenGL. +struct OpenGLMeshData +{ + GLuint noOfIndices; + GLenum indexType; + GLuint indexBuffer; + GLuint vertexBuffer; + GLuint vertexArrayObject; + QVector3D translation; + float scale; +}; + +// Our OpenGLWidget is used by all the examples to render the extracted meshes. It is +// fairly specific to our needs (you probably won't want to use it in your own project) +// but should provide a useful illustration of how PolyVox meshes can be rendered. +class OpenGLWidget : public QGLWidget +{ +public: + // Constructor + OpenGLWidget(QWidget *parent); + + // Convert a PolyVox mesh to OpenGL index/vertex buffers. Inlined because it's templatised. + template + void addMesh(const MeshType& surfaceMesh, const PolyVox::Vector3DInt32& translation = PolyVox::Vector3DInt32(0, 0, 0), float scale = 1.0f) + { + // Convienient access to the vertices and indices + const auto& vecIndices = surfaceMesh.getIndices(); + const auto& vecVertices = surfaceMesh.getVertices(); + + // This struct holds the OpenGL properties (buffer handles, etc) which will be used + // to render our mesh. We copy the data from the PolyVox mesh into this structure. + OpenGLMeshData meshData; + + // Create the VAO for the mesh + glGenVertexArrays(1, &(meshData.vertexArrayObject)); + glBindVertexArray(meshData.vertexArrayObject); + + // The GL_ARRAY_BUFFER will contain the list of vertex positions + glGenBuffers(1, &(meshData.vertexBuffer)); + glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(typename MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW); + + // and GL_ELEMENT_ARRAY_BUFFER will contain the indices + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(typename MeshType::IndexType), vecIndices.data(), GL_STATIC_DRAW); + + // Every surface extractor outputs valid positions for the vertices, so tell OpenGL how these are laid out + glEnableVertexAttribArray(0); // Attrib '0' is the vertex positions + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, position))); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type) + + // Some surface extractors also generate normals, so tell OpenGL how these are laid out. If a surface extractor + // does not generate normals then nonsense values are written into the buffer here and sghould be ignored by the + // shader. This is mostly just to simplify this example code - in a real application you will know whether your + // chosen surface extractor generates normals and can skip uploading them if not. + glEnableVertexAttribArray(1); // Attrib '1' is the vertex normals. + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, normal))); + + // Finally a surface extractor will probably output additional data. This is highly application dependant. For this example code + // we're just uploading it as a set of bytes which we can read individually, but real code will want to do something specialised here. + glEnableVertexAttribArray(2); //We're talking about shader attribute '2' + GLint size = (std::min)(sizeof(typename MeshType::VertexType::DataType), size_t(4)); // Can't upload more that 4 components (vec4 is GLSL's biggest type) + glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(typename MeshType::VertexType), (GLvoid*)(offsetof(typename MeshType::VertexType, data))); + + // We're done uploading and can now unbind. + glBindVertexArray(0); + + // A few additional properties can be copied across for use during rendering. + meshData.noOfIndices = vecIndices.size(); + meshData.translation = QVector3D(translation.getX(), translation.getY(), translation.getZ()); + meshData.scale = scale; + + // Set 16 or 32-bit index buffer size. + meshData.indexType = sizeof(typename MeshType::IndexType) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; + + // Now add the mesh to the list of meshes to render. + addMeshData(meshData); + } + + void addMeshData(OpenGLMeshData meshData) + { + mMeshData.push_back(meshData); + } + + // For our purposes we use a single shader for the whole volume, and + // this example framework is only meant to show a single volume at a time + void setShader(QSharedPointer shader); + + // The viewable region can be adjusted so that this example framework can be used for different volume sizes. + void setViewableRegion(PolyVox::Region viewableRegion); + + // Mouse handling + void mouseMoveEvent(QMouseEvent* event); + void mousePressEvent(QMouseEvent* event); + +protected: + + // Qt OpenGL functions + void initializeGL(); + void resizeGL(int w, int h); + void paintGL(); + +private: + + void setupWorldToCameraMatrix(); + + // Index/vertex buffer data + std::vector mMeshData; + + QSharedPointer mShader; + + // Matrices + QMatrix4x4 worldToCameraMatrix; + QMatrix4x4 cameraToClipMatrix; + + // Mouse data + QPoint m_LastFrameMousePos; + QPoint m_CurrentMousePos; + + // Camera setup + PolyVox::Region m_viewableRegion; + int m_xRotation; + int m_yRotation; +}; + +#endif //__BasicExample_OpenGLWidget_H__ diff --git a/examples/common/glew/LICENSE.txt b/examples/common/glew/LICENSE.txt index 89d74b80..f7078042 100644 --- a/examples/common/glew/LICENSE.txt +++ b/examples/common/glew/LICENSE.txt @@ -1,73 +1,73 @@ -The OpenGL Extension Wrangler Library -Copyright (C) 2002-2007, Milan Ikits -Copyright (C) 2002-2007, Marcelo E. Magallon -Copyright (C) 2002, Lev Povalahev -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* The name of the author may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. - - -Mesa 3-D graphics library -Version: 7.0 - -Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Copyright (c) 2007 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Materials. - -THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2007, Milan Ikits +Copyright (C) 2002-2007, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/examples/common/glew/glew.cpp b/examples/common/glew/glew.cpp index 54508e97..5770fb30 100644 --- a/examples/common/glew/glew.cpp +++ b/examples/common/glew/glew.cpp @@ -1,16972 +1,16972 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "glew.h" - -#if defined(_WIN32) -# include "wglew.h" -#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) -# include "glxew.h" -#endif - -/* - * Define glewGetContext and related helper macros. - */ -#ifdef GLEW_MX -# define glewGetContext() ctx -# ifdef _WIN32 -# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx -# define GLEW_CONTEXT_ARG_VAR_INIT ctx -# define wglewGetContext() ctx -# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx -# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx -# else /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define glxewGetContext() ctx -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx -# endif /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx -#else /* GLEW_MX */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define GLEW_CONTEXT_ARG_DEF_LIST void -# define WGLEW_CONTEXT_ARG_DEF_INIT void -# define WGLEW_CONTEXT_ARG_DEF_LIST void -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST void -#endif /* GLEW_MX */ - -#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) -#include -#include -#include - -void* dlGetProcAddress (const GLubyte* name) -{ - static void* h = NULL; - static void* gpa; - - if (h == NULL) - { - if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; - gpa = dlsym(h, "glXGetProcAddress"); - } - - if (gpa != NULL) - return ((void*(*)(const GLubyte*))gpa)(name); - else - return dlsym(h, (const char*)name); -} -#endif /* __sgi || __sun || GLEW_APPLE_GLX */ - -#if defined(__APPLE__) -#include -#include -#include - -#ifdef MAC_OS_X_VERSION_10_3 - -#include - -void* NSGLGetProcAddress (const GLubyte *name) -{ - static void* image = NULL; - void* addr; - if (NULL == image) - { -#ifdef GLEW_REGAL - image = dlopen("libRegal.dylib", RTLD_LAZY); -#else - image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); -#endif - } - if( !image ) return NULL; - addr = dlsym(image, (const char*)name); - if( addr ) return addr; -#ifdef GLEW_APPLE_GLX - return dlGetProcAddress( name ); // try next for glx symbols -#else - return NULL; -#endif -} -#else - -#include - -void* NSGLGetProcAddress (const GLubyte *name) -{ - static const struct mach_header* image = NULL; - NSSymbol symbol; - char* symbolName; - if (NULL == image) - { -#ifdef GLEW_REGAL - image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR); -#else - image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); -#endif - } - /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char*)name) + 2); - strcpy(symbolName+1, (const char*)name); - symbolName[0] = '_'; - symbol = NULL; - /* if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); */ - symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; - free(symbolName); - if( symbol ) return NSAddressOfSymbol(symbol); -#ifdef GLEW_APPLE_GLX - return dlGetProcAddress( name ); // try next for glx symbols -#else - return NULL; -#endif -} -#endif /* MAC_OS_X_VERSION_10_3 */ -#endif /* __APPLE__ */ - -/* - * Define glewGetProcAddress. - */ -#if defined(_WIN32) -# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) -#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) -# define glewGetProcAddress(name) NSGLGetProcAddress(name) -#elif defined(__sgi) || defined(__sun) -# define glewGetProcAddress(name) dlGetProcAddress(name) -#elif defined(__ANDROID__) -# define glewGetProcAddress(name) NULL /* TODO */ -#else /* __linux */ -# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) -#endif - -/* - * Define GLboolean const cast. - */ -#define CONST_CAST(x) (*(GLboolean*)&x) - -/* - * GLEW, just like OpenGL or GLU, does not rely on the standard C library. - * These functions implement the functionality required in this file. - */ -static GLuint _glewStrLen (const GLubyte* s) -{ - GLuint i=0; - if (s == NULL) return 0; - while (s[i] != '\0') i++; - return i; -} - -static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) -{ - GLuint i=0; - if (s == NULL) return 0; - while (s[i] != '\0' && s[i] != c) i++; - return (s[i] == '\0' || s[i] == c) ? i : 0; -} - -static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) -{ - GLuint i=0; - if(a == NULL || b == NULL) - return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; - while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; - return i == n ? GL_TRUE : GL_FALSE; -} - -static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) - { - (*a)++; - (*na)--; - } - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -/* - * Search for name in the extensions string. Use of strstr() - * is not sufficient because extension names can be prefixes of - * other extension names. Could use strtok() but the constant - * string returned by glGetString might be in read-only memory. - */ -static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) -{ - const GLubyte* p; - GLuint len = _glewStrLen((const GLubyte*)name); - p = start; - while (p < end) - { - GLuint n = _glewStrCLen(p, ' '); - if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; - p += n+1; - } - return GL_FALSE; -} - -#if !defined(_WIN32) || !defined(GLEW_MX) - -PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; -PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; -PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; -PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; - -PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; -PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; -PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; -PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; -PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; -PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; -PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; -PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; -PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; -PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; -PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; -PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; -PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; -PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; -PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; -PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; -PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; -PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; -PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; -PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; -PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; -PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; -PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; -PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; -PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; -PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; -PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; -PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; -PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; -PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; -PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; -PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; -PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; -PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; -PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; -PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; -PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; -PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; -PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; -PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; -PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; -PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; - -PFNGLBLENDCOLORPROC __glewBlendColor = NULL; -PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; -PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; -PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; -PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; -PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; -PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; -PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; -PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; -PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; -PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; -PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; -PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; -PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; -PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; -PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; -PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; -PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; -PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; -PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; -PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; -PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; -PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; -PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; -PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; -PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; -PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; -PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; -PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; -PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; -PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; -PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; -PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; -PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; -PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; -PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; -PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; -PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; -PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; -PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; -PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; -PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; -PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; -PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; -PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; -PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; -PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; - -PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; -PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; -PFNGLBUFFERDATAPROC __glewBufferData = NULL; -PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; -PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; -PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; -PFNGLENDQUERYPROC __glewEndQuery = NULL; -PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; -PFNGLGENQUERIESPROC __glewGenQueries = NULL; -PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; -PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; -PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; -PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; -PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; -PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; -PFNGLISBUFFERPROC __glewIsBuffer = NULL; -PFNGLISQUERYPROC __glewIsQuery = NULL; -PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; -PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; - -PFNGLATTACHSHADERPROC __glewAttachShader = NULL; -PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; -PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; -PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; -PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; -PFNGLCREATESHADERPROC __glewCreateShader = NULL; -PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; -PFNGLDELETESHADERPROC __glewDeleteShader = NULL; -PFNGLDETACHSHADERPROC __glewDetachShader = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; -PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; -PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; -PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; -PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; -PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; -PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; -PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; -PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; -PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; -PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; -PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; -PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; -PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; -PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; -PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; -PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; -PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; -PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; -PFNGLISPROGRAMPROC __glewIsProgram = NULL; -PFNGLISSHADERPROC __glewIsShader = NULL; -PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; -PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; -PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; -PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; -PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; -PFNGLUNIFORM1FPROC __glewUniform1f = NULL; -PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; -PFNGLUNIFORM1IPROC __glewUniform1i = NULL; -PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; -PFNGLUNIFORM2FPROC __glewUniform2f = NULL; -PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; -PFNGLUNIFORM2IPROC __glewUniform2i = NULL; -PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; -PFNGLUNIFORM3FPROC __glewUniform3f = NULL; -PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; -PFNGLUNIFORM3IPROC __glewUniform3i = NULL; -PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; -PFNGLUNIFORM4FPROC __glewUniform4f = NULL; -PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; -PFNGLUNIFORM4IPROC __glewUniform4i = NULL; -PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; -PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; -PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; -PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; -PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; -PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; -PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; -PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; -PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; -PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; -PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; -PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; -PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; -PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; -PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; -PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; -PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; -PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; -PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; -PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; -PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; -PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; -PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; -PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; -PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; -PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; -PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; -PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; -PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; -PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; -PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; -PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; -PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; -PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; -PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; -PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; -PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; -PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; -PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; -PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; -PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; -PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; -PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; - -PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; -PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; -PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; -PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; -PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; -PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; - -PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; -PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; -PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; -PFNGLCLAMPCOLORPROC __glewClampColor = NULL; -PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; -PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; -PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; -PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; -PFNGLCOLORMASKIPROC __glewColorMaski = NULL; -PFNGLDISABLEIPROC __glewDisablei = NULL; -PFNGLENABLEIPROC __glewEnablei = NULL; -PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; -PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; -PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; -PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; -PFNGLGETSTRINGIPROC __glewGetStringi = NULL; -PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; -PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; -PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; -PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; -PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; -PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; -PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; -PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; -PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; -PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; -PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; -PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; -PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; -PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; -PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; -PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; -PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; -PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; -PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; -PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; -PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; -PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; -PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; -PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; -PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; -PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; -PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; -PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; -PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; -PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; -PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; -PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; -PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; -PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; -PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; -PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; -PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; - -PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; -PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; -PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; -PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; - -PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; -PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; -PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; - -PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; - -PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; -PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; -PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; -PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; -PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; - -PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; - -PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; -PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; -PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; -PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; - -PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; -PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; -PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; -PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; - -PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; -PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; -PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; - -PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; -PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; -PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; -PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; -PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; -PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; -PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; -PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; -PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; -PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; -PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; - -PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; - -PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; - -PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; -PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; - -PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; -PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; - -PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; -PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; -PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; -PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; -PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; -PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; -PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; -PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; - -PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; - -PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; -PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; -PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; - -PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; -PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; - -PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; -PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; -PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; -PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; - -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; -PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; - -PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; -PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; -PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; -PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; -PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; -PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; -PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; - -PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; -PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; -PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; -PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; -PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; - -PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; - -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; -PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; - -PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; - -PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; -PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; -PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; -PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; - -PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; - -PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; -PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; - -PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; - -PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; - -PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; -PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; -PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; -PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; - -PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; - -PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; -PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; -PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; -PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; - -PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; - -PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; -PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; - -PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; -PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; -PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; - -PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; -PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; -PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; -PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; -PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; -PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; -PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; -PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; -PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; -PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; -PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; -PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; -PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; -PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; -PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; -PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; - -PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; -PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; - -PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; -PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; -PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; - -PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; -PFNGLUNIFORM1DPROC __glewUniform1d = NULL; -PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; -PFNGLUNIFORM2DPROC __glewUniform2d = NULL; -PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; -PFNGLUNIFORM3DPROC __glewUniform3d = NULL; -PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; -PFNGLUNIFORM4DPROC __glewUniform4d = NULL; -PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; -PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; -PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; -PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; -PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; -PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; -PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; -PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; -PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; -PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; - -PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; -PFNGLCOLORTABLEPROC __glewColorTable = NULL; -PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; -PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; -PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; -PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; -PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; -PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; -PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; -PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; -PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; -PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; -PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; -PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; -PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; -PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; -PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; -PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; -PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; -PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; -PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; -PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; -PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; -PFNGLGETMINMAXPROC __glewGetMinmax = NULL; -PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; -PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; -PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; -PFNGLHISTOGRAMPROC __glewHistogram = NULL; -PFNGLMINMAXPROC __glewMinmax = NULL; -PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; -PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; -PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; - -PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; -PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; -PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; - -PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; - -PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; - -PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; -PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; -PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; -PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; -PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; -PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; - -PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; -PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; - -PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; -PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; -PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; -PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; -PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; - -PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; - -PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; -PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; -PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; -PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; -PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; -PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; -PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; -PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; -PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; -PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; -PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; -PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; -PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; -PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; -PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; -PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; -PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; -PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; -PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; -PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; -PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; -PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; -PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; -PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; -PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; -PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; -PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; -PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; -PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; -PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; -PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; -PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; -PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; -PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; - -PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; -PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; -PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; -PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; -PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; -PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; -PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; -PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; - -PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; -PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; - -PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; -PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; -PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; -PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; -PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; -PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; - -PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; - -PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; -PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; -PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; -PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; -PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; -PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; -PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; -PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; -PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; -PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; -PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; -PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; -PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; -PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; -PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; -PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; -PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; -PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; -PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; - -PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; - -PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; -PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; -PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; -PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; -PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; -PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; -PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; -PFNGLISSAMPLERPROC __glewIsSampler = NULL; -PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; -PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; -PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; -PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; -PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; -PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; - -PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; -PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; -PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; -PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; -PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; -PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; -PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; -PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; -PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; -PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; -PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; -PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; -PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; -PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; -PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; -PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; -PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; -PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; -PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; -PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; -PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; -PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; -PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; -PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; -PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; -PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; -PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; -PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; -PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; -PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; -PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; -PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; -PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; -PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; -PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; -PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; -PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; -PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; -PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; -PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; -PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; -PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; - -PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; - -PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; -PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; - -PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; -PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; -PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; -PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; -PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; -PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; -PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; -PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; -PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; -PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; -PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; -PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; -PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; -PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; -PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; -PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; -PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; -PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; -PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; -PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; -PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; -PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; -PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; -PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; -PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; -PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; -PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; -PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; -PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; -PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; -PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; -PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; -PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; -PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; -PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; -PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; -PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; -PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; -PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; - -PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; - -PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; -PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; -PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; -PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; -PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; -PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; -PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; -PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; - -PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; -PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; -PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; -PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; -PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; -PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; - -PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; -PFNGLDELETESYNCPROC __glewDeleteSync = NULL; -PFNGLFENCESYNCPROC __glewFenceSync = NULL; -PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; -PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; -PFNGLISSYNCPROC __glewIsSync = NULL; -PFNGLWAITSYNCPROC __glewWaitSync = NULL; - -PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; -PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; - -PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; - -PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; -PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; - -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; - -PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; -PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; -PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; -PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; - -PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; -PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; -PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; -PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; -PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; -PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; - -PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; -PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; -PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; -PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; - -PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; - -PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; -PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; -PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; - -PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; -PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; -PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; -PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; -PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; -PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; -PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; - -PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; -PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; -PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; - -PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; - -PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; -PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; -PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; -PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; - -PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; -PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; -PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; -PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; -PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; -PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; -PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; -PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; - -PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; -PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; -PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; -PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; - -PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; -PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; -PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; -PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; -PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; -PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; -PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; -PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; -PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; -PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; - -PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; -PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; -PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; -PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; -PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; -PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; - -PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; -PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; -PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; -PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; -PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; -PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; -PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; -PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; -PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; -PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; - -PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; -PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; -PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; -PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; -PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; -PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; -PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; -PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; -PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; -PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; -PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; - -PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; -PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; -PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; -PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; -PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; -PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; -PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; -PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; -PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; -PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; -PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; -PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; -PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; -PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; -PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; -PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; -PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; -PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; -PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; -PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; -PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; -PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; -PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; -PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; -PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; -PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; -PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; -PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; -PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; -PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; -PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; -PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; -PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; -PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; -PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; -PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; -PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; -PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; -PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; -PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; -PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; -PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; -PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; -PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; -PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; -PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; -PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; -PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; -PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; -PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; -PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; - -PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; -PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; -PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; - -PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; -PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; -PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; -PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; -PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; -PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; -PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; -PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; -PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; -PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; -PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; -PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; -PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; -PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; -PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; -PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; -PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; -PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; -PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; -PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; -PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; -PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; -PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; -PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; -PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; -PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; -PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; -PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; -PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; -PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; -PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; -PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; -PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; -PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; -PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; -PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; -PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; -PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; - -PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; -PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; -PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; -PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; -PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; -PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; -PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; -PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; -PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; -PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; - -PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; -PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; -PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; -PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; -PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; -PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; -PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; -PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; -PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; -PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; -PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; -PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; -PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; -PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; -PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; -PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; - -PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; - -PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; -PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; -PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; - -PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; -PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; -PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; -PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; - -PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; -PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; -PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; -PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; -PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; -PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; -PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; -PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; -PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; -PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; -PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; -PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; -PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; - -PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; -PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; - -PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; -PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; - -PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; -PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; - -PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; -PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; -PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; -PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; -PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; -PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; -PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; -PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; -PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; -PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; - -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; - -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; -PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; -PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; -PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; -PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; -PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; -PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; -PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; -PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; -PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; -PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; -PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; -PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; -PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; -PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; -PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; -PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; -PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; -PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; -PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; -PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; -PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; -PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; -PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; -PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; -PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; -PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; -PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; -PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; -PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; -PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; -PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; -PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; -PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; -PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; -PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; -PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; -PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; -PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; -PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; -PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; -PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; -PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; -PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; -PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; - -PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; -PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; -PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; - -PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; - -PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; - -PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; - -PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; - -PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; -PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; - -PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; -PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; - -PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; -PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; -PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; -PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; -PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; -PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; -PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; - -PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; -PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; - -PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; -PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; - -PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; -PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; - -PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; -PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; -PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; - -PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; - -PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; -PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; -PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; -PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; -PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; -PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; -PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; -PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; -PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; -PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; -PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; -PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; -PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; -PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; -PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; -PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; -PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; -PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; -PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; -PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; -PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; -PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; -PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; -PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; -PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; -PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; -PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; -PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; -PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; -PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; -PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; -PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; -PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; -PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; -PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; -PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; -PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; -PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; -PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; -PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; -PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; -PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; -PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; -PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; -PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; -PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; -PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; -PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; -PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; -PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; -PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; -PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; -PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; -PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; -PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; -PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; -PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; -PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; -PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; -PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; -PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; -PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; -PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; -PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; -PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; -PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; -PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; -PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; -PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; -PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; -PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; -PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; -PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; -PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; -PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; -PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; -PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; -PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT = NULL; -PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT = NULL; -PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; -PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; -PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; -PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; -PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; -PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; -PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT = NULL; -PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT = NULL; -PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; -PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; -PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; -PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; -PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; -PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; -PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT = NULL; -PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT = NULL; -PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; -PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; -PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; -PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; -PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; -PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; -PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT = NULL; -PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT = NULL; -PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; -PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; -PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; -PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; -PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; -PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; -PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; -PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; -PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; -PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; -PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; -PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; -PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; -PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; -PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; -PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; -PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; -PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; -PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; -PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; -PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; -PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; -PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; -PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; -PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; -PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; -PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; - -PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; -PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; -PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; -PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; -PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; -PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; - -PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; - -PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; - -PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; -PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; -PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; -PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; -PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; - -PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; -PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; -PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; -PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; -PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; -PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; -PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; -PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; -PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; -PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; -PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; -PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; -PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; -PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; -PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; -PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; -PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; -PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; - -PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; - -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; - -PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; -PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; -PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; -PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; -PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; -PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; -PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; -PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; -PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; -PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; - -PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; -PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; - -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; - -PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; -PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; -PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; -PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; -PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; -PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; -PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; -PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; -PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; -PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; -PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; -PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; -PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; -PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; -PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; -PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; -PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; -PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; -PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; -PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; -PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; -PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; -PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; -PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; -PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; -PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; -PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; -PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; -PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; -PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; -PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; -PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; -PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; -PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; - -PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; -PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; -PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; -PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; -PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; -PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; -PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; -PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; - -PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; - -PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; - -PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; -PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; -PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; - -PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; -PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; - -PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; -PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; - -PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; -PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; - -PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; -PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; - -PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; -PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; - -PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; - -PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; - -PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; -PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; - -PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; -PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; -PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; -PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; -PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; -PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; -PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; -PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; -PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; -PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; -PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; -PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; -PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; -PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; -PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; -PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; -PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; - -PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; -PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; -PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; - -PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; -PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; - -PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; - -PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; -PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; -PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; - -PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; - -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; - -PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; - -PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; -PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; -PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; -PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; -PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; -PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; - -PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; -PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; -PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; -PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; -PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; -PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; - -PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; - -PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; -PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; - -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; -PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; -PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; -PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; -PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; - -PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; -PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; -PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; -PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; -PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; -PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; -PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; -PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; - -PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; -PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; -PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; -PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; -PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; -PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; -PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; -PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; -PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; -PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; - -PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; -PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; -PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; -PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; -PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; -PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; -PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; -PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; -PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; -PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; -PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; -PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; -PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; -PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; -PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; -PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; -PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; -PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; -PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; -PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; -PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; -PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; -PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; -PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; -PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; -PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; -PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; -PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; -PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; -PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; -PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; -PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; -PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; -PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; -PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; -PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; - -PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; -PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; -PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; - -PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; - -PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; - -PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; - -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; - -PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; - -PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; -PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; -PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; -PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; -PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; -PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; -PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; - -PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; -PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; -PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; -PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; - -PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; -PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; - -PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; -PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; -PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; -PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; -PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; -PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; -PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; -PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; -PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; -PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; - -PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; -PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; -PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; -PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; -PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; - -PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; - -PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; -PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; -PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; -PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; -PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; -PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; -PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; -PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; -PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; -PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; -PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; -PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; -PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; -PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; -PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; -PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; -PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; -PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; -PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; -PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; -PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; -PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; -PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; -PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; - -PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; -PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; -PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; -PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; -PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; -PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; -PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; -PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; -PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; -PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; -PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; - -PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; -PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; - -PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; - -PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; -PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; -PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; - -PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; -PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; -PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; -PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; -PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; -PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; -PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; - -PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; -PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; -PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; - -PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; -PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; -PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; -PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; -PFNGLISFENCENVPROC __glewIsFenceNV = NULL; -PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; -PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; - -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; - -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; - -PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; - -PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; -PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; - -PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; -PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; -PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; -PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; -PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; -PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; -PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; -PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; -PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; -PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; -PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; -PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; -PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; -PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; -PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; -PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; -PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; -PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; -PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; -PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; -PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; -PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; -PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; -PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; -PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; -PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; -PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; -PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; -PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; -PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; -PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; -PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; -PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; -PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; - -PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; -PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; -PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; -PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; -PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; -PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; -PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; -PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; -PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; -PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; -PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; -PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; -PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; -PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; -PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; -PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; -PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; -PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; -PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; -PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; -PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; -PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; -PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; -PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; -PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; -PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; -PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; -PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; -PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; -PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; -PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; -PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; -PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; -PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; -PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; -PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; -PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; -PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; -PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; -PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; -PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; -PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; -PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; -PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; -PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; -PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; - -PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; -PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; -PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; -PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; -PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; -PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; -PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; - -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; - -PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; -PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; -PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; -PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; -PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; -PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; -PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; -PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; -PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; -PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; -PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; -PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; -PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; -PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; -PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; -PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; -PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; -PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; -PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; -PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; -PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; -PFNGLISPATHNVPROC __glewIsPathNV = NULL; -PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; -PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; -PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; -PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; -PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; -PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; -PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; -PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; -PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; -PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; -PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; -PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; -PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; -PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; -PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; -PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; -PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; -PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; -PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; -PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; -PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; -PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; -PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; -PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; -PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; -PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; -PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; - -PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; -PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; - -PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; -PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; - -PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; -PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; -PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; -PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; -PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; -PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; - -PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; -PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; - -PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; -PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; -PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; -PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; -PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; -PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; -PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; - -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; - -PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; -PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; -PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; -PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; -PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; -PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; -PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; -PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; -PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; -PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; -PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; -PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; -PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; - -PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; - -PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; -PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; -PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; - -PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; -PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; -PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; -PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; -PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; -PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; -PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; -PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; - -PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; -PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; -PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; -PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; -PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; -PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; -PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; - -PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; -PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; -PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; -PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; -PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; -PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; -PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; -PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; -PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; -PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; - -PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; -PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; - -PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; -PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; -PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; -PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; -PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; -PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; -PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; -PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; -PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; -PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; -PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; -PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; -PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; -PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; -PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; -PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; -PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; -PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; -PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; - -PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; -PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; -PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; -PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; -PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; -PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; -PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; -PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; -PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; -PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; -PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; -PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; - -PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; -PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; -PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; -PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; -PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; -PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; -PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; -PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; -PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; -PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; -PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; -PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; -PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; -PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; -PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; -PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; -PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; -PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; -PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; -PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; -PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; -PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; -PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; -PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; -PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; -PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; -PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; -PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; -PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; -PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; -PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; -PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; -PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; -PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; -PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; -PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; -PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; -PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; -PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; -PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; -PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; -PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; -PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; -PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; -PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; -PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; -PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; -PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; -PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; -PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; -PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; -PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; -PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; -PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; -PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; -PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; -PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; -PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; -PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; -PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; -PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; -PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; - -PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; -PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; -PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; -PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; -PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; -PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; - -PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; -PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; -PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; -PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; -PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; -PFNGLORTHOFOESPROC __glewOrthofOES = NULL; - -PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; - -PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; -PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; - -PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; -PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; - -PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; -PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; - -PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; -PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; - -PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; -PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; - -PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; -PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; - -PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; -PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; - -PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; -PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; -PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; -PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; -PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; -PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; - -PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; - -PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; - -PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; -PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; -PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; -PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; -PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; -PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; -PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; -PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; -PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; - -PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; - -PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; - -PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; - -PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; -PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; -PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; -PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; - -PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; - -PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; -PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; -PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; -PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; -PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; - -PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; - -PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; -PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; -PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; -PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; -PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; -PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; -PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; -PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; - -PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; - -PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; -PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; -PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; -PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; -PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; -PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; -PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; - -PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; -PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; -PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; -PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; -PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; -PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; -PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; -PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; -PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; - -PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; - -#endif /* !WIN32 || !GLEW_MX */ - -#if !defined(GLEW_MX) - -GLboolean __GLEW_VERSION_1_1 = GL_FALSE; -GLboolean __GLEW_VERSION_1_2 = GL_FALSE; -GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; -GLboolean __GLEW_VERSION_1_3 = GL_FALSE; -GLboolean __GLEW_VERSION_1_4 = GL_FALSE; -GLboolean __GLEW_VERSION_1_5 = GL_FALSE; -GLboolean __GLEW_VERSION_2_0 = GL_FALSE; -GLboolean __GLEW_VERSION_2_1 = GL_FALSE; -GLboolean __GLEW_VERSION_3_0 = GL_FALSE; -GLboolean __GLEW_VERSION_3_1 = GL_FALSE; -GLboolean __GLEW_VERSION_3_2 = GL_FALSE; -GLboolean __GLEW_VERSION_3_3 = GL_FALSE; -GLboolean __GLEW_VERSION_4_0 = GL_FALSE; -GLboolean __GLEW_VERSION_4_1 = GL_FALSE; -GLboolean __GLEW_VERSION_4_2 = GL_FALSE; -GLboolean __GLEW_VERSION_4_3 = GL_FALSE; -GLboolean __GLEW_3DFX_multisample = GL_FALSE; -GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; -GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; -GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; -GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; -GLboolean __GLEW_AMD_debug_output = GL_FALSE; -GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; -GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; -GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; -GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; -GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; -GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; -GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; -GLboolean __GLEW_AMD_sample_positions = GL_FALSE; -GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; -GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; -GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; -GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; -GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; -GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; -GLboolean __GLEW_APPLE_client_storage = GL_FALSE; -GLboolean __GLEW_APPLE_element_array = GL_FALSE; -GLboolean __GLEW_APPLE_fence = GL_FALSE; -GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; -GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; -GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; -GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; -GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; -GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; -GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; -GLboolean __GLEW_APPLE_texture_range = GL_FALSE; -GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; -GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; -GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; -GLboolean __GLEW_ARB_base_instance = GL_FALSE; -GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; -GLboolean __GLEW_ARB_cl_event = GL_FALSE; -GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; -GLboolean __GLEW_ARB_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; -GLboolean __GLEW_ARB_compute_shader = GL_FALSE; -GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; -GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; -GLboolean __GLEW_ARB_copy_image = GL_FALSE; -GLboolean __GLEW_ARB_debug_output = GL_FALSE; -GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; -GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; -GLboolean __GLEW_ARB_depth_texture = GL_FALSE; -GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; -GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; -GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; -GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; -GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; -GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; -GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; -GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; -GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; -GLboolean __GLEW_ARB_fragment_program = GL_FALSE; -GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; -GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; -GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; -GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; -GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; -GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; -GLboolean __GLEW_ARB_imaging = GL_FALSE; -GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; -GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; -GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; -GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; -GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; -GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; -GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; -GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; -GLboolean __GLEW_ARB_multisample = GL_FALSE; -GLboolean __GLEW_ARB_multitexture = GL_FALSE; -GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; -GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; -GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_point_parameters = GL_FALSE; -GLboolean __GLEW_ARB_point_sprite = GL_FALSE; -GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; -GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; -GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; -GLboolean __GLEW_ARB_robustness = GL_FALSE; -GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; -GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; -GLboolean __GLEW_ARB_sample_shading = GL_FALSE; -GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; -GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; -GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; -GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; -GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; -GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; -GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; -GLboolean __GLEW_ARB_shader_objects = GL_FALSE; -GLboolean __GLEW_ARB_shader_precision = GL_FALSE; -GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; -GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; -GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; -GLboolean __GLEW_ARB_shadow = GL_FALSE; -GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; -GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; -GLboolean __GLEW_ARB_sync = GL_FALSE; -GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; -GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; -GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; -GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; -GLboolean __GLEW_ARB_texture_float = GL_FALSE; -GLboolean __GLEW_ARB_texture_gather = GL_FALSE; -GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; -GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; -GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; -GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; -GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; -GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; -GLboolean __GLEW_ARB_texture_rg = GL_FALSE; -GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; -GLboolean __GLEW_ARB_texture_storage = GL_FALSE; -GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; -GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; -GLboolean __GLEW_ARB_texture_view = GL_FALSE; -GLboolean __GLEW_ARB_timer_query = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; -GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; -GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; -GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; -GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; -GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; -GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_program = GL_FALSE; -GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; -GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; -GLboolean __GLEW_ARB_viewport_array = GL_FALSE; -GLboolean __GLEW_ARB_window_pos = GL_FALSE; -GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; -GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; -GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; -GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; -GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; -GLboolean __GLEW_ATI_element_array = GL_FALSE; -GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; -GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; -GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; -GLboolean __GLEW_ATI_meminfo = GL_FALSE; -GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; -GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; -GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; -GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; -GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; -GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; -GLboolean __GLEW_ATI_texture_float = GL_FALSE; -GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; -GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; -GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; -GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; -GLboolean __GLEW_EXT_422_pixels = GL_FALSE; -GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; -GLboolean __GLEW_EXT_abgr = GL_FALSE; -GLboolean __GLEW_EXT_bgra = GL_FALSE; -GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; -GLboolean __GLEW_EXT_blend_color = GL_FALSE; -GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; -GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; -GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; -GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; -GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; -GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; -GLboolean __GLEW_EXT_cmyka = GL_FALSE; -GLboolean __GLEW_EXT_color_subtable = GL_FALSE; -GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; -GLboolean __GLEW_EXT_convolution = GL_FALSE; -GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; -GLboolean __GLEW_EXT_copy_texture = GL_FALSE; -GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; -GLboolean __GLEW_EXT_debug_marker = GL_FALSE; -GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; -GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; -GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; -GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; -GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; -GLboolean __GLEW_EXT_fog_coord = GL_FALSE; -GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; -GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; -GLboolean __GLEW_EXT_histogram = GL_FALSE; -GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; -GLboolean __GLEW_EXT_index_func = GL_FALSE; -GLboolean __GLEW_EXT_index_material = GL_FALSE; -GLboolean __GLEW_EXT_index_texture = GL_FALSE; -GLboolean __GLEW_EXT_light_texture = GL_FALSE; -GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; -GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; -GLboolean __GLEW_EXT_multisample = GL_FALSE; -GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; -GLboolean __GLEW_EXT_packed_float = GL_FALSE; -GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; -GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; -GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; -GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; -GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; -GLboolean __GLEW_EXT_point_parameters = GL_FALSE; -GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; -GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; -GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; -GLboolean __GLEW_EXT_scene_marker = GL_FALSE; -GLboolean __GLEW_EXT_secondary_color = GL_FALSE; -GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; -GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; -GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; -GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; -GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; -GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; -GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; -GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; -GLboolean __GLEW_EXT_subtexture = GL_FALSE; -GLboolean __GLEW_EXT_texture = GL_FALSE; -GLboolean __GLEW_EXT_texture3D = GL_FALSE; -GLboolean __GLEW_EXT_texture_array = GL_FALSE; -GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; -GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; -GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; -GLboolean __GLEW_EXT_texture_env = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; -GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; -GLboolean __GLEW_EXT_texture_integer = GL_FALSE; -GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; -GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; -GLboolean __GLEW_EXT_texture_object = GL_FALSE; -GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; -GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; -GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; -GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; -GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; -GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; -GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; -GLboolean __GLEW_EXT_timer_query = GL_FALSE; -GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; -GLboolean __GLEW_EXT_vertex_array = GL_FALSE; -GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; -GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; -GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; -GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; -GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; -GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; -GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; -GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; -GLboolean __GLEW_HP_image_transform = GL_FALSE; -GLboolean __GLEW_HP_occlusion_test = GL_FALSE; -GLboolean __GLEW_HP_texture_lighting = GL_FALSE; -GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; -GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; -GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; -GLboolean __GLEW_IBM_static_data = GL_FALSE; -GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; -GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; -GLboolean __GLEW_INGR_color_clamp = GL_FALSE; -GLboolean __GLEW_INGR_interlace_read = GL_FALSE; -GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; -GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; -GLboolean __GLEW_KHR_debug = GL_FALSE; -GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; -GLboolean __GLEW_KTX_buffer_region = GL_FALSE; -GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; -GLboolean __GLEW_MESA_pack_invert = GL_FALSE; -GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; -GLboolean __GLEW_MESA_window_pos = GL_FALSE; -GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; -GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; -GLboolean __GLEW_NV_bindless_texture = GL_FALSE; -GLboolean __GLEW_NV_blend_square = GL_FALSE; -GLboolean __GLEW_NV_conditional_render = GL_FALSE; -GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; -GLboolean __GLEW_NV_copy_image = GL_FALSE; -GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; -GLboolean __GLEW_NV_depth_clamp = GL_FALSE; -GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; -GLboolean __GLEW_NV_evaluators = GL_FALSE; -GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; -GLboolean __GLEW_NV_fence = GL_FALSE; -GLboolean __GLEW_NV_float_buffer = GL_FALSE; -GLboolean __GLEW_NV_fog_distance = GL_FALSE; -GLboolean __GLEW_NV_fragment_program = GL_FALSE; -GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; -GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; -GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; -GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; -GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; -GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; -GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; -GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; -GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; -GLboolean __GLEW_NV_half_float = GL_FALSE; -GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; -GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; -GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; -GLboolean __GLEW_NV_occlusion_query = GL_FALSE; -GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; -GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; -GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; -GLboolean __GLEW_NV_path_rendering = GL_FALSE; -GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; -GLboolean __GLEW_NV_point_sprite = GL_FALSE; -GLboolean __GLEW_NV_present_video = GL_FALSE; -GLboolean __GLEW_NV_primitive_restart = GL_FALSE; -GLboolean __GLEW_NV_register_combiners = GL_FALSE; -GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; -GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; -GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; -GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; -GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; -GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; -GLboolean __GLEW_NV_texture_barrier = GL_FALSE; -GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; -GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; -GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; -GLboolean __GLEW_NV_texture_multisample = GL_FALSE; -GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; -GLboolean __GLEW_NV_texture_shader = GL_FALSE; -GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; -GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; -GLboolean __GLEW_NV_transform_feedback = GL_FALSE; -GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; -GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; -GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; -GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; -GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; -GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; -GLboolean __GLEW_NV_vertex_program = GL_FALSE; -GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; -GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; -GLboolean __GLEW_NV_video_capture = GL_FALSE; -GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; -GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; -GLboolean __GLEW_OES_read_format = GL_FALSE; -GLboolean __GLEW_OES_single_precision = GL_FALSE; -GLboolean __GLEW_OML_interlace = GL_FALSE; -GLboolean __GLEW_OML_resample = GL_FALSE; -GLboolean __GLEW_OML_subsample = GL_FALSE; -GLboolean __GLEW_PGI_misc_hints = GL_FALSE; -GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; -GLboolean __GLEW_REGAL_error_string = GL_FALSE; -GLboolean __GLEW_REGAL_extension_query = GL_FALSE; -GLboolean __GLEW_REGAL_log = GL_FALSE; -GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; -GLboolean __GLEW_S3_s3tc = GL_FALSE; -GLboolean __GLEW_SGIS_color_range = GL_FALSE; -GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; -GLboolean __GLEW_SGIS_fog_function = GL_FALSE; -GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; -GLboolean __GLEW_SGIS_multisample = GL_FALSE; -GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; -GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; -GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; -GLboolean __GLEW_SGIS_texture4D = GL_FALSE; -GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; -GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; -GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; -GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; -GLboolean __GLEW_SGIS_texture_select = GL_FALSE; -GLboolean __GLEW_SGIX_async = GL_FALSE; -GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; -GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; -GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; -GLboolean __GLEW_SGIX_clipmap = GL_FALSE; -GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; -GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; -GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; -GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; -GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; -GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; -GLboolean __GLEW_SGIX_framezoom = GL_FALSE; -GLboolean __GLEW_SGIX_interlace = GL_FALSE; -GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; -GLboolean __GLEW_SGIX_list_priority = GL_FALSE; -GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; -GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; -GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; -GLboolean __GLEW_SGIX_resample = GL_FALSE; -GLboolean __GLEW_SGIX_shadow = GL_FALSE; -GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; -GLboolean __GLEW_SGIX_sprite = GL_FALSE; -GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; -GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; -GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; -GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; -GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; -GLboolean __GLEW_SGIX_texture_range = GL_FALSE; -GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; -GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; -GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; -GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; -GLboolean __GLEW_SGI_color_matrix = GL_FALSE; -GLboolean __GLEW_SGI_color_table = GL_FALSE; -GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; -GLboolean __GLEW_SUNX_constant_data = GL_FALSE; -GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; -GLboolean __GLEW_SUN_global_alpha = GL_FALSE; -GLboolean __GLEW_SUN_mesh_array = GL_FALSE; -GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; -GLboolean __GLEW_SUN_slice_accum = GL_FALSE; -GLboolean __GLEW_SUN_triangle_list = GL_FALSE; -GLboolean __GLEW_SUN_vertex = GL_FALSE; -GLboolean __GLEW_WIN_phong_shading = GL_FALSE; -GLboolean __GLEW_WIN_specular_fog = GL_FALSE; -GLboolean __GLEW_WIN_swap_hint = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef GL_VERSION_1_2 - -static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; - r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; - r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; - r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_2 */ - -#ifdef GL_VERSION_1_2_1 - -#endif /* GL_VERSION_1_2_1 */ - -#ifdef GL_VERSION_1_3 - -static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; - r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; - r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; - r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; - r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; - r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; - r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; - r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; - r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; - r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; - r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; - r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; - r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; - r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; - r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; - r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; - r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; - r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; - r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; - r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; - r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; - r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; - r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; - r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; - r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; - r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; - r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; - r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; - r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; - r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; - r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; - r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; - r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; - r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; - r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; - r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; - r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; - r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; - r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; - r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; - r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; - r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; - r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; - r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; - r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; - r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_3 */ - -#ifdef GL_VERSION_1_4 - -static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; - r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; - r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; - r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; - r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; - r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; - r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; - r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; - r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; - r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; - r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; - r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; - r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; - r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; - r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; - r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; - r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; - r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; - r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; - r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; - r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; - r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; - r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; - r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; - r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; - r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; - r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; - r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; - r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; - r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; - r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; - r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; - r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; - r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; - r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; - r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; - r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; - r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; - r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; - r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; - r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; - r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; - r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; - r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; - r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; - r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; - r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_4 */ - -#ifdef GL_VERSION_1_5 - -static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; - r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; - r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; - r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; - r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; - r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; - r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; - r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; - r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; - r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; - r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; - r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; - r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; - r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; - r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; - r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; - r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; - r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; - r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_5 */ - -#ifdef GL_VERSION_2_0 - -static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; - r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; - r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; - r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; - r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; - r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; - r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; - r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; - r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; - r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; - r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; - r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; - r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; - r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; - r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; - r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; - r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; - r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; - r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; - r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; - r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; - r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; - r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; - r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; - r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; - r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; - r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; - r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; - r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; - r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; - r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; - r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; - r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; - r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; - r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; - r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; - r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; - r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; - r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; - r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; - r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; - r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; - r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; - r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; - r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; - r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; - r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; - r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; - r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; - r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; - r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; - r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; - r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; - r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; - r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; - r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; - r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; - r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; - r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; - r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; - r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; - r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; - r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; - r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; - r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; - r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; - r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; - r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; - r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; - r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; - r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; - r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; - r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; - r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; - r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; - r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; - r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; - r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; - r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; - r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; - r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; - r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; - r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; - r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; - r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; - r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; - r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; - r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; - r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; - r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; - r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; - r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; - r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_2_0 */ - -#ifdef GL_VERSION_2_1 - -static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; - r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; - r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; - r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; - r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; - r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_2_1 */ - -#ifdef GL_VERSION_3_0 - -static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; - r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; - r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; - r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; - r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; - r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; - r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; - r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; - r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; - r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; - r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; - r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; - r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; - r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; - r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; - r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; - r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; - r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; - r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; - r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; - r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; - r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; - r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; - r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; - r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; - r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; - r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; - r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; - r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; - r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; - r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; - r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; - r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; - r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; - r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; - r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; - r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; - r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; - r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; - r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; - r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; - r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; - r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; - r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; - r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; - r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; - r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; - r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; - r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; - r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; - r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; - r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; - r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; - r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; - r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_0 */ - -#ifdef GL_VERSION_3_1 - -static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; - r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; - r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; - r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_1 */ - -#ifdef GL_VERSION_3_2 - -static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; - r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; - r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_2 */ - -#ifdef GL_VERSION_3_3 - -static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_3 */ - -#ifdef GL_VERSION_4_0 - -static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; - r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; - r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; - r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; - r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_4_0 */ - -#ifdef GL_VERSION_4_1 - -#endif /* GL_VERSION_4_1 */ - -#ifdef GL_VERSION_4_2 - -#endif /* GL_VERSION_4_2 */ - -#ifdef GL_VERSION_4_3 - -#endif /* GL_VERSION_4_3 */ - -#ifdef GL_3DFX_multisample - -#endif /* GL_3DFX_multisample */ - -#ifdef GL_3DFX_tbuffer - -static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; - - return r; -} - -#endif /* GL_3DFX_tbuffer */ - -#ifdef GL_3DFX_texture_compression_FXT1 - -#endif /* GL_3DFX_texture_compression_FXT1 */ - -#ifdef GL_AMD_blend_minmax_factor - -#endif /* GL_AMD_blend_minmax_factor */ - -#ifdef GL_AMD_conservative_depth - -#endif /* GL_AMD_conservative_depth */ - -#ifdef GL_AMD_debug_output - -static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; - r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; - r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; - r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_debug_output */ - -#ifdef GL_AMD_depth_clamp_separate - -#endif /* GL_AMD_depth_clamp_separate */ - -#ifdef GL_AMD_draw_buffers_blend - -static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; - r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; - r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; - r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_draw_buffers_blend */ - -#ifdef GL_AMD_multi_draw_indirect - -static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; - r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_multi_draw_indirect */ - -#ifdef GL_AMD_name_gen_delete - -static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; - r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; - r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_name_gen_delete */ - -#ifdef GL_AMD_performance_monitor - -static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; - r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; - r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; - r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; - r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; - r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; - r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; - r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_performance_monitor */ - -#ifdef GL_AMD_pinned_memory - -#endif /* GL_AMD_pinned_memory */ - -#ifdef GL_AMD_query_buffer_object - -#endif /* GL_AMD_query_buffer_object */ - -#ifdef GL_AMD_sample_positions - -static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_sample_positions */ - -#ifdef GL_AMD_seamless_cubemap_per_texture - -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -#ifdef GL_AMD_shader_stencil_export - -#endif /* GL_AMD_shader_stencil_export */ - -#ifdef GL_AMD_stencil_operation_extended - -static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_stencil_operation_extended */ - -#ifdef GL_AMD_texture_texture4 - -#endif /* GL_AMD_texture_texture4 */ - -#ifdef GL_AMD_transform_feedback3_lines_triangles - -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -#ifdef GL_AMD_vertex_shader_layer - -#endif /* GL_AMD_vertex_shader_layer */ - -#ifdef GL_AMD_vertex_shader_tessellator - -static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; - r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_vertex_shader_tessellator */ - -#ifdef GL_AMD_vertex_shader_viewport_index - -#endif /* GL_AMD_vertex_shader_viewport_index */ - -#ifdef GL_APPLE_aux_depth_stencil - -#endif /* GL_APPLE_aux_depth_stencil */ - -#ifdef GL_APPLE_client_storage - -#endif /* GL_APPLE_client_storage */ - -#ifdef GL_APPLE_element_array - -static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; - r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; - r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; - r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; - r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_element_array */ - -#ifdef GL_APPLE_fence - -static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; - r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; - r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; - r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; - r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; - r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; - r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; - r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_fence */ - -#ifdef GL_APPLE_float_pixels - -#endif /* GL_APPLE_float_pixels */ - -#ifdef GL_APPLE_flush_buffer_range - -static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; - r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_flush_buffer_range */ - -#ifdef GL_APPLE_object_purgeable - -static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; - r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; - r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_object_purgeable */ - -#ifdef GL_APPLE_pixel_buffer - -#endif /* GL_APPLE_pixel_buffer */ - -#ifdef GL_APPLE_rgb_422 - -#endif /* GL_APPLE_rgb_422 */ - -#ifdef GL_APPLE_row_bytes - -#endif /* GL_APPLE_row_bytes */ - -#ifdef GL_APPLE_specular_vector - -#endif /* GL_APPLE_specular_vector */ - -#ifdef GL_APPLE_texture_range - -static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; - r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_texture_range */ - -#ifdef GL_APPLE_transform_hint - -#endif /* GL_APPLE_transform_hint */ - -#ifdef GL_APPLE_vertex_array_object - -static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; - r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; - r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; - r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_array_object */ - -#ifdef GL_APPLE_vertex_array_range - -static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; - r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; - r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_array_range */ - -#ifdef GL_APPLE_vertex_program_evaluators - -static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; - r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; - r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_program_evaluators */ - -#ifdef GL_APPLE_ycbcr_422 - -#endif /* GL_APPLE_ycbcr_422 */ - -#ifdef GL_ARB_ES2_compatibility - -static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; - r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; - r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; - r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; - r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_ES2_compatibility */ - -#ifdef GL_ARB_ES3_compatibility - -#endif /* GL_ARB_ES3_compatibility */ - -#ifdef GL_ARB_arrays_of_arrays - -#endif /* GL_ARB_arrays_of_arrays */ - -#ifdef GL_ARB_base_instance - -static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; - r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; - r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_base_instance */ - -#ifdef GL_ARB_blend_func_extended - -static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; - r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_blend_func_extended */ - -#ifdef GL_ARB_cl_event - -static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_cl_event */ - -#ifdef GL_ARB_clear_buffer_object - -static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; - r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; - r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; - r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_clear_buffer_object */ - -#ifdef GL_ARB_color_buffer_float - -static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_color_buffer_float */ - -#ifdef GL_ARB_compatibility - -#endif /* GL_ARB_compatibility */ - -#ifdef GL_ARB_compressed_texture_pixel_storage - -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -#ifdef GL_ARB_compute_shader - -static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; - r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_compute_shader */ - -#ifdef GL_ARB_conservative_depth - -#endif /* GL_ARB_conservative_depth */ - -#ifdef GL_ARB_copy_buffer - -static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_copy_buffer */ - -#ifdef GL_ARB_copy_image - -static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_copy_image */ - -#ifdef GL_ARB_debug_output - -static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; - r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; - r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; - r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_debug_output */ - -#ifdef GL_ARB_depth_buffer_float - -#endif /* GL_ARB_depth_buffer_float */ - -#ifdef GL_ARB_depth_clamp - -#endif /* GL_ARB_depth_clamp */ - -#ifdef GL_ARB_depth_texture - -#endif /* GL_ARB_depth_texture */ - -#ifdef GL_ARB_draw_buffers - -static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_buffers */ - -#ifdef GL_ARB_draw_buffers_blend - -static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; - r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; - r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; - r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_buffers_blend */ - -#ifdef GL_ARB_draw_elements_base_vertex - -static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; - r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; - r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; - r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_elements_base_vertex */ - -#ifdef GL_ARB_draw_indirect - -static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; - r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_indirect */ - -#ifdef GL_ARB_draw_instanced - -#endif /* GL_ARB_draw_instanced */ - -#ifdef GL_ARB_explicit_attrib_location - -#endif /* GL_ARB_explicit_attrib_location */ - -#ifdef GL_ARB_explicit_uniform_location - -#endif /* GL_ARB_explicit_uniform_location */ - -#ifdef GL_ARB_fragment_coord_conventions - -#endif /* GL_ARB_fragment_coord_conventions */ - -#ifdef GL_ARB_fragment_layer_viewport - -#endif /* GL_ARB_fragment_layer_viewport */ - -#ifdef GL_ARB_fragment_program - -#endif /* GL_ARB_fragment_program */ - -#ifdef GL_ARB_fragment_program_shadow - -#endif /* GL_ARB_fragment_program_shadow */ - -#ifdef GL_ARB_fragment_shader - -#endif /* GL_ARB_fragment_shader */ - -#ifdef GL_ARB_framebuffer_no_attachments - -static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; - r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; - r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; - r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_framebuffer_no_attachments */ - -#ifdef GL_ARB_framebuffer_object - -static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; - r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; - r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; - r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; - r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; - r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; - r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; - r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; - r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; - r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; - r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; - r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; - r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; - r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; - r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; - r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; - r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; - r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; - r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; - r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_framebuffer_object */ - -#ifdef GL_ARB_framebuffer_sRGB - -#endif /* GL_ARB_framebuffer_sRGB */ - -#ifdef GL_ARB_geometry_shader4 - -static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; - r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; - r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; - r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_geometry_shader4 */ - -#ifdef GL_ARB_get_program_binary - -static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; - r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; - r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_get_program_binary */ - -#ifdef GL_ARB_gpu_shader5 - -#endif /* GL_ARB_gpu_shader5 */ - -#ifdef GL_ARB_gpu_shader_fp64 - -static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; - r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; - r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; - r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; - r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; - r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; - r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; - r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; - r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; - r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; - r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; - r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; - r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; - r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; - r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; - r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; - r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; - r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_gpu_shader_fp64 */ - -#ifdef GL_ARB_half_float_pixel - -#endif /* GL_ARB_half_float_pixel */ - -#ifdef GL_ARB_half_float_vertex - -#endif /* GL_ARB_half_float_vertex */ - -#ifdef GL_ARB_imaging - -static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; - r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; - r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; - r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; - r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; - r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; - r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; - r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; - r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; - r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; - r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; - r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; - r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; - r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; - r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; - r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; - r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; - r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; - r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; - r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; - r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; - r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; - r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; - r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; - r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; - r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; - r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; - r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; - r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; - r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; - r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; - r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; - r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_imaging */ - -#ifdef GL_ARB_instanced_arrays - -static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; - r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; - r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_instanced_arrays */ - -#ifdef GL_ARB_internalformat_query - -static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_internalformat_query */ - -#ifdef GL_ARB_internalformat_query2 - -static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_internalformat_query2 */ - -#ifdef GL_ARB_invalidate_subdata - -static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; - r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; - r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; - r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; - r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; - r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_invalidate_subdata */ - -#ifdef GL_ARB_map_buffer_alignment - -#endif /* GL_ARB_map_buffer_alignment */ - -#ifdef GL_ARB_map_buffer_range - -static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; - r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_map_buffer_range */ - -#ifdef GL_ARB_matrix_palette - -static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; - r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; - r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; - r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; - r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_matrix_palette */ - -#ifdef GL_ARB_multi_draw_indirect - -static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; - r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multi_draw_indirect */ - -#ifdef GL_ARB_multisample - -static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multisample */ - -#ifdef GL_ARB_multitexture - -static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; - r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; - r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; - r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; - r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; - r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; - r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; - r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; - r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; - r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; - r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; - r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; - r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; - r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; - r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; - r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; - r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; - r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; - r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; - r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; - r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; - r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; - r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; - r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; - r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; - r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; - r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; - r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; - r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; - r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; - r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; - r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; - r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; - r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multitexture */ - -#ifdef GL_ARB_occlusion_query - -static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; - r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; - r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; - r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; - r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; - r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; - r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; - r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_occlusion_query */ - -#ifdef GL_ARB_occlusion_query2 - -#endif /* GL_ARB_occlusion_query2 */ - -#ifdef GL_ARB_pixel_buffer_object - -#endif /* GL_ARB_pixel_buffer_object */ - -#ifdef GL_ARB_point_parameters - -static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; - r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_point_parameters */ - -#ifdef GL_ARB_point_sprite - -#endif /* GL_ARB_point_sprite */ - -#ifdef GL_ARB_program_interface_query - -static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; - r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; - r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; - r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; - r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; - r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_program_interface_query */ - -#ifdef GL_ARB_provoking_vertex - -static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_provoking_vertex */ - -#ifdef GL_ARB_robust_buffer_access_behavior - -#endif /* GL_ARB_robust_buffer_access_behavior */ - -#ifdef GL_ARB_robustness - -static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; - r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; - r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; - r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; - r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; - r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; - r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; - r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; - r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; - r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; - r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; - r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; - r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; - r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; - r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; - r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; - r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; - r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; - r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; - r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_robustness */ - -#ifdef GL_ARB_robustness_application_isolation - -#endif /* GL_ARB_robustness_application_isolation */ - -#ifdef GL_ARB_robustness_share_group_isolation - -#endif /* GL_ARB_robustness_share_group_isolation */ - -#ifdef GL_ARB_sample_shading - -static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sample_shading */ - -#ifdef GL_ARB_sampler_objects - -static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; - r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; - r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; - r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; - r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; - r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; - r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; - r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; - r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; - r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; - r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; - r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; - r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; - r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sampler_objects */ - -#ifdef GL_ARB_seamless_cube_map - -#endif /* GL_ARB_seamless_cube_map */ - -#ifdef GL_ARB_separate_shader_objects - -static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; - r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; - r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; - r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; - r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; - r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; - r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; - r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; - r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; - r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; - r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; - r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; - r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; - r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; - r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; - r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; - r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; - r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; - r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; - r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; - r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; - r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; - r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; - r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; - r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; - r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; - r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; - r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; - r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; - r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; - r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; - r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; - r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; - r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; - r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; - r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; - r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; - r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; - r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; - r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; - r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; - r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; - r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; - r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; - r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; - r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; - r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; - r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; - r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; - r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; - r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; - r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; - r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; - r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; - r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; - r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; - r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; - r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; - r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; - r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_separate_shader_objects */ - -#ifdef GL_ARB_shader_atomic_counters - -static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_atomic_counters */ - -#ifdef GL_ARB_shader_bit_encoding - -#endif /* GL_ARB_shader_bit_encoding */ - -#ifdef GL_ARB_shader_image_load_store - -static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; - r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_image_load_store */ - -#ifdef GL_ARB_shader_image_size - -#endif /* GL_ARB_shader_image_size */ - -#ifdef GL_ARB_shader_objects - -static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; - r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; - r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; - r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; - r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; - r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; - r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; - r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; - r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; - r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; - r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; - r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; - r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; - r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; - r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; - r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; - r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; - r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; - r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; - r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; - r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; - r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; - r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; - r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; - r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; - r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; - r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; - r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; - r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; - r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; - r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; - r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; - r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; - r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; - r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; - r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; - r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; - r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; - r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_objects */ - -#ifdef GL_ARB_shader_precision - -#endif /* GL_ARB_shader_precision */ - -#ifdef GL_ARB_shader_stencil_export - -#endif /* GL_ARB_shader_stencil_export */ - -#ifdef GL_ARB_shader_storage_buffer_object - -static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_storage_buffer_object */ - -#ifdef GL_ARB_shader_subroutine - -static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; - r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; - r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; - r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; - r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; - r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; - r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; - r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_subroutine */ - -#ifdef GL_ARB_shader_texture_lod - -#endif /* GL_ARB_shader_texture_lod */ - -#ifdef GL_ARB_shading_language_100 - -#endif /* GL_ARB_shading_language_100 */ - -#ifdef GL_ARB_shading_language_420pack - -#endif /* GL_ARB_shading_language_420pack */ - -#ifdef GL_ARB_shading_language_include - -static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; - r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; - r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; - r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; - r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; - r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shading_language_include */ - -#ifdef GL_ARB_shading_language_packing - -#endif /* GL_ARB_shading_language_packing */ - -#ifdef GL_ARB_shadow - -#endif /* GL_ARB_shadow */ - -#ifdef GL_ARB_shadow_ambient - -#endif /* GL_ARB_shadow_ambient */ - -#ifdef GL_ARB_stencil_texturing - -#endif /* GL_ARB_stencil_texturing */ - -#ifdef GL_ARB_sync - -static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; - r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; - r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; - r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; - r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; - r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; - r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sync */ - -#ifdef GL_ARB_tessellation_shader - -static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; - r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_tessellation_shader */ - -#ifdef GL_ARB_texture_border_clamp - -#endif /* GL_ARB_texture_border_clamp */ - -#ifdef GL_ARB_texture_buffer_object - -static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_buffer_object */ - -#ifdef GL_ARB_texture_buffer_object_rgb32 - -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -#ifdef GL_ARB_texture_buffer_range - -static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; - r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_buffer_range */ - -#ifdef GL_ARB_texture_compression - -static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; - r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; - r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; - r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; - r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; - r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; - r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_compression */ - -#ifdef GL_ARB_texture_compression_bptc - -#endif /* GL_ARB_texture_compression_bptc */ - -#ifdef GL_ARB_texture_compression_rgtc - -#endif /* GL_ARB_texture_compression_rgtc */ - -#ifdef GL_ARB_texture_cube_map - -#endif /* GL_ARB_texture_cube_map */ - -#ifdef GL_ARB_texture_cube_map_array - -#endif /* GL_ARB_texture_cube_map_array */ - -#ifdef GL_ARB_texture_env_add - -#endif /* GL_ARB_texture_env_add */ - -#ifdef GL_ARB_texture_env_combine - -#endif /* GL_ARB_texture_env_combine */ - -#ifdef GL_ARB_texture_env_crossbar - -#endif /* GL_ARB_texture_env_crossbar */ - -#ifdef GL_ARB_texture_env_dot3 - -#endif /* GL_ARB_texture_env_dot3 */ - -#ifdef GL_ARB_texture_float - -#endif /* GL_ARB_texture_float */ - -#ifdef GL_ARB_texture_gather - -#endif /* GL_ARB_texture_gather */ - -#ifdef GL_ARB_texture_mirrored_repeat - -#endif /* GL_ARB_texture_mirrored_repeat */ - -#ifdef GL_ARB_texture_multisample - -static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; - r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; - r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; - r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_multisample */ - -#ifdef GL_ARB_texture_non_power_of_two - -#endif /* GL_ARB_texture_non_power_of_two */ - -#ifdef GL_ARB_texture_query_levels - -#endif /* GL_ARB_texture_query_levels */ - -#ifdef GL_ARB_texture_query_lod - -#endif /* GL_ARB_texture_query_lod */ - -#ifdef GL_ARB_texture_rectangle - -#endif /* GL_ARB_texture_rectangle */ - -#ifdef GL_ARB_texture_rg - -#endif /* GL_ARB_texture_rg */ - -#ifdef GL_ARB_texture_rgb10_a2ui - -#endif /* GL_ARB_texture_rgb10_a2ui */ - -#ifdef GL_ARB_texture_storage - -static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; - r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; - r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; - r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; - r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; - r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_storage */ - -#ifdef GL_ARB_texture_storage_multisample - -static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; - r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; - r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; - r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_storage_multisample */ - -#ifdef GL_ARB_texture_swizzle - -#endif /* GL_ARB_texture_swizzle */ - -#ifdef GL_ARB_texture_view - -static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_view */ - -#ifdef GL_ARB_timer_query - -static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; - r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; - r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_timer_query */ - -#ifdef GL_ARB_transform_feedback2 - -static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; - r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; - r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; - r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; - r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; - r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; - r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback2 */ - -#ifdef GL_ARB_transform_feedback3 - -static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; - r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; - r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; - r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback3 */ - -#ifdef GL_ARB_transform_feedback_instanced - -static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; - r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback_instanced */ - -#ifdef GL_ARB_transpose_matrix - -static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; - r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; - r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; - r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transpose_matrix */ - -#ifdef GL_ARB_uniform_buffer_object - -static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; - r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; - r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; - r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; - r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; - r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; - r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; - r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; - r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; - r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_uniform_buffer_object */ - -#ifdef GL_ARB_vertex_array_bgra - -#endif /* GL_ARB_vertex_array_bgra */ - -#ifdef GL_ARB_vertex_array_object - -static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; - r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; - r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; - r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_array_object */ - -#ifdef GL_ARB_vertex_attrib_64bit - -static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; - r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; - r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; - r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; - r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; - r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; - r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; - r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; - r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; - r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_attrib_64bit */ - -#ifdef GL_ARB_vertex_attrib_binding - -static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; - r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; - r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; - r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; - r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; - r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_attrib_binding */ - -#ifdef GL_ARB_vertex_blend - -static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; - r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; - r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; - r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; - r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; - r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; - r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; - r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; - r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; - r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_blend */ - -#ifdef GL_ARB_vertex_buffer_object - -static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; - r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; - r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; - r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; - r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; - r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; - r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; - r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; - r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; - r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; - r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_buffer_object */ - -#ifdef GL_ARB_vertex_program - -static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; - r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; - r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; - r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; - r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; - r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; - r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; - r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; - r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; - r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; - r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; - r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; - r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; - r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; - r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; - r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; - r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; - r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; - r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; - r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; - r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; - r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; - r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; - r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; - r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; - r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; - r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; - r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; - r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; - r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; - r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; - r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; - r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; - r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; - r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; - r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; - r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; - r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; - r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; - r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; - r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; - r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; - r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; - r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; - r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; - r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; - r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; - r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; - r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; - r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; - r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; - r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; - r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; - r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; - r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; - r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; - r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; - r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; - r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; - r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; - r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; - r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_program */ - -#ifdef GL_ARB_vertex_shader - -static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; - r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; - r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_shader */ - -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - -static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; - r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; - r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; - r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; - r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; - r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; - r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; - r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; - r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; - r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; - r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; - r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; - r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; - r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; - r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; - r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; - r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; - r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; - r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; - r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; - r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; - r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; - r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; - r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; - r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; - r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; - r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; - r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; - r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; - r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; - r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; - r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; - r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; - r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; - r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; - r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; - r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; - r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -#ifdef GL_ARB_viewport_array - -static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; - r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; - r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; - r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; - r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; - r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; - r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; - r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; - r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; - r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_viewport_array */ - -#ifdef GL_ARB_window_pos - -static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; - r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; - r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; - r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; - r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; - r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; - r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; - r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; - r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; - r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; - r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; - r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; - r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; - r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; - r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; - r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_window_pos */ - -#ifdef GL_ATIX_point_sprites - -#endif /* GL_ATIX_point_sprites */ - -#ifdef GL_ATIX_texture_env_combine3 - -#endif /* GL_ATIX_texture_env_combine3 */ - -#ifdef GL_ATIX_texture_env_route - -#endif /* GL_ATIX_texture_env_route */ - -#ifdef GL_ATIX_vertex_shader_output_point_size - -#endif /* GL_ATIX_vertex_shader_output_point_size */ - -#ifdef GL_ATI_draw_buffers - -static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_draw_buffers */ - -#ifdef GL_ATI_element_array - -static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; - r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; - r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_element_array */ - -#ifdef GL_ATI_envmap_bumpmap - -static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; - r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; - r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; - r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_envmap_bumpmap */ - -#ifdef GL_ATI_fragment_shader - -static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; - r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; - r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; - r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; - r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; - r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; - r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; - r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; - r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; - r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; - r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; - r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; - r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; - r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_fragment_shader */ - -#ifdef GL_ATI_map_object_buffer - -static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; - r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_map_object_buffer */ - -#ifdef GL_ATI_meminfo - -#endif /* GL_ATI_meminfo */ - -#ifdef GL_ATI_pn_triangles - -static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; - r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_pn_triangles */ - -#ifdef GL_ATI_separate_stencil - -static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; - r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_separate_stencil */ - -#ifdef GL_ATI_shader_texture_lod - -#endif /* GL_ATI_shader_texture_lod */ - -#ifdef GL_ATI_text_fragment_shader - -#endif /* GL_ATI_text_fragment_shader */ - -#ifdef GL_ATI_texture_compression_3dc - -#endif /* GL_ATI_texture_compression_3dc */ - -#ifdef GL_ATI_texture_env_combine3 - -#endif /* GL_ATI_texture_env_combine3 */ - -#ifdef GL_ATI_texture_float - -#endif /* GL_ATI_texture_float */ - -#ifdef GL_ATI_texture_mirror_once - -#endif /* GL_ATI_texture_mirror_once */ - -#ifdef GL_ATI_vertex_array_object - -static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; - r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; - r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; - r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; - r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; - r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; - r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; - r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; - r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; - r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; - r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; - r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_array_object */ - -#ifdef GL_ATI_vertex_attrib_array_object - -static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; - r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; - r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_attrib_array_object */ - -#ifdef GL_ATI_vertex_streams - -static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; - r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; - r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; - r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; - r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; - r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; - r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; - r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; - r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; - r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; - r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; - r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; - r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; - r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; - r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; - r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; - r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; - r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; - r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; - r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; - r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; - r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; - r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; - r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; - r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; - r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; - r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; - r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; - r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; - r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; - r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; - r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; - r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; - r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; - r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; - r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; - r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; - r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; - r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; - r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; - r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; - r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; - r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; - r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; - r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_streams */ - -#ifdef GL_EXT_422_pixels - -#endif /* GL_EXT_422_pixels */ - -#ifdef GL_EXT_Cg_shader - -#endif /* GL_EXT_Cg_shader */ - -#ifdef GL_EXT_abgr - -#endif /* GL_EXT_abgr */ - -#ifdef GL_EXT_bgra - -#endif /* GL_EXT_bgra */ - -#ifdef GL_EXT_bindable_uniform - -static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; - r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; - r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_bindable_uniform */ - -#ifdef GL_EXT_blend_color - -static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_color */ - -#ifdef GL_EXT_blend_equation_separate - -static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_equation_separate */ - -#ifdef GL_EXT_blend_func_separate - -static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_func_separate */ - -#ifdef GL_EXT_blend_logic_op - -#endif /* GL_EXT_blend_logic_op */ - -#ifdef GL_EXT_blend_minmax - -static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_minmax */ - -#ifdef GL_EXT_blend_subtract - -#endif /* GL_EXT_blend_subtract */ - -#ifdef GL_EXT_clip_volume_hint - -#endif /* GL_EXT_clip_volume_hint */ - -#ifdef GL_EXT_cmyka - -#endif /* GL_EXT_cmyka */ - -#ifdef GL_EXT_color_subtable - -static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; - r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_color_subtable */ - -#ifdef GL_EXT_compiled_vertex_array - -static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; - r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_compiled_vertex_array */ - -#ifdef GL_EXT_convolution - -static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; - r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; - r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; - r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; - r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; - r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; - r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; - r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; - r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; - r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; - r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; - r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; - r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_convolution */ - -#ifdef GL_EXT_coordinate_frame - -static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; - r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_coordinate_frame */ - -#ifdef GL_EXT_copy_texture - -static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; - r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; - r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; - r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; - r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_copy_texture */ - -#ifdef GL_EXT_cull_vertex - -static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; - r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_cull_vertex */ - -#ifdef GL_EXT_debug_marker - -static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; - r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; - r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_debug_marker */ - -#ifdef GL_EXT_depth_bounds_test - -static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_depth_bounds_test */ - -#ifdef GL_EXT_direct_state_access - -static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; - r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; - r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; - r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; - r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; - r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; - r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; - r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; - r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; - r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; - r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; - r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; - r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; - r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; - r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; - r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; - r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; - r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; - r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; - r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; - r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; - r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; - r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; - r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; - r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; - r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; - r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; - r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; - r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; - r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; - r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; - r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; - r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; - r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; - r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; - r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; - r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; - r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; - r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; - r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; - r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; - r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; - r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; - r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; - r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; - r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; - r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; - r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; - r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; - r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; - r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; - r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; - r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; - r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; - r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; - r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; - r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; - r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; - r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; - r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; - r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; - r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; - r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; - r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; - r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; - r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; - r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; - r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; - r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; - r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; - r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; - r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; - r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; - r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; - r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; - r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; - r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; - r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; - r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; - r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; - r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; - r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; - r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; - r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; - r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; - r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; - r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; - r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; - r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; - r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; - r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; - r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; - r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; - r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; - r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; - r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; - r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; - r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; - r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; - r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; - r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; - r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; - r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; - r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; - r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; - r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; - r = ((glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dEXT")) == NULL) || r; - r = ((glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dvEXT")) == NULL) || r; - r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; - r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; - r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; - r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; - r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; - r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; - r = ((glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dEXT")) == NULL) || r; - r = ((glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dvEXT")) == NULL) || r; - r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; - r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; - r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; - r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; - r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; - r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; - r = ((glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dEXT")) == NULL) || r; - r = ((glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dvEXT")) == NULL) || r; - r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; - r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; - r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; - r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; - r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; - r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; - r = ((glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dEXT")) == NULL) || r; - r = ((glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dvEXT")) == NULL) || r; - r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; - r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; - r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; - r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; - r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; - r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; - r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; - r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; - r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; - r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; - r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; - r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; - r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; - r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; - r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; - r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; - r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; - r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; - r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; - r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; - r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; - r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; - r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; - r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; - r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; - r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; - r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; - r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_direct_state_access */ - -#ifdef GL_EXT_draw_buffers2 - -static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; - r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; - r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; - r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; - r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; - r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_buffers2 */ - -#ifdef GL_EXT_draw_instanced - -static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; - r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_instanced */ - -#ifdef GL_EXT_draw_range_elements - -static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_range_elements */ - -#ifdef GL_EXT_fog_coord - -static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; - r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; - r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; - r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; - r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_fog_coord */ - -#ifdef GL_EXT_fragment_lighting - -static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; - r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; - r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; - r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; - r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; - r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; - r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; - r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; - r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; - r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; - r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; - r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; - r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; - r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; - r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; - r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; - r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; - r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_fragment_lighting */ - -#ifdef GL_EXT_framebuffer_blit - -static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_blit */ - -#ifdef GL_EXT_framebuffer_multisample - -static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_multisample */ - -#ifdef GL_EXT_framebuffer_multisample_blit_scaled - -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -#ifdef GL_EXT_framebuffer_object - -static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; - r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; - r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; - r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; - r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; - r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; - r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; - r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; - r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; - r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; - r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; - r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; - r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; - r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; - r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; - r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; - r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_object */ - -#ifdef GL_EXT_framebuffer_sRGB - -#endif /* GL_EXT_framebuffer_sRGB */ - -#ifdef GL_EXT_geometry_shader4 - -static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; - r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; - r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_geometry_shader4 */ - -#ifdef GL_EXT_gpu_program_parameters - -static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; - r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_gpu_program_parameters */ - -#ifdef GL_EXT_gpu_shader4 - -static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; - r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; - r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; - r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; - r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; - r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; - r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; - r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; - r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; - r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; - r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; - r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; - r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; - r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; - r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; - r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; - r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; - r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; - r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; - r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; - r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; - r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; - r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; - r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; - r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; - r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; - r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; - r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; - r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; - r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; - r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; - r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; - r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; - r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_gpu_shader4 */ - -#ifdef GL_EXT_histogram - -static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; - r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; - r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; - r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; - r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; - r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; - r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; - r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; - r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; - r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_histogram */ - -#ifdef GL_EXT_index_array_formats - -#endif /* GL_EXT_index_array_formats */ - -#ifdef GL_EXT_index_func - -static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_index_func */ - -#ifdef GL_EXT_index_material - -static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_index_material */ - -#ifdef GL_EXT_index_texture - -#endif /* GL_EXT_index_texture */ - -#ifdef GL_EXT_light_texture - -static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; - r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; - r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_light_texture */ - -#ifdef GL_EXT_misc_attribute - -#endif /* GL_EXT_misc_attribute */ - -#ifdef GL_EXT_multi_draw_arrays - -static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; - r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_multi_draw_arrays */ - -#ifdef GL_EXT_multisample - -static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; - r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_multisample */ - -#ifdef GL_EXT_packed_depth_stencil - -#endif /* GL_EXT_packed_depth_stencil */ - -#ifdef GL_EXT_packed_float - -#endif /* GL_EXT_packed_float */ - -#ifdef GL_EXT_packed_pixels - -#endif /* GL_EXT_packed_pixels */ - -#ifdef GL_EXT_paletted_texture - -static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; - r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; - r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; - r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_paletted_texture */ - -#ifdef GL_EXT_pixel_buffer_object - -#endif /* GL_EXT_pixel_buffer_object */ - -#ifdef GL_EXT_pixel_transform - -static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; - r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; - r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; - r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; - r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; - r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_pixel_transform */ - -#ifdef GL_EXT_pixel_transform_color_table - -#endif /* GL_EXT_pixel_transform_color_table */ - -#ifdef GL_EXT_point_parameters - -static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; - r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_point_parameters */ - -#ifdef GL_EXT_polygon_offset - -static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_polygon_offset */ - -#ifdef GL_EXT_provoking_vertex - -static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_provoking_vertex */ - -#ifdef GL_EXT_rescale_normal - -#endif /* GL_EXT_rescale_normal */ - -#ifdef GL_EXT_scene_marker - -static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; - r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_scene_marker */ - -#ifdef GL_EXT_secondary_color - -static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; - r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; - r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; - r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; - r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; - r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; - r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; - r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; - r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; - r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; - r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; - r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; - r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; - r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; - r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; - r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; - r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_secondary_color */ - -#ifdef GL_EXT_separate_shader_objects - -static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; - r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; - r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_separate_shader_objects */ - -#ifdef GL_EXT_separate_specular_color - -#endif /* GL_EXT_separate_specular_color */ - -#ifdef GL_EXT_shader_image_load_store - -static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; - r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_shader_image_load_store */ - -#ifdef GL_EXT_shadow_funcs - -#endif /* GL_EXT_shadow_funcs */ - -#ifdef GL_EXT_shared_texture_palette - -#endif /* GL_EXT_shared_texture_palette */ - -#ifdef GL_EXT_stencil_clear_tag - -#endif /* GL_EXT_stencil_clear_tag */ - -#ifdef GL_EXT_stencil_two_side - -static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_stencil_two_side */ - -#ifdef GL_EXT_stencil_wrap - -#endif /* GL_EXT_stencil_wrap */ - -#ifdef GL_EXT_subtexture - -static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; - r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; - r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_subtexture */ - -#ifdef GL_EXT_texture - -#endif /* GL_EXT_texture */ - -#ifdef GL_EXT_texture3D - -static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture3D */ - -#ifdef GL_EXT_texture_array - -static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_array */ - -#ifdef GL_EXT_texture_buffer_object - -static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_buffer_object */ - -#ifdef GL_EXT_texture_compression_dxt1 - -#endif /* GL_EXT_texture_compression_dxt1 */ - -#ifdef GL_EXT_texture_compression_latc - -#endif /* GL_EXT_texture_compression_latc */ - -#ifdef GL_EXT_texture_compression_rgtc - -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifdef GL_EXT_texture_compression_s3tc - -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifdef GL_EXT_texture_cube_map - -#endif /* GL_EXT_texture_cube_map */ - -#ifdef GL_EXT_texture_edge_clamp - -#endif /* GL_EXT_texture_edge_clamp */ - -#ifdef GL_EXT_texture_env - -#endif /* GL_EXT_texture_env */ - -#ifdef GL_EXT_texture_env_add - -#endif /* GL_EXT_texture_env_add */ - -#ifdef GL_EXT_texture_env_combine - -#endif /* GL_EXT_texture_env_combine */ - -#ifdef GL_EXT_texture_env_dot3 - -#endif /* GL_EXT_texture_env_dot3 */ - -#ifdef GL_EXT_texture_filter_anisotropic - -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifdef GL_EXT_texture_integer - -static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; - r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; - r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; - r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; - r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; - r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_integer */ - -#ifdef GL_EXT_texture_lod_bias - -#endif /* GL_EXT_texture_lod_bias */ - -#ifdef GL_EXT_texture_mirror_clamp - -#endif /* GL_EXT_texture_mirror_clamp */ - -#ifdef GL_EXT_texture_object - -static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; - r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; - r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; - r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; - r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; - r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_object */ - -#ifdef GL_EXT_texture_perturb_normal - -static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_perturb_normal */ - -#ifdef GL_EXT_texture_rectangle - -#endif /* GL_EXT_texture_rectangle */ - -#ifdef GL_EXT_texture_sRGB - -#endif /* GL_EXT_texture_sRGB */ - -#ifdef GL_EXT_texture_sRGB_decode - -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifdef GL_EXT_texture_shared_exponent - -#endif /* GL_EXT_texture_shared_exponent */ - -#ifdef GL_EXT_texture_snorm - -#endif /* GL_EXT_texture_snorm */ - -#ifdef GL_EXT_texture_swizzle - -#endif /* GL_EXT_texture_swizzle */ - -#ifdef GL_EXT_timer_query - -static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; - r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_timer_query */ - -#ifdef GL_EXT_transform_feedback - -static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; - r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; - r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; - r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; - r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; - r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; - r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_transform_feedback */ - -#ifdef GL_EXT_vertex_array - -static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; - r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; - r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; - r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; - r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; - r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; - r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; - r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_array */ - -#ifdef GL_EXT_vertex_array_bgra - -#endif /* GL_EXT_vertex_array_bgra */ - -#ifdef GL_EXT_vertex_attrib_64bit - -static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; - r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; - r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; - r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; - r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; - r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; - r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; - r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; - r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; - r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_attrib_64bit */ - -#ifdef GL_EXT_vertex_shader - -static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; - r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; - r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; - r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; - r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; - r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; - r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; - r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; - r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; - r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; - r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; - r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; - r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; - r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; - r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; - r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; - r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; - r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; - r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; - r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; - r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; - r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; - r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; - r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; - r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; - r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; - r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; - r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; - r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; - r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; - r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; - r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; - r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; - r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; - r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; - r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; - r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; - r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; - r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; - r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; - r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; - r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_shader */ - -#ifdef GL_EXT_vertex_weighting - -static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; - r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; - r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_weighting */ - -#ifdef GL_EXT_x11_sync_object - -static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_x11_sync_object */ - -#ifdef GL_GREMEDY_frame_terminator - -static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; - - return r; -} - -#endif /* GL_GREMEDY_frame_terminator */ - -#ifdef GL_GREMEDY_string_marker - -static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; - - return r; -} - -#endif /* GL_GREMEDY_string_marker */ - -#ifdef GL_HP_convolution_border_modes - -#endif /* GL_HP_convolution_border_modes */ - -#ifdef GL_HP_image_transform - -static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; - r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; - r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; - r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; - r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; - r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; - - return r; -} - -#endif /* GL_HP_image_transform */ - -#ifdef GL_HP_occlusion_test - -#endif /* GL_HP_occlusion_test */ - -#ifdef GL_HP_texture_lighting - -#endif /* GL_HP_texture_lighting */ - -#ifdef GL_IBM_cull_vertex - -#endif /* GL_IBM_cull_vertex */ - -#ifdef GL_IBM_multimode_draw_arrays - -static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; - r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; - - return r; -} - -#endif /* GL_IBM_multimode_draw_arrays */ - -#ifdef GL_IBM_rasterpos_clip - -#endif /* GL_IBM_rasterpos_clip */ - -#ifdef GL_IBM_static_data - -#endif /* GL_IBM_static_data */ - -#ifdef GL_IBM_texture_mirrored_repeat - -#endif /* GL_IBM_texture_mirrored_repeat */ - -#ifdef GL_IBM_vertex_array_lists - -static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; - r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; - r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; - r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; - r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; - r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; - r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; - r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; - - return r; -} - -#endif /* GL_IBM_vertex_array_lists */ - -#ifdef GL_INGR_color_clamp - -#endif /* GL_INGR_color_clamp */ - -#ifdef GL_INGR_interlace_read - -#endif /* GL_INGR_interlace_read */ - -#ifdef GL_INTEL_parallel_arrays - -static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; - r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; - r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; - r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_parallel_arrays */ - -#ifdef GL_INTEL_texture_scissor - -static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; - r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_texture_scissor */ - -#ifdef GL_KHR_debug - -static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; - r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; - r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; - r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; - r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; - r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; - r = ((glGetPointerv = (PFNGLGETPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetPointerv")) == NULL) || r; - r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; - r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; - r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; - - return r; -} - -#endif /* GL_KHR_debug */ - -#ifdef GL_KHR_texture_compression_astc_ldr - -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifdef GL_KTX_buffer_region - -static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; - r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; - r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; - r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; - r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; - - return r; -} - -#endif /* GL_KTX_buffer_region */ - -#ifdef GL_MESAX_texture_stack - -#endif /* GL_MESAX_texture_stack */ - -#ifdef GL_MESA_pack_invert - -#endif /* GL_MESA_pack_invert */ - -#ifdef GL_MESA_resize_buffers - -static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; - - return r; -} - -#endif /* GL_MESA_resize_buffers */ - -#ifdef GL_MESA_window_pos - -static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; - r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; - r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; - r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; - r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; - r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; - r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; - r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; - r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; - r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; - r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; - r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; - r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; - r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; - r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; - r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; - r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; - r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; - r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; - r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; - r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; - r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; - r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; - r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; - - return r; -} - -#endif /* GL_MESA_window_pos */ - -#ifdef GL_MESA_ycbcr_texture - -#endif /* GL_MESA_ycbcr_texture */ - -#ifdef GL_NVX_gpu_memory_info - -#endif /* GL_NVX_gpu_memory_info */ - -#ifdef GL_NV_bindless_texture - -static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; - r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; - r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; - r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; - r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; - r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; - r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; - r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; - r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; - r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; - r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; - r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; - r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_bindless_texture */ - -#ifdef GL_NV_blend_square - -#endif /* GL_NV_blend_square */ - -#ifdef GL_NV_conditional_render - -static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; - r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_conditional_render */ - -#ifdef GL_NV_copy_depth_to_color - -#endif /* GL_NV_copy_depth_to_color */ - -#ifdef GL_NV_copy_image - -static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_copy_image */ - -#ifdef GL_NV_depth_buffer_float - -static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; - r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; - r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_depth_buffer_float */ - -#ifdef GL_NV_depth_clamp - -#endif /* GL_NV_depth_clamp */ - -#ifdef GL_NV_depth_range_unclamped - -#endif /* GL_NV_depth_range_unclamped */ - -#ifdef GL_NV_evaluators - -static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; - r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; - r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; - r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; - r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; - r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; - r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; - r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; - r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_evaluators */ - -#ifdef GL_NV_explicit_multisample - -static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; - r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; - r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_explicit_multisample */ - -#ifdef GL_NV_fence - -static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; - r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; - r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; - r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; - r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; - r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; - r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_fence */ - -#ifdef GL_NV_float_buffer - -#endif /* GL_NV_float_buffer */ - -#ifdef GL_NV_fog_distance - -#endif /* GL_NV_fog_distance */ - -#ifdef GL_NV_fragment_program - -static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; - r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; - r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; - r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; - r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; - r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_fragment_program */ - -#ifdef GL_NV_fragment_program2 - -#endif /* GL_NV_fragment_program2 */ - -#ifdef GL_NV_fragment_program4 - -#endif /* GL_NV_fragment_program4 */ - -#ifdef GL_NV_fragment_program_option - -#endif /* GL_NV_fragment_program_option */ - -#ifdef GL_NV_framebuffer_multisample_coverage - -static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_framebuffer_multisample_coverage */ - -#ifdef GL_NV_geometry_program4 - -static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_geometry_program4 */ - -#ifdef GL_NV_geometry_shader4 - -#endif /* GL_NV_geometry_shader4 */ - -#ifdef GL_NV_gpu_program4 - -static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; - r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; - r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; - r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; - r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; - r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; - r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; - r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; - r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; - r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; - r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; - r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_gpu_program4 */ - -#ifdef GL_NV_gpu_program5 - -#endif /* GL_NV_gpu_program5 */ - -#ifdef GL_NV_gpu_program_fp64 - -#endif /* GL_NV_gpu_program_fp64 */ - -#ifdef GL_NV_gpu_shader5 - -static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; - r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; - r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; - r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; - r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; - r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; - r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; - r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; - r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; - r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; - r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; - r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; - r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; - r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; - r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; - r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; - r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; - r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; - r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; - r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; - r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; - r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; - r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; - r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; - r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; - r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; - r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; - r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; - r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; - r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; - r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; - r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; - r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; - r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_gpu_shader5 */ - -#ifdef GL_NV_half_float - -static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; - r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; - r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; - r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; - r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; - r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; - r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; - r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; - r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; - r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; - r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; - r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; - r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; - r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; - r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; - r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; - r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; - r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; - r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; - r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; - r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; - r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; - r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; - r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; - r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; - r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; - r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; - r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; - r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; - r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; - r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; - r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; - r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; - r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; - r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; - r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; - r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; - r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; - r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; - r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; - r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; - r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; - r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; - r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; - r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; - r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_half_float */ - -#ifdef GL_NV_light_max_exponent - -#endif /* GL_NV_light_max_exponent */ - -#ifdef GL_NV_multisample_coverage - -#endif /* GL_NV_multisample_coverage */ - -#ifdef GL_NV_multisample_filter_hint - -#endif /* GL_NV_multisample_filter_hint */ - -#ifdef GL_NV_occlusion_query - -static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; - r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; - r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; - r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; - r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; - r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; - r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_occlusion_query */ - -#ifdef GL_NV_packed_depth_stencil - -#endif /* GL_NV_packed_depth_stencil */ - -#ifdef GL_NV_parameter_buffer_object - -static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; - r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; - r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_parameter_buffer_object */ - -#ifdef GL_NV_parameter_buffer_object2 - -#endif /* GL_NV_parameter_buffer_object2 */ - -#ifdef GL_NV_path_rendering - -static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; - r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; - r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; - r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; - r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; - r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; - r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; - r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; - r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; - r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; - r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; - r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; - r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; - r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; - r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; - r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; - r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; - r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; - r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; - r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; - r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; - r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; - r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; - r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; - r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; - r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; - r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; - r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; - r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; - r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; - r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; - r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; - r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; - r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; - r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; - r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; - r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; - r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; - r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; - r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; - r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; - r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; - r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; - r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; - r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; - r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; - r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; - r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; - r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_path_rendering */ - -#ifdef GL_NV_pixel_data_range - -static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; - r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_pixel_data_range */ - -#ifdef GL_NV_point_sprite - -static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; - r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_point_sprite */ - -#ifdef GL_NV_present_video - -static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; - r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; - r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; - r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; - r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; - r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_present_video */ - -#ifdef GL_NV_primitive_restart - -static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; - r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_primitive_restart */ - -#ifdef GL_NV_register_combiners - -static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; - r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; - r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; - r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; - r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; - r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; - r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; - r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; - r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; - r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; - r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; - r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; - r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_register_combiners */ - -#ifdef GL_NV_register_combiners2 - -static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; - r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_register_combiners2 */ - -#ifdef GL_NV_shader_atomic_float - -#endif /* GL_NV_shader_atomic_float */ - -#ifdef GL_NV_shader_buffer_load - -static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; - r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; - r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; - r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; - r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; - r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; - r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; - r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; - r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; - r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; - r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; - r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; - r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_shader_buffer_load */ - -#ifdef GL_NV_tessellation_program5 - -#endif /* GL_NV_tessellation_program5 */ - -#ifdef GL_NV_texgen_emboss - -#endif /* GL_NV_texgen_emboss */ - -#ifdef GL_NV_texgen_reflection - -#endif /* GL_NV_texgen_reflection */ - -#ifdef GL_NV_texture_barrier - -static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_texture_barrier */ - -#ifdef GL_NV_texture_compression_vtc - -#endif /* GL_NV_texture_compression_vtc */ - -#ifdef GL_NV_texture_env_combine4 - -#endif /* GL_NV_texture_env_combine4 */ - -#ifdef GL_NV_texture_expand_normal - -#endif /* GL_NV_texture_expand_normal */ - -#ifdef GL_NV_texture_multisample - -static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; - r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; - r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_texture_multisample */ - -#ifdef GL_NV_texture_rectangle - -#endif /* GL_NV_texture_rectangle */ - -#ifdef GL_NV_texture_shader - -#endif /* GL_NV_texture_shader */ - -#ifdef GL_NV_texture_shader2 - -#endif /* GL_NV_texture_shader2 */ - -#ifdef GL_NV_texture_shader3 - -#endif /* GL_NV_texture_shader3 */ - -#ifdef GL_NV_transform_feedback - -static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; - r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; - r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; - r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; - r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; - r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; - r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; - r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; - r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; - r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; - r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_transform_feedback */ - -#ifdef GL_NV_transform_feedback2 - -static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; - r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; - r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; - r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; - r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; - r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; - r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_transform_feedback2 */ - -#ifdef GL_NV_vdpau_interop - -static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; - r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; - r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; - r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; - r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; - r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; - r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; - r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; - r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; - r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vdpau_interop */ - -#ifdef GL_NV_vertex_array_range - -static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; - r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_array_range */ - -#ifdef GL_NV_vertex_array_range2 - -#endif /* GL_NV_vertex_array_range2 */ - -#ifdef GL_NV_vertex_attrib_integer_64bit - -static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; - r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; - r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; - r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; - r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; - r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; - r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; - r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; - r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; - r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; - r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; - r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; - r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; - r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; - r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; - r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; - r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; - r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; - r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -#ifdef GL_NV_vertex_buffer_unified_memory - -static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; - r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; - r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; - r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; - r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; - r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; - r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; - r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; - r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; - r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; - r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; - r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_buffer_unified_memory */ - -#ifdef GL_NV_vertex_program - -static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; - r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; - r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; - r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; - r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; - r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; - r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; - r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; - r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; - r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; - r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; - r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; - r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; - r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; - r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; - r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; - r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; - r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; - r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; - r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; - r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; - r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; - r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; - r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; - r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; - r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; - r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; - r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; - r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; - r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; - r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; - r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; - r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; - r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; - r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; - r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; - r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; - r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; - r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; - r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; - r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; - r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; - r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; - r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; - r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; - r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; - r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; - r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; - r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; - r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; - r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; - r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; - r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; - r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; - r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; - r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; - r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; - r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; - r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; - r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; - r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; - r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; - r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; - r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_program */ - -#ifdef GL_NV_vertex_program1_1 - -#endif /* GL_NV_vertex_program1_1 */ - -#ifdef GL_NV_vertex_program2 - -#endif /* GL_NV_vertex_program2 */ - -#ifdef GL_NV_vertex_program2_option - -#endif /* GL_NV_vertex_program2_option */ - -#ifdef GL_NV_vertex_program3 - -#endif /* GL_NV_vertex_program3 */ - -#ifdef GL_NV_vertex_program4 - -#endif /* GL_NV_vertex_program4 */ - -#ifdef GL_NV_video_capture - -static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; - r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; - r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; - r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; - r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; - r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_video_capture */ - -#ifdef GL_OES_byte_coordinates - -#endif /* GL_OES_byte_coordinates */ - -#ifdef GL_OES_compressed_paletted_texture - -#endif /* GL_OES_compressed_paletted_texture */ - -#ifdef GL_OES_read_format - -#endif /* GL_OES_read_format */ - -#ifdef GL_OES_single_precision - -static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; - r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; - r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; - r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; - r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; - r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; - - return r; -} - -#endif /* GL_OES_single_precision */ - -#ifdef GL_OML_interlace - -#endif /* GL_OML_interlace */ - -#ifdef GL_OML_resample - -#endif /* GL_OML_resample */ - -#ifdef GL_OML_subsample - -#endif /* GL_OML_subsample */ - -#ifdef GL_PGI_misc_hints - -#endif /* GL_PGI_misc_hints */ - -#ifdef GL_PGI_vertex_hints - -#endif /* GL_PGI_vertex_hints */ - -#ifdef GL_REGAL_error_string - -static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_error_string */ - -#ifdef GL_REGAL_extension_query - -static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; - r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_extension_query */ - -#ifdef GL_REGAL_log - -#endif /* GL_REGAL_log */ - -#ifdef GL_REND_screen_coordinates - -#endif /* GL_REND_screen_coordinates */ - -#ifdef GL_S3_s3tc - -#endif /* GL_S3_s3tc */ - -#ifdef GL_SGIS_color_range - -#endif /* GL_SGIS_color_range */ - -#ifdef GL_SGIS_detail_texture - -static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; - r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_detail_texture */ - -#ifdef GL_SGIS_fog_function - -static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; - r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_fog_function */ - -#ifdef GL_SGIS_generate_mipmap - -#endif /* GL_SGIS_generate_mipmap */ - -#ifdef GL_SGIS_multisample - -static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; - r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_multisample */ - -#ifdef GL_SGIS_pixel_texture - -#endif /* GL_SGIS_pixel_texture */ - -#ifdef GL_SGIS_point_line_texgen - -#endif /* GL_SGIS_point_line_texgen */ - -#ifdef GL_SGIS_sharpen_texture - -static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; - r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_sharpen_texture */ - -#ifdef GL_SGIS_texture4D - -static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; - r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_texture4D */ - -#ifdef GL_SGIS_texture_border_clamp - -#endif /* GL_SGIS_texture_border_clamp */ - -#ifdef GL_SGIS_texture_edge_clamp - -#endif /* GL_SGIS_texture_edge_clamp */ - -#ifdef GL_SGIS_texture_filter4 - -static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; - r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_texture_filter4 */ - -#ifdef GL_SGIS_texture_lod - -#endif /* GL_SGIS_texture_lod */ - -#ifdef GL_SGIS_texture_select - -#endif /* GL_SGIS_texture_select */ - -#ifdef GL_SGIX_async - -static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; - r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; - r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; - r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; - r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; - r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_async */ - -#ifdef GL_SGIX_async_histogram - -#endif /* GL_SGIX_async_histogram */ - -#ifdef GL_SGIX_async_pixel - -#endif /* GL_SGIX_async_pixel */ - -#ifdef GL_SGIX_blend_alpha_minmax - -#endif /* GL_SGIX_blend_alpha_minmax */ - -#ifdef GL_SGIX_clipmap - -#endif /* GL_SGIX_clipmap */ - -#ifdef GL_SGIX_convolution_accuracy - -#endif /* GL_SGIX_convolution_accuracy */ - -#ifdef GL_SGIX_depth_texture - -#endif /* GL_SGIX_depth_texture */ - -#ifdef GL_SGIX_flush_raster - -static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_flush_raster */ - -#ifdef GL_SGIX_fog_offset - -#endif /* GL_SGIX_fog_offset */ - -#ifdef GL_SGIX_fog_texture - -static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_fog_texture */ - -#ifdef GL_SGIX_fragment_specular_lighting - -static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; - r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; - r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; - r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; - r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; - r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; - r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; - r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; - r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; - r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; - r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; - r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; - r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; - r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; - r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; - r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; - r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_fragment_specular_lighting */ - -#ifdef GL_SGIX_framezoom - -static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_framezoom */ - -#ifdef GL_SGIX_interlace - -#endif /* GL_SGIX_interlace */ - -#ifdef GL_SGIX_ir_instrument1 - -#endif /* GL_SGIX_ir_instrument1 */ - -#ifdef GL_SGIX_list_priority - -#endif /* GL_SGIX_list_priority */ - -#ifdef GL_SGIX_pixel_texture - -static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_pixel_texture */ - -#ifdef GL_SGIX_pixel_texture_bits - -#endif /* GL_SGIX_pixel_texture_bits */ - -#ifdef GL_SGIX_reference_plane - -static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_reference_plane */ - -#ifdef GL_SGIX_resample - -#endif /* GL_SGIX_resample */ - -#ifdef GL_SGIX_shadow - -#endif /* GL_SGIX_shadow */ - -#ifdef GL_SGIX_shadow_ambient - -#endif /* GL_SGIX_shadow_ambient */ - -#ifdef GL_SGIX_sprite - -static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; - r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; - r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; - r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_sprite */ - -#ifdef GL_SGIX_tag_sample_buffer - -static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_tag_sample_buffer */ - -#ifdef GL_SGIX_texture_add_env - -#endif /* GL_SGIX_texture_add_env */ - -#ifdef GL_SGIX_texture_coordinate_clamp - -#endif /* GL_SGIX_texture_coordinate_clamp */ - -#ifdef GL_SGIX_texture_lod_bias - -#endif /* GL_SGIX_texture_lod_bias */ - -#ifdef GL_SGIX_texture_multi_buffer - -#endif /* GL_SGIX_texture_multi_buffer */ - -#ifdef GL_SGIX_texture_range - -#endif /* GL_SGIX_texture_range */ - -#ifdef GL_SGIX_texture_scale_bias - -#endif /* GL_SGIX_texture_scale_bias */ - -#ifdef GL_SGIX_vertex_preclip - -#endif /* GL_SGIX_vertex_preclip */ - -#ifdef GL_SGIX_vertex_preclip_hint - -#endif /* GL_SGIX_vertex_preclip_hint */ - -#ifdef GL_SGIX_ycrcb - -#endif /* GL_SGIX_ycrcb */ - -#ifdef GL_SGI_color_matrix - -#endif /* GL_SGI_color_matrix */ - -#ifdef GL_SGI_color_table - -static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; - r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; - r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; - r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; - r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; - r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; - r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; - - return r; -} - -#endif /* GL_SGI_color_table */ - -#ifdef GL_SGI_texture_color_table - -#endif /* GL_SGI_texture_color_table */ - -#ifdef GL_SUNX_constant_data - -static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; - - return r; -} - -#endif /* GL_SUNX_constant_data */ - -#ifdef GL_SUN_convolution_border_modes - -#endif /* GL_SUN_convolution_border_modes */ - -#ifdef GL_SUN_global_alpha - -static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; - r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; - r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; - r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_global_alpha */ - -#ifdef GL_SUN_mesh_array - -#endif /* GL_SUN_mesh_array */ - -#ifdef GL_SUN_read_video_pixels - -static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_read_video_pixels */ - -#ifdef GL_SUN_slice_accum - -#endif /* GL_SUN_slice_accum */ - -#ifdef GL_SUN_triangle_list - -static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; - r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; - r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; - r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; - r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; - r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; - r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_triangle_list */ - -#ifdef GL_SUN_vertex - -static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; - r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; - r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; - r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; - r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; - r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; - r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; - r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; - r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; - r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_vertex */ - -#ifdef GL_WIN_phong_shading - -#endif /* GL_WIN_phong_shading */ - -#ifdef GL_WIN_specular_fog - -#endif /* GL_WIN_specular_fog */ - -#ifdef GL_WIN_swap_hint - -static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; - - return r; -} - -#endif /* GL_WIN_swap_hint */ - -/* ------------------------------------------------------------------------- */ - -GLboolean GLEWAPIENTRY glewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - start = (const GLubyte*)glGetString(GL_EXTENSIONS); - if (start == 0) - return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -/* ------------------------------------------------------------------------- */ - -#ifndef GLEW_MX -static -#endif -GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) -{ - const GLubyte* s; - GLuint dot; - GLint major, minor; - const GLubyte* extStart; - const GLubyte* extEnd; - /* query opengl version */ - s = glGetString(GL_VERSION); - dot = _glewStrCLen(s, '.'); - if (dot == 0) - return GLEW_ERROR_NO_GL_VERSION; - - major = s[dot-1]-'0'; - minor = s[dot+1]-'0'; - - if (minor < 0 || minor > 9) - minor = 0; - if (major<0 || major>9) - return GLEW_ERROR_NO_GL_VERSION; - - - if (major == 1 && minor == 0) - { - return GLEW_ERROR_GL_VERSION_10_ONLY; - } - else - { - CONST_CAST(GLEW_VERSION_4_3) = ( major > 4 ) || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - } - - /* query opengl extensions string */ - extStart = glGetString(GL_EXTENSIONS); - if (extStart == 0) - extStart = (const GLubyte*)""; - extEnd = extStart + _glewStrLen(extStart); - - /* initialize extensions */ -#ifdef GL_VERSION_1_2 - if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_2 */ -#ifdef GL_VERSION_1_2_1 -#endif /* GL_VERSION_1_2_1 */ -#ifdef GL_VERSION_1_3 - if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_3 */ -#ifdef GL_VERSION_1_4 - if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_4 */ -#ifdef GL_VERSION_1_5 - if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_5 */ -#ifdef GL_VERSION_2_0 - if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_2_0 */ -#ifdef GL_VERSION_2_1 - if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_2_1 */ -#ifdef GL_VERSION_3_0 - if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_0 */ -#ifdef GL_VERSION_3_1 - if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_1 */ -#ifdef GL_VERSION_3_2 - if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_2 */ -#ifdef GL_VERSION_3_3 - if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_3 */ -#ifdef GL_VERSION_4_0 - if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_4_0 */ -#ifdef GL_VERSION_4_1 -#endif /* GL_VERSION_4_1 */ -#ifdef GL_VERSION_4_2 -#endif /* GL_VERSION_4_2 */ -#ifdef GL_VERSION_4_3 -#endif /* GL_VERSION_4_3 */ -#ifdef GL_3DFX_multisample - CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); -#endif /* GL_3DFX_multisample */ -#ifdef GL_3DFX_tbuffer - CONST_CAST(GLEW_3DFX_tbuffer) = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); - if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_3DFX_tbuffer */ -#ifdef GL_3DFX_texture_compression_FXT1 - CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); -#endif /* GL_3DFX_texture_compression_FXT1 */ -#ifdef GL_AMD_blend_minmax_factor - CONST_CAST(GLEW_AMD_blend_minmax_factor) = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); -#endif /* GL_AMD_blend_minmax_factor */ -#ifdef GL_AMD_conservative_depth - CONST_CAST(GLEW_AMD_conservative_depth) = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); -#endif /* GL_AMD_conservative_depth */ -#ifdef GL_AMD_debug_output - CONST_CAST(GLEW_AMD_debug_output) = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); - if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_debug_output */ -#ifdef GL_AMD_depth_clamp_separate - CONST_CAST(GLEW_AMD_depth_clamp_separate) = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); -#endif /* GL_AMD_depth_clamp_separate */ -#ifdef GL_AMD_draw_buffers_blend - CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); - if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_draw_buffers_blend */ -#ifdef GL_AMD_multi_draw_indirect - CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_multi_draw_indirect */ -#ifdef GL_AMD_name_gen_delete - CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); - if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_name_gen_delete */ -#ifdef GL_AMD_performance_monitor - CONST_CAST(GLEW_AMD_performance_monitor) = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); - if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_performance_monitor */ -#ifdef GL_AMD_pinned_memory - CONST_CAST(GLEW_AMD_pinned_memory) = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); -#endif /* GL_AMD_pinned_memory */ -#ifdef GL_AMD_query_buffer_object - CONST_CAST(GLEW_AMD_query_buffer_object) = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); -#endif /* GL_AMD_query_buffer_object */ -#ifdef GL_AMD_sample_positions - CONST_CAST(GLEW_AMD_sample_positions) = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); - if (glewExperimental || GLEW_AMD_sample_positions) CONST_CAST(GLEW_AMD_sample_positions) = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_sample_positions */ -#ifdef GL_AMD_seamless_cubemap_per_texture - CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); -#endif /* GL_AMD_seamless_cubemap_per_texture */ -#ifdef GL_AMD_shader_stencil_export - CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); -#endif /* GL_AMD_shader_stencil_export */ -#ifdef GL_AMD_stencil_operation_extended - CONST_CAST(GLEW_AMD_stencil_operation_extended) = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); - if (glewExperimental || GLEW_AMD_stencil_operation_extended) CONST_CAST(GLEW_AMD_stencil_operation_extended) = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_stencil_operation_extended */ -#ifdef GL_AMD_texture_texture4 - CONST_CAST(GLEW_AMD_texture_texture4) = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); -#endif /* GL_AMD_texture_texture4 */ -#ifdef GL_AMD_transform_feedback3_lines_triangles - CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); -#endif /* GL_AMD_transform_feedback3_lines_triangles */ -#ifdef GL_AMD_vertex_shader_layer - CONST_CAST(GLEW_AMD_vertex_shader_layer) = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); -#endif /* GL_AMD_vertex_shader_layer */ -#ifdef GL_AMD_vertex_shader_tessellator - CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); - if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_vertex_shader_tessellator */ -#ifdef GL_AMD_vertex_shader_viewport_index - CONST_CAST(GLEW_AMD_vertex_shader_viewport_index) = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); -#endif /* GL_AMD_vertex_shader_viewport_index */ -#ifdef GL_APPLE_aux_depth_stencil - CONST_CAST(GLEW_APPLE_aux_depth_stencil) = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); -#endif /* GL_APPLE_aux_depth_stencil */ -#ifdef GL_APPLE_client_storage - CONST_CAST(GLEW_APPLE_client_storage) = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); -#endif /* GL_APPLE_client_storage */ -#ifdef GL_APPLE_element_array - CONST_CAST(GLEW_APPLE_element_array) = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_element_array */ -#ifdef GL_APPLE_fence - CONST_CAST(GLEW_APPLE_fence) = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_fence */ -#ifdef GL_APPLE_float_pixels - CONST_CAST(GLEW_APPLE_float_pixels) = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); -#endif /* GL_APPLE_float_pixels */ -#ifdef GL_APPLE_flush_buffer_range - CONST_CAST(GLEW_APPLE_flush_buffer_range) = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_flush_buffer_range */ -#ifdef GL_APPLE_object_purgeable - CONST_CAST(GLEW_APPLE_object_purgeable) = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_object_purgeable */ -#ifdef GL_APPLE_pixel_buffer - CONST_CAST(GLEW_APPLE_pixel_buffer) = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); -#endif /* GL_APPLE_pixel_buffer */ -#ifdef GL_APPLE_rgb_422 - CONST_CAST(GLEW_APPLE_rgb_422) = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); -#endif /* GL_APPLE_rgb_422 */ -#ifdef GL_APPLE_row_bytes - CONST_CAST(GLEW_APPLE_row_bytes) = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); -#endif /* GL_APPLE_row_bytes */ -#ifdef GL_APPLE_specular_vector - CONST_CAST(GLEW_APPLE_specular_vector) = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); -#endif /* GL_APPLE_specular_vector */ -#ifdef GL_APPLE_texture_range - CONST_CAST(GLEW_APPLE_texture_range) = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_texture_range */ -#ifdef GL_APPLE_transform_hint - CONST_CAST(GLEW_APPLE_transform_hint) = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); -#endif /* GL_APPLE_transform_hint */ -#ifdef GL_APPLE_vertex_array_object - CONST_CAST(GLEW_APPLE_vertex_array_object) = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_array_object */ -#ifdef GL_APPLE_vertex_array_range - CONST_CAST(GLEW_APPLE_vertex_array_range) = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_array_range */ -#ifdef GL_APPLE_vertex_program_evaluators - CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_program_evaluators */ -#ifdef GL_APPLE_ycbcr_422 - CONST_CAST(GLEW_APPLE_ycbcr_422) = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); -#endif /* GL_APPLE_ycbcr_422 */ -#ifdef GL_ARB_ES2_compatibility - CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_ES2_compatibility */ -#ifdef GL_ARB_ES3_compatibility - CONST_CAST(GLEW_ARB_ES3_compatibility) = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); -#endif /* GL_ARB_ES3_compatibility */ -#ifdef GL_ARB_arrays_of_arrays - CONST_CAST(GLEW_ARB_arrays_of_arrays) = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); -#endif /* GL_ARB_arrays_of_arrays */ -#ifdef GL_ARB_base_instance - CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); - if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_base_instance */ -#ifdef GL_ARB_blend_func_extended - CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); - if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_blend_func_extended */ -#ifdef GL_ARB_cl_event - CONST_CAST(GLEW_ARB_cl_event) = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); - if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_cl_event */ -#ifdef GL_ARB_clear_buffer_object - CONST_CAST(GLEW_ARB_clear_buffer_object) = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_clear_buffer_object) CONST_CAST(GLEW_ARB_clear_buffer_object) = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_clear_buffer_object */ -#ifdef GL_ARB_color_buffer_float - CONST_CAST(GLEW_ARB_color_buffer_float) = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); - if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_color_buffer_float */ -#ifdef GL_ARB_compatibility - CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); -#endif /* GL_ARB_compatibility */ -#ifdef GL_ARB_compressed_texture_pixel_storage - CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); -#endif /* GL_ARB_compressed_texture_pixel_storage */ -#ifdef GL_ARB_compute_shader - CONST_CAST(GLEW_ARB_compute_shader) = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_compute_shader) CONST_CAST(GLEW_ARB_compute_shader) = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_compute_shader */ -#ifdef GL_ARB_conservative_depth - CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); -#endif /* GL_ARB_conservative_depth */ -#ifdef GL_ARB_copy_buffer - CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); - if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_copy_buffer */ -#ifdef GL_ARB_copy_image - CONST_CAST(GLEW_ARB_copy_image) = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); - if (glewExperimental || GLEW_ARB_copy_image) CONST_CAST(GLEW_ARB_copy_image) = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_copy_image */ -#ifdef GL_ARB_debug_output - CONST_CAST(GLEW_ARB_debug_output) = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); - if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_debug_output */ -#ifdef GL_ARB_depth_buffer_float - CONST_CAST(GLEW_ARB_depth_buffer_float) = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); -#endif /* GL_ARB_depth_buffer_float */ -#ifdef GL_ARB_depth_clamp - CONST_CAST(GLEW_ARB_depth_clamp) = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); -#endif /* GL_ARB_depth_clamp */ -#ifdef GL_ARB_depth_texture - CONST_CAST(GLEW_ARB_depth_texture) = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); -#endif /* GL_ARB_depth_texture */ -#ifdef GL_ARB_draw_buffers - CONST_CAST(GLEW_ARB_draw_buffers) = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_buffers */ -#ifdef GL_ARB_draw_buffers_blend - CONST_CAST(GLEW_ARB_draw_buffers_blend) = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_buffers_blend */ -#ifdef GL_ARB_draw_elements_base_vertex - CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_elements_base_vertex */ -#ifdef GL_ARB_draw_indirect - CONST_CAST(GLEW_ARB_draw_indirect) = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_indirect */ -#ifdef GL_ARB_draw_instanced - CONST_CAST(GLEW_ARB_draw_instanced) = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); -#endif /* GL_ARB_draw_instanced */ -#ifdef GL_ARB_explicit_attrib_location - CONST_CAST(GLEW_ARB_explicit_attrib_location) = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); -#endif /* GL_ARB_explicit_attrib_location */ -#ifdef GL_ARB_explicit_uniform_location - CONST_CAST(GLEW_ARB_explicit_uniform_location) = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); -#endif /* GL_ARB_explicit_uniform_location */ -#ifdef GL_ARB_fragment_coord_conventions - CONST_CAST(GLEW_ARB_fragment_coord_conventions) = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); -#endif /* GL_ARB_fragment_coord_conventions */ -#ifdef GL_ARB_fragment_layer_viewport - CONST_CAST(GLEW_ARB_fragment_layer_viewport) = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); -#endif /* GL_ARB_fragment_layer_viewport */ -#ifdef GL_ARB_fragment_program - CONST_CAST(GLEW_ARB_fragment_program) = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); -#endif /* GL_ARB_fragment_program */ -#ifdef GL_ARB_fragment_program_shadow - CONST_CAST(GLEW_ARB_fragment_program_shadow) = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); -#endif /* GL_ARB_fragment_program_shadow */ -#ifdef GL_ARB_fragment_shader - CONST_CAST(GLEW_ARB_fragment_shader) = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); -#endif /* GL_ARB_fragment_shader */ -#ifdef GL_ARB_framebuffer_no_attachments - CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); - if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_framebuffer_no_attachments */ -#ifdef GL_ARB_framebuffer_object - CONST_CAST(GLEW_ARB_framebuffer_object) = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_framebuffer_object */ -#ifdef GL_ARB_framebuffer_sRGB - CONST_CAST(GLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* GL_ARB_framebuffer_sRGB */ -#ifdef GL_ARB_geometry_shader4 - CONST_CAST(GLEW_ARB_geometry_shader4) = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); - if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_geometry_shader4 */ -#ifdef GL_ARB_get_program_binary - CONST_CAST(GLEW_ARB_get_program_binary) = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); - if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_get_program_binary */ -#ifdef GL_ARB_gpu_shader5 - CONST_CAST(GLEW_ARB_gpu_shader5) = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); -#endif /* GL_ARB_gpu_shader5 */ -#ifdef GL_ARB_gpu_shader_fp64 - CONST_CAST(GLEW_ARB_gpu_shader_fp64) = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); - if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_gpu_shader_fp64 */ -#ifdef GL_ARB_half_float_pixel - CONST_CAST(GLEW_ARB_half_float_pixel) = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); -#endif /* GL_ARB_half_float_pixel */ -#ifdef GL_ARB_half_float_vertex - CONST_CAST(GLEW_ARB_half_float_vertex) = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); -#endif /* GL_ARB_half_float_vertex */ -#ifdef GL_ARB_imaging - CONST_CAST(GLEW_ARB_imaging) = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); - if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_imaging */ -#ifdef GL_ARB_instanced_arrays - CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); - if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_instanced_arrays */ -#ifdef GL_ARB_internalformat_query - CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_internalformat_query */ -#ifdef GL_ARB_internalformat_query2 - CONST_CAST(GLEW_ARB_internalformat_query2) = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); - if (glewExperimental || GLEW_ARB_internalformat_query2) CONST_CAST(GLEW_ARB_internalformat_query2) = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_internalformat_query2 */ -#ifdef GL_ARB_invalidate_subdata - CONST_CAST(GLEW_ARB_invalidate_subdata) = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); - if (glewExperimental || GLEW_ARB_invalidate_subdata) CONST_CAST(GLEW_ARB_invalidate_subdata) = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_invalidate_subdata */ -#ifdef GL_ARB_map_buffer_alignment - CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); -#endif /* GL_ARB_map_buffer_alignment */ -#ifdef GL_ARB_map_buffer_range - CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_map_buffer_range */ -#ifdef GL_ARB_matrix_palette - CONST_CAST(GLEW_ARB_matrix_palette) = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); - if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_matrix_palette */ -#ifdef GL_ARB_multi_draw_indirect - CONST_CAST(GLEW_ARB_multi_draw_indirect) = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multi_draw_indirect) CONST_CAST(GLEW_ARB_multi_draw_indirect) = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multi_draw_indirect */ -#ifdef GL_ARB_multisample - CONST_CAST(GLEW_ARB_multisample) = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multisample */ -#ifdef GL_ARB_multitexture - CONST_CAST(GLEW_ARB_multitexture) = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multitexture */ -#ifdef GL_ARB_occlusion_query - CONST_CAST(GLEW_ARB_occlusion_query) = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_occlusion_query */ -#ifdef GL_ARB_occlusion_query2 - CONST_CAST(GLEW_ARB_occlusion_query2) = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); -#endif /* GL_ARB_occlusion_query2 */ -#ifdef GL_ARB_pixel_buffer_object - CONST_CAST(GLEW_ARB_pixel_buffer_object) = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); -#endif /* GL_ARB_pixel_buffer_object */ -#ifdef GL_ARB_point_parameters - CONST_CAST(GLEW_ARB_point_parameters) = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); - if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_point_parameters */ -#ifdef GL_ARB_point_sprite - CONST_CAST(GLEW_ARB_point_sprite) = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); -#endif /* GL_ARB_point_sprite */ -#ifdef GL_ARB_program_interface_query - CONST_CAST(GLEW_ARB_program_interface_query) = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_program_interface_query) CONST_CAST(GLEW_ARB_program_interface_query) = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_program_interface_query */ -#ifdef GL_ARB_provoking_vertex - CONST_CAST(GLEW_ARB_provoking_vertex) = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); - if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_provoking_vertex */ -#ifdef GL_ARB_robust_buffer_access_behavior - CONST_CAST(GLEW_ARB_robust_buffer_access_behavior) = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); -#endif /* GL_ARB_robust_buffer_access_behavior */ -#ifdef GL_ARB_robustness - CONST_CAST(GLEW_ARB_robustness) = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); - if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_robustness */ -#ifdef GL_ARB_robustness_application_isolation - CONST_CAST(GLEW_ARB_robustness_application_isolation) = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); -#endif /* GL_ARB_robustness_application_isolation */ -#ifdef GL_ARB_robustness_share_group_isolation - CONST_CAST(GLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); -#endif /* GL_ARB_robustness_share_group_isolation */ -#ifdef GL_ARB_sample_shading - CONST_CAST(GLEW_ARB_sample_shading) = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sample_shading */ -#ifdef GL_ARB_sampler_objects - CONST_CAST(GLEW_ARB_sampler_objects) = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sampler_objects */ -#ifdef GL_ARB_seamless_cube_map - CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); -#endif /* GL_ARB_seamless_cube_map */ -#ifdef GL_ARB_separate_shader_objects - CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_separate_shader_objects */ -#ifdef GL_ARB_shader_atomic_counters - CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_atomic_counters */ -#ifdef GL_ARB_shader_bit_encoding - CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); -#endif /* GL_ARB_shader_bit_encoding */ -#ifdef GL_ARB_shader_image_load_store - CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_image_load_store */ -#ifdef GL_ARB_shader_image_size - CONST_CAST(GLEW_ARB_shader_image_size) = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); -#endif /* GL_ARB_shader_image_size */ -#ifdef GL_ARB_shader_objects - CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_objects */ -#ifdef GL_ARB_shader_precision - CONST_CAST(GLEW_ARB_shader_precision) = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); -#endif /* GL_ARB_shader_precision */ -#ifdef GL_ARB_shader_stencil_export - CONST_CAST(GLEW_ARB_shader_stencil_export) = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); -#endif /* GL_ARB_shader_stencil_export */ -#ifdef GL_ARB_shader_storage_buffer_object - CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_storage_buffer_object */ -#ifdef GL_ARB_shader_subroutine - CONST_CAST(GLEW_ARB_shader_subroutine) = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_subroutine */ -#ifdef GL_ARB_shader_texture_lod - CONST_CAST(GLEW_ARB_shader_texture_lod) = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); -#endif /* GL_ARB_shader_texture_lod */ -#ifdef GL_ARB_shading_language_100 - CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); -#endif /* GL_ARB_shading_language_100 */ -#ifdef GL_ARB_shading_language_420pack - CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); -#endif /* GL_ARB_shading_language_420pack */ -#ifdef GL_ARB_shading_language_include - CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shading_language_include */ -#ifdef GL_ARB_shading_language_packing - CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); -#endif /* GL_ARB_shading_language_packing */ -#ifdef GL_ARB_shadow - CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); -#endif /* GL_ARB_shadow */ -#ifdef GL_ARB_shadow_ambient - CONST_CAST(GLEW_ARB_shadow_ambient) = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); -#endif /* GL_ARB_shadow_ambient */ -#ifdef GL_ARB_stencil_texturing - CONST_CAST(GLEW_ARB_stencil_texturing) = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); -#endif /* GL_ARB_stencil_texturing */ -#ifdef GL_ARB_sync - CONST_CAST(GLEW_ARB_sync) = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sync */ -#ifdef GL_ARB_tessellation_shader - CONST_CAST(GLEW_ARB_tessellation_shader) = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_tessellation_shader */ -#ifdef GL_ARB_texture_border_clamp - CONST_CAST(GLEW_ARB_texture_border_clamp) = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); -#endif /* GL_ARB_texture_border_clamp */ -#ifdef GL_ARB_texture_buffer_object - CONST_CAST(GLEW_ARB_texture_buffer_object) = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_buffer_object */ -#ifdef GL_ARB_texture_buffer_object_rgb32 - CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); -#endif /* GL_ARB_texture_buffer_object_rgb32 */ -#ifdef GL_ARB_texture_buffer_range - CONST_CAST(GLEW_ARB_texture_buffer_range) = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_buffer_range) CONST_CAST(GLEW_ARB_texture_buffer_range) = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_buffer_range */ -#ifdef GL_ARB_texture_compression - CONST_CAST(GLEW_ARB_texture_compression) = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_compression */ -#ifdef GL_ARB_texture_compression_bptc - CONST_CAST(GLEW_ARB_texture_compression_bptc) = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); -#endif /* GL_ARB_texture_compression_bptc */ -#ifdef GL_ARB_texture_compression_rgtc - CONST_CAST(GLEW_ARB_texture_compression_rgtc) = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); -#endif /* GL_ARB_texture_compression_rgtc */ -#ifdef GL_ARB_texture_cube_map - CONST_CAST(GLEW_ARB_texture_cube_map) = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); -#endif /* GL_ARB_texture_cube_map */ -#ifdef GL_ARB_texture_cube_map_array - CONST_CAST(GLEW_ARB_texture_cube_map_array) = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); -#endif /* GL_ARB_texture_cube_map_array */ -#ifdef GL_ARB_texture_env_add - CONST_CAST(GLEW_ARB_texture_env_add) = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); -#endif /* GL_ARB_texture_env_add */ -#ifdef GL_ARB_texture_env_combine - CONST_CAST(GLEW_ARB_texture_env_combine) = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); -#endif /* GL_ARB_texture_env_combine */ -#ifdef GL_ARB_texture_env_crossbar - CONST_CAST(GLEW_ARB_texture_env_crossbar) = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); -#endif /* GL_ARB_texture_env_crossbar */ -#ifdef GL_ARB_texture_env_dot3 - CONST_CAST(GLEW_ARB_texture_env_dot3) = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); -#endif /* GL_ARB_texture_env_dot3 */ -#ifdef GL_ARB_texture_float - CONST_CAST(GLEW_ARB_texture_float) = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); -#endif /* GL_ARB_texture_float */ -#ifdef GL_ARB_texture_gather - CONST_CAST(GLEW_ARB_texture_gather) = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); -#endif /* GL_ARB_texture_gather */ -#ifdef GL_ARB_texture_mirrored_repeat - CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); -#endif /* GL_ARB_texture_mirrored_repeat */ -#ifdef GL_ARB_texture_multisample - CONST_CAST(GLEW_ARB_texture_multisample) = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_multisample */ -#ifdef GL_ARB_texture_non_power_of_two - CONST_CAST(GLEW_ARB_texture_non_power_of_two) = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); -#endif /* GL_ARB_texture_non_power_of_two */ -#ifdef GL_ARB_texture_query_levels - CONST_CAST(GLEW_ARB_texture_query_levels) = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); -#endif /* GL_ARB_texture_query_levels */ -#ifdef GL_ARB_texture_query_lod - CONST_CAST(GLEW_ARB_texture_query_lod) = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); -#endif /* GL_ARB_texture_query_lod */ -#ifdef GL_ARB_texture_rectangle - CONST_CAST(GLEW_ARB_texture_rectangle) = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); -#endif /* GL_ARB_texture_rectangle */ -#ifdef GL_ARB_texture_rg - CONST_CAST(GLEW_ARB_texture_rg) = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); -#endif /* GL_ARB_texture_rg */ -#ifdef GL_ARB_texture_rgb10_a2ui - CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); -#endif /* GL_ARB_texture_rgb10_a2ui */ -#ifdef GL_ARB_texture_storage - CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_storage */ -#ifdef GL_ARB_texture_storage_multisample - CONST_CAST(GLEW_ARB_texture_storage_multisample) = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_storage_multisample) CONST_CAST(GLEW_ARB_texture_storage_multisample) = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_storage_multisample */ -#ifdef GL_ARB_texture_swizzle - CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); -#endif /* GL_ARB_texture_swizzle */ -#ifdef GL_ARB_texture_view - CONST_CAST(GLEW_ARB_texture_view) = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_view) CONST_CAST(GLEW_ARB_texture_view) = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_view */ -#ifdef GL_ARB_timer_query - CONST_CAST(GLEW_ARB_timer_query) = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_timer_query */ -#ifdef GL_ARB_transform_feedback2 - CONST_CAST(GLEW_ARB_transform_feedback2) = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback2 */ -#ifdef GL_ARB_transform_feedback3 - CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback3 */ -#ifdef GL_ARB_transform_feedback_instanced - CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback_instanced */ -#ifdef GL_ARB_transpose_matrix - CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transpose_matrix */ -#ifdef GL_ARB_uniform_buffer_object - CONST_CAST(GLEW_ARB_uniform_buffer_object) = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_uniform_buffer_object */ -#ifdef GL_ARB_vertex_array_bgra - CONST_CAST(GLEW_ARB_vertex_array_bgra) = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); -#endif /* GL_ARB_vertex_array_bgra */ -#ifdef GL_ARB_vertex_array_object - CONST_CAST(GLEW_ARB_vertex_array_object) = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_array_object */ -#ifdef GL_ARB_vertex_attrib_64bit - CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_attrib_64bit */ -#ifdef GL_ARB_vertex_attrib_binding - CONST_CAST(GLEW_ARB_vertex_attrib_binding) = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_attrib_binding) CONST_CAST(GLEW_ARB_vertex_attrib_binding) = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_attrib_binding */ -#ifdef GL_ARB_vertex_blend - CONST_CAST(GLEW_ARB_vertex_blend) = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_blend */ -#ifdef GL_ARB_vertex_buffer_object - CONST_CAST(GLEW_ARB_vertex_buffer_object) = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_buffer_object */ -#ifdef GL_ARB_vertex_program - CONST_CAST(GLEW_ARB_vertex_program) = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_program */ -#ifdef GL_ARB_vertex_shader - CONST_CAST(GLEW_ARB_vertex_shader) = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_shader */ -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ -#ifdef GL_ARB_viewport_array - CONST_CAST(GLEW_ARB_viewport_array) = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); - if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_viewport_array */ -#ifdef GL_ARB_window_pos - CONST_CAST(GLEW_ARB_window_pos) = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); - if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_window_pos */ -#ifdef GL_ATIX_point_sprites - CONST_CAST(GLEW_ATIX_point_sprites) = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); -#endif /* GL_ATIX_point_sprites */ -#ifdef GL_ATIX_texture_env_combine3 - CONST_CAST(GLEW_ATIX_texture_env_combine3) = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); -#endif /* GL_ATIX_texture_env_combine3 */ -#ifdef GL_ATIX_texture_env_route - CONST_CAST(GLEW_ATIX_texture_env_route) = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); -#endif /* GL_ATIX_texture_env_route */ -#ifdef GL_ATIX_vertex_shader_output_point_size - CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); -#endif /* GL_ATIX_vertex_shader_output_point_size */ -#ifdef GL_ATI_draw_buffers - CONST_CAST(GLEW_ATI_draw_buffers) = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); - if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_draw_buffers */ -#ifdef GL_ATI_element_array - CONST_CAST(GLEW_ATI_element_array) = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); - if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_element_array */ -#ifdef GL_ATI_envmap_bumpmap - CONST_CAST(GLEW_ATI_envmap_bumpmap) = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); - if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_envmap_bumpmap */ -#ifdef GL_ATI_fragment_shader - CONST_CAST(GLEW_ATI_fragment_shader) = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); - if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_fragment_shader */ -#ifdef GL_ATI_map_object_buffer - CONST_CAST(GLEW_ATI_map_object_buffer) = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); - if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_map_object_buffer */ -#ifdef GL_ATI_meminfo - CONST_CAST(GLEW_ATI_meminfo) = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); -#endif /* GL_ATI_meminfo */ -#ifdef GL_ATI_pn_triangles - CONST_CAST(GLEW_ATI_pn_triangles) = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); - if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_pn_triangles */ -#ifdef GL_ATI_separate_stencil - CONST_CAST(GLEW_ATI_separate_stencil) = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); - if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_separate_stencil */ -#ifdef GL_ATI_shader_texture_lod - CONST_CAST(GLEW_ATI_shader_texture_lod) = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); -#endif /* GL_ATI_shader_texture_lod */ -#ifdef GL_ATI_text_fragment_shader - CONST_CAST(GLEW_ATI_text_fragment_shader) = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); -#endif /* GL_ATI_text_fragment_shader */ -#ifdef GL_ATI_texture_compression_3dc - CONST_CAST(GLEW_ATI_texture_compression_3dc) = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); -#endif /* GL_ATI_texture_compression_3dc */ -#ifdef GL_ATI_texture_env_combine3 - CONST_CAST(GLEW_ATI_texture_env_combine3) = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); -#endif /* GL_ATI_texture_env_combine3 */ -#ifdef GL_ATI_texture_float - CONST_CAST(GLEW_ATI_texture_float) = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); -#endif /* GL_ATI_texture_float */ -#ifdef GL_ATI_texture_mirror_once - CONST_CAST(GLEW_ATI_texture_mirror_once) = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); -#endif /* GL_ATI_texture_mirror_once */ -#ifdef GL_ATI_vertex_array_object - CONST_CAST(GLEW_ATI_vertex_array_object) = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_array_object */ -#ifdef GL_ATI_vertex_attrib_array_object - CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_attrib_array_object */ -#ifdef GL_ATI_vertex_streams - CONST_CAST(GLEW_ATI_vertex_streams) = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_streams */ -#ifdef GL_EXT_422_pixels - CONST_CAST(GLEW_EXT_422_pixels) = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); -#endif /* GL_EXT_422_pixels */ -#ifdef GL_EXT_Cg_shader - CONST_CAST(GLEW_EXT_Cg_shader) = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); -#endif /* GL_EXT_Cg_shader */ -#ifdef GL_EXT_abgr - CONST_CAST(GLEW_EXT_abgr) = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); -#endif /* GL_EXT_abgr */ -#ifdef GL_EXT_bgra - CONST_CAST(GLEW_EXT_bgra) = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); -#endif /* GL_EXT_bgra */ -#ifdef GL_EXT_bindable_uniform - CONST_CAST(GLEW_EXT_bindable_uniform) = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); - if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_bindable_uniform */ -#ifdef GL_EXT_blend_color - CONST_CAST(GLEW_EXT_blend_color) = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_color */ -#ifdef GL_EXT_blend_equation_separate - CONST_CAST(GLEW_EXT_blend_equation_separate) = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_equation_separate */ -#ifdef GL_EXT_blend_func_separate - CONST_CAST(GLEW_EXT_blend_func_separate) = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_func_separate */ -#ifdef GL_EXT_blend_logic_op - CONST_CAST(GLEW_EXT_blend_logic_op) = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); -#endif /* GL_EXT_blend_logic_op */ -#ifdef GL_EXT_blend_minmax - CONST_CAST(GLEW_EXT_blend_minmax) = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_minmax */ -#ifdef GL_EXT_blend_subtract - CONST_CAST(GLEW_EXT_blend_subtract) = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); -#endif /* GL_EXT_blend_subtract */ -#ifdef GL_EXT_clip_volume_hint - CONST_CAST(GLEW_EXT_clip_volume_hint) = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); -#endif /* GL_EXT_clip_volume_hint */ -#ifdef GL_EXT_cmyka - CONST_CAST(GLEW_EXT_cmyka) = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); -#endif /* GL_EXT_cmyka */ -#ifdef GL_EXT_color_subtable - CONST_CAST(GLEW_EXT_color_subtable) = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); - if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_color_subtable */ -#ifdef GL_EXT_compiled_vertex_array - CONST_CAST(GLEW_EXT_compiled_vertex_array) = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_compiled_vertex_array */ -#ifdef GL_EXT_convolution - CONST_CAST(GLEW_EXT_convolution) = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); - if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_convolution */ -#ifdef GL_EXT_coordinate_frame - CONST_CAST(GLEW_EXT_coordinate_frame) = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); - if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_coordinate_frame */ -#ifdef GL_EXT_copy_texture - CONST_CAST(GLEW_EXT_copy_texture) = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_copy_texture */ -#ifdef GL_EXT_cull_vertex - CONST_CAST(GLEW_EXT_cull_vertex) = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); - if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_cull_vertex */ -#ifdef GL_EXT_debug_marker - CONST_CAST(GLEW_EXT_debug_marker) = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); - if (glewExperimental || GLEW_EXT_debug_marker) CONST_CAST(GLEW_EXT_debug_marker) = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_debug_marker */ -#ifdef GL_EXT_depth_bounds_test - CONST_CAST(GLEW_EXT_depth_bounds_test) = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); - if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_depth_bounds_test */ -#ifdef GL_EXT_direct_state_access - CONST_CAST(GLEW_EXT_direct_state_access) = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); - if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_direct_state_access */ -#ifdef GL_EXT_draw_buffers2 - CONST_CAST(GLEW_EXT_draw_buffers2) = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_buffers2 */ -#ifdef GL_EXT_draw_instanced - CONST_CAST(GLEW_EXT_draw_instanced) = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_instanced */ -#ifdef GL_EXT_draw_range_elements - CONST_CAST(GLEW_EXT_draw_range_elements) = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_range_elements */ -#ifdef GL_EXT_fog_coord - CONST_CAST(GLEW_EXT_fog_coord) = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); - if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_fog_coord */ -#ifdef GL_EXT_fragment_lighting - CONST_CAST(GLEW_EXT_fragment_lighting) = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); - if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_fragment_lighting */ -#ifdef GL_EXT_framebuffer_blit - CONST_CAST(GLEW_EXT_framebuffer_blit) = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_blit */ -#ifdef GL_EXT_framebuffer_multisample - CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_multisample */ -#ifdef GL_EXT_framebuffer_multisample_blit_scaled - CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ -#ifdef GL_EXT_framebuffer_object - CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_object */ -#ifdef GL_EXT_framebuffer_sRGB - CONST_CAST(GLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* GL_EXT_framebuffer_sRGB */ -#ifdef GL_EXT_geometry_shader4 - CONST_CAST(GLEW_EXT_geometry_shader4) = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); - if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_geometry_shader4 */ -#ifdef GL_EXT_gpu_program_parameters - CONST_CAST(GLEW_EXT_gpu_program_parameters) = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); - if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_gpu_program_parameters */ -#ifdef GL_EXT_gpu_shader4 - CONST_CAST(GLEW_EXT_gpu_shader4) = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); - if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_gpu_shader4 */ -#ifdef GL_EXT_histogram - CONST_CAST(GLEW_EXT_histogram) = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); - if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_histogram */ -#ifdef GL_EXT_index_array_formats - CONST_CAST(GLEW_EXT_index_array_formats) = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); -#endif /* GL_EXT_index_array_formats */ -#ifdef GL_EXT_index_func - CONST_CAST(GLEW_EXT_index_func) = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); - if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_index_func */ -#ifdef GL_EXT_index_material - CONST_CAST(GLEW_EXT_index_material) = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); - if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_index_material */ -#ifdef GL_EXT_index_texture - CONST_CAST(GLEW_EXT_index_texture) = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); -#endif /* GL_EXT_index_texture */ -#ifdef GL_EXT_light_texture - CONST_CAST(GLEW_EXT_light_texture) = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_light_texture */ -#ifdef GL_EXT_misc_attribute - CONST_CAST(GLEW_EXT_misc_attribute) = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); -#endif /* GL_EXT_misc_attribute */ -#ifdef GL_EXT_multi_draw_arrays - CONST_CAST(GLEW_EXT_multi_draw_arrays) = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); - if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_multi_draw_arrays */ -#ifdef GL_EXT_multisample - CONST_CAST(GLEW_EXT_multisample) = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); - if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_multisample */ -#ifdef GL_EXT_packed_depth_stencil - CONST_CAST(GLEW_EXT_packed_depth_stencil) = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); -#endif /* GL_EXT_packed_depth_stencil */ -#ifdef GL_EXT_packed_float - CONST_CAST(GLEW_EXT_packed_float) = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); -#endif /* GL_EXT_packed_float */ -#ifdef GL_EXT_packed_pixels - CONST_CAST(GLEW_EXT_packed_pixels) = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); -#endif /* GL_EXT_packed_pixels */ -#ifdef GL_EXT_paletted_texture - CONST_CAST(GLEW_EXT_paletted_texture) = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_paletted_texture */ -#ifdef GL_EXT_pixel_buffer_object - CONST_CAST(GLEW_EXT_pixel_buffer_object) = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); -#endif /* GL_EXT_pixel_buffer_object */ -#ifdef GL_EXT_pixel_transform - CONST_CAST(GLEW_EXT_pixel_transform) = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); - if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_pixel_transform */ -#ifdef GL_EXT_pixel_transform_color_table - CONST_CAST(GLEW_EXT_pixel_transform_color_table) = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); -#endif /* GL_EXT_pixel_transform_color_table */ -#ifdef GL_EXT_point_parameters - CONST_CAST(GLEW_EXT_point_parameters) = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); - if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_point_parameters */ -#ifdef GL_EXT_polygon_offset - CONST_CAST(GLEW_EXT_polygon_offset) = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); - if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_polygon_offset */ -#ifdef GL_EXT_provoking_vertex - CONST_CAST(GLEW_EXT_provoking_vertex) = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); - if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_provoking_vertex */ -#ifdef GL_EXT_rescale_normal - CONST_CAST(GLEW_EXT_rescale_normal) = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); -#endif /* GL_EXT_rescale_normal */ -#ifdef GL_EXT_scene_marker - CONST_CAST(GLEW_EXT_scene_marker) = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); - if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_scene_marker */ -#ifdef GL_EXT_secondary_color - CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); - if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_secondary_color */ -#ifdef GL_EXT_separate_shader_objects - CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_separate_shader_objects */ -#ifdef GL_EXT_separate_specular_color - CONST_CAST(GLEW_EXT_separate_specular_color) = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); -#endif /* GL_EXT_separate_specular_color */ -#ifdef GL_EXT_shader_image_load_store - CONST_CAST(GLEW_EXT_shader_image_load_store) = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); - if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_shader_image_load_store */ -#ifdef GL_EXT_shadow_funcs - CONST_CAST(GLEW_EXT_shadow_funcs) = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); -#endif /* GL_EXT_shadow_funcs */ -#ifdef GL_EXT_shared_texture_palette - CONST_CAST(GLEW_EXT_shared_texture_palette) = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); -#endif /* GL_EXT_shared_texture_palette */ -#ifdef GL_EXT_stencil_clear_tag - CONST_CAST(GLEW_EXT_stencil_clear_tag) = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); -#endif /* GL_EXT_stencil_clear_tag */ -#ifdef GL_EXT_stencil_two_side - CONST_CAST(GLEW_EXT_stencil_two_side) = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); - if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_stencil_two_side */ -#ifdef GL_EXT_stencil_wrap - CONST_CAST(GLEW_EXT_stencil_wrap) = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); -#endif /* GL_EXT_stencil_wrap */ -#ifdef GL_EXT_subtexture - CONST_CAST(GLEW_EXT_subtexture) = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_subtexture */ -#ifdef GL_EXT_texture - CONST_CAST(GLEW_EXT_texture) = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); -#endif /* GL_EXT_texture */ -#ifdef GL_EXT_texture3D - CONST_CAST(GLEW_EXT_texture3D) = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture3D */ -#ifdef GL_EXT_texture_array - CONST_CAST(GLEW_EXT_texture_array) = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_array) CONST_CAST(GLEW_EXT_texture_array) = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_array */ -#ifdef GL_EXT_texture_buffer_object - CONST_CAST(GLEW_EXT_texture_buffer_object) = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_buffer_object */ -#ifdef GL_EXT_texture_compression_dxt1 - CONST_CAST(GLEW_EXT_texture_compression_dxt1) = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); -#endif /* GL_EXT_texture_compression_dxt1 */ -#ifdef GL_EXT_texture_compression_latc - CONST_CAST(GLEW_EXT_texture_compression_latc) = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_latc */ -#ifdef GL_EXT_texture_compression_rgtc - CONST_CAST(GLEW_EXT_texture_compression_rgtc) = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_rgtc */ -#ifdef GL_EXT_texture_compression_s3tc - CONST_CAST(GLEW_EXT_texture_compression_s3tc) = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_s3tc */ -#ifdef GL_EXT_texture_cube_map - CONST_CAST(GLEW_EXT_texture_cube_map) = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); -#endif /* GL_EXT_texture_cube_map */ -#ifdef GL_EXT_texture_edge_clamp - CONST_CAST(GLEW_EXT_texture_edge_clamp) = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); -#endif /* GL_EXT_texture_edge_clamp */ -#ifdef GL_EXT_texture_env - CONST_CAST(GLEW_EXT_texture_env) = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); -#endif /* GL_EXT_texture_env */ -#ifdef GL_EXT_texture_env_add - CONST_CAST(GLEW_EXT_texture_env_add) = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); -#endif /* GL_EXT_texture_env_add */ -#ifdef GL_EXT_texture_env_combine - CONST_CAST(GLEW_EXT_texture_env_combine) = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); -#endif /* GL_EXT_texture_env_combine */ -#ifdef GL_EXT_texture_env_dot3 - CONST_CAST(GLEW_EXT_texture_env_dot3) = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); -#endif /* GL_EXT_texture_env_dot3 */ -#ifdef GL_EXT_texture_filter_anisotropic - CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); -#endif /* GL_EXT_texture_filter_anisotropic */ -#ifdef GL_EXT_texture_integer - CONST_CAST(GLEW_EXT_texture_integer) = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_integer */ -#ifdef GL_EXT_texture_lod_bias - CONST_CAST(GLEW_EXT_texture_lod_bias) = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); -#endif /* GL_EXT_texture_lod_bias */ -#ifdef GL_EXT_texture_mirror_clamp - CONST_CAST(GLEW_EXT_texture_mirror_clamp) = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); -#endif /* GL_EXT_texture_mirror_clamp */ -#ifdef GL_EXT_texture_object - CONST_CAST(GLEW_EXT_texture_object) = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_object */ -#ifdef GL_EXT_texture_perturb_normal - CONST_CAST(GLEW_EXT_texture_perturb_normal) = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_perturb_normal */ -#ifdef GL_EXT_texture_rectangle - CONST_CAST(GLEW_EXT_texture_rectangle) = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); -#endif /* GL_EXT_texture_rectangle */ -#ifdef GL_EXT_texture_sRGB - CONST_CAST(GLEW_EXT_texture_sRGB) = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); -#endif /* GL_EXT_texture_sRGB */ -#ifdef GL_EXT_texture_sRGB_decode - CONST_CAST(GLEW_EXT_texture_sRGB_decode) = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); -#endif /* GL_EXT_texture_sRGB_decode */ -#ifdef GL_EXT_texture_shared_exponent - CONST_CAST(GLEW_EXT_texture_shared_exponent) = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); -#endif /* GL_EXT_texture_shared_exponent */ -#ifdef GL_EXT_texture_snorm - CONST_CAST(GLEW_EXT_texture_snorm) = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); -#endif /* GL_EXT_texture_snorm */ -#ifdef GL_EXT_texture_swizzle - CONST_CAST(GLEW_EXT_texture_swizzle) = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); -#endif /* GL_EXT_texture_swizzle */ -#ifdef GL_EXT_timer_query - CONST_CAST(GLEW_EXT_timer_query) = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); - if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_timer_query */ -#ifdef GL_EXT_transform_feedback - CONST_CAST(GLEW_EXT_transform_feedback) = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); - if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_transform_feedback */ -#ifdef GL_EXT_vertex_array - CONST_CAST(GLEW_EXT_vertex_array) = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_array */ -#ifdef GL_EXT_vertex_array_bgra - CONST_CAST(GLEW_EXT_vertex_array_bgra) = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); -#endif /* GL_EXT_vertex_array_bgra */ -#ifdef GL_EXT_vertex_attrib_64bit - CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_attrib_64bit */ -#ifdef GL_EXT_vertex_shader - CONST_CAST(GLEW_EXT_vertex_shader) = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_shader */ -#ifdef GL_EXT_vertex_weighting - CONST_CAST(GLEW_EXT_vertex_weighting) = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_weighting */ -#ifdef GL_EXT_x11_sync_object - CONST_CAST(GLEW_EXT_x11_sync_object) = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_x11_sync_object) CONST_CAST(GLEW_EXT_x11_sync_object) = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_x11_sync_object */ -#ifdef GL_GREMEDY_frame_terminator - CONST_CAST(GLEW_GREMEDY_frame_terminator) = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); - if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_GREMEDY_frame_terminator */ -#ifdef GL_GREMEDY_string_marker - CONST_CAST(GLEW_GREMEDY_string_marker) = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); - if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_GREMEDY_string_marker */ -#ifdef GL_HP_convolution_border_modes - CONST_CAST(GLEW_HP_convolution_border_modes) = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); -#endif /* GL_HP_convolution_border_modes */ -#ifdef GL_HP_image_transform - CONST_CAST(GLEW_HP_image_transform) = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); - if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_HP_image_transform */ -#ifdef GL_HP_occlusion_test - CONST_CAST(GLEW_HP_occlusion_test) = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); -#endif /* GL_HP_occlusion_test */ -#ifdef GL_HP_texture_lighting - CONST_CAST(GLEW_HP_texture_lighting) = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); -#endif /* GL_HP_texture_lighting */ -#ifdef GL_IBM_cull_vertex - CONST_CAST(GLEW_IBM_cull_vertex) = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); -#endif /* GL_IBM_cull_vertex */ -#ifdef GL_IBM_multimode_draw_arrays - CONST_CAST(GLEW_IBM_multimode_draw_arrays) = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); - if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_IBM_multimode_draw_arrays */ -#ifdef GL_IBM_rasterpos_clip - CONST_CAST(GLEW_IBM_rasterpos_clip) = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); -#endif /* GL_IBM_rasterpos_clip */ -#ifdef GL_IBM_static_data - CONST_CAST(GLEW_IBM_static_data) = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); -#endif /* GL_IBM_static_data */ -#ifdef GL_IBM_texture_mirrored_repeat - CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); -#endif /* GL_IBM_texture_mirrored_repeat */ -#ifdef GL_IBM_vertex_array_lists - CONST_CAST(GLEW_IBM_vertex_array_lists) = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); - if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_IBM_vertex_array_lists */ -#ifdef GL_INGR_color_clamp - CONST_CAST(GLEW_INGR_color_clamp) = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); -#endif /* GL_INGR_color_clamp */ -#ifdef GL_INGR_interlace_read - CONST_CAST(GLEW_INGR_interlace_read) = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); -#endif /* GL_INGR_interlace_read */ -#ifdef GL_INTEL_parallel_arrays - CONST_CAST(GLEW_INTEL_parallel_arrays) = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_parallel_arrays */ -#ifdef GL_INTEL_texture_scissor - CONST_CAST(GLEW_INTEL_texture_scissor) = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_texture_scissor */ -#ifdef GL_KHR_debug - CONST_CAST(GLEW_KHR_debug) = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); - if (glewExperimental || GLEW_KHR_debug) CONST_CAST(GLEW_KHR_debug) = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KHR_debug */ -#ifdef GL_KHR_texture_compression_astc_ldr - CONST_CAST(GLEW_KHR_texture_compression_astc_ldr) = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); -#endif /* GL_KHR_texture_compression_astc_ldr */ -#ifdef GL_KTX_buffer_region - CONST_CAST(GLEW_KTX_buffer_region) = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); - if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KTX_buffer_region */ -#ifdef GL_MESAX_texture_stack - CONST_CAST(GLEW_MESAX_texture_stack) = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); -#endif /* GL_MESAX_texture_stack */ -#ifdef GL_MESA_pack_invert - CONST_CAST(GLEW_MESA_pack_invert) = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); -#endif /* GL_MESA_pack_invert */ -#ifdef GL_MESA_resize_buffers - CONST_CAST(GLEW_MESA_resize_buffers) = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); - if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_MESA_resize_buffers */ -#ifdef GL_MESA_window_pos - CONST_CAST(GLEW_MESA_window_pos) = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); - if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_MESA_window_pos */ -#ifdef GL_MESA_ycbcr_texture - CONST_CAST(GLEW_MESA_ycbcr_texture) = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); -#endif /* GL_MESA_ycbcr_texture */ -#ifdef GL_NVX_gpu_memory_info - CONST_CAST(GLEW_NVX_gpu_memory_info) = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); -#endif /* GL_NVX_gpu_memory_info */ -#ifdef GL_NV_bindless_texture - CONST_CAST(GLEW_NV_bindless_texture) = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); - if (glewExperimental || GLEW_NV_bindless_texture) CONST_CAST(GLEW_NV_bindless_texture) = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_bindless_texture */ -#ifdef GL_NV_blend_square - CONST_CAST(GLEW_NV_blend_square) = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); -#endif /* GL_NV_blend_square */ -#ifdef GL_NV_conditional_render - CONST_CAST(GLEW_NV_conditional_render) = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); - if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_conditional_render */ -#ifdef GL_NV_copy_depth_to_color - CONST_CAST(GLEW_NV_copy_depth_to_color) = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); -#endif /* GL_NV_copy_depth_to_color */ -#ifdef GL_NV_copy_image - CONST_CAST(GLEW_NV_copy_image) = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); - if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_copy_image */ -#ifdef GL_NV_depth_buffer_float - CONST_CAST(GLEW_NV_depth_buffer_float) = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); - if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_depth_buffer_float */ -#ifdef GL_NV_depth_clamp - CONST_CAST(GLEW_NV_depth_clamp) = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); -#endif /* GL_NV_depth_clamp */ -#ifdef GL_NV_depth_range_unclamped - CONST_CAST(GLEW_NV_depth_range_unclamped) = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); -#endif /* GL_NV_depth_range_unclamped */ -#ifdef GL_NV_evaluators - CONST_CAST(GLEW_NV_evaluators) = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); - if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_evaluators */ -#ifdef GL_NV_explicit_multisample - CONST_CAST(GLEW_NV_explicit_multisample) = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); - if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_explicit_multisample */ -#ifdef GL_NV_fence - CONST_CAST(GLEW_NV_fence) = _glewSearchExtension("GL_NV_fence", extStart, extEnd); - if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_fence */ -#ifdef GL_NV_float_buffer - CONST_CAST(GLEW_NV_float_buffer) = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); -#endif /* GL_NV_float_buffer */ -#ifdef GL_NV_fog_distance - CONST_CAST(GLEW_NV_fog_distance) = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); -#endif /* GL_NV_fog_distance */ -#ifdef GL_NV_fragment_program - CONST_CAST(GLEW_NV_fragment_program) = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); - if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_fragment_program */ -#ifdef GL_NV_fragment_program2 - CONST_CAST(GLEW_NV_fragment_program2) = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); -#endif /* GL_NV_fragment_program2 */ -#ifdef GL_NV_fragment_program4 - CONST_CAST(GLEW_NV_fragment_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); -#endif /* GL_NV_fragment_program4 */ -#ifdef GL_NV_fragment_program_option - CONST_CAST(GLEW_NV_fragment_program_option) = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); -#endif /* GL_NV_fragment_program_option */ -#ifdef GL_NV_framebuffer_multisample_coverage - CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); - if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_framebuffer_multisample_coverage */ -#ifdef GL_NV_geometry_program4 - CONST_CAST(GLEW_NV_geometry_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); - if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_geometry_program4 */ -#ifdef GL_NV_geometry_shader4 - CONST_CAST(GLEW_NV_geometry_shader4) = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); -#endif /* GL_NV_geometry_shader4 */ -#ifdef GL_NV_gpu_program4 - CONST_CAST(GLEW_NV_gpu_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); - if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_gpu_program4 */ -#ifdef GL_NV_gpu_program5 - CONST_CAST(GLEW_NV_gpu_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); -#endif /* GL_NV_gpu_program5 */ -#ifdef GL_NV_gpu_program_fp64 - CONST_CAST(GLEW_NV_gpu_program_fp64) = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); -#endif /* GL_NV_gpu_program_fp64 */ -#ifdef GL_NV_gpu_shader5 - CONST_CAST(GLEW_NV_gpu_shader5) = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); - if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_gpu_shader5 */ -#ifdef GL_NV_half_float - CONST_CAST(GLEW_NV_half_float) = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); - if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_half_float */ -#ifdef GL_NV_light_max_exponent - CONST_CAST(GLEW_NV_light_max_exponent) = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); -#endif /* GL_NV_light_max_exponent */ -#ifdef GL_NV_multisample_coverage - CONST_CAST(GLEW_NV_multisample_coverage) = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); -#endif /* GL_NV_multisample_coverage */ -#ifdef GL_NV_multisample_filter_hint - CONST_CAST(GLEW_NV_multisample_filter_hint) = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); -#endif /* GL_NV_multisample_filter_hint */ -#ifdef GL_NV_occlusion_query - CONST_CAST(GLEW_NV_occlusion_query) = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); - if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_occlusion_query */ -#ifdef GL_NV_packed_depth_stencil - CONST_CAST(GLEW_NV_packed_depth_stencil) = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); -#endif /* GL_NV_packed_depth_stencil */ -#ifdef GL_NV_parameter_buffer_object - CONST_CAST(GLEW_NV_parameter_buffer_object) = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_parameter_buffer_object */ -#ifdef GL_NV_parameter_buffer_object2 - CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); -#endif /* GL_NV_parameter_buffer_object2 */ -#ifdef GL_NV_path_rendering - CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); - if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_path_rendering */ -#ifdef GL_NV_pixel_data_range - CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); - if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_pixel_data_range */ -#ifdef GL_NV_point_sprite - CONST_CAST(GLEW_NV_point_sprite) = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); - if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_point_sprite */ -#ifdef GL_NV_present_video - CONST_CAST(GLEW_NV_present_video) = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); - if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_present_video */ -#ifdef GL_NV_primitive_restart - CONST_CAST(GLEW_NV_primitive_restart) = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); - if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_primitive_restart */ -#ifdef GL_NV_register_combiners - CONST_CAST(GLEW_NV_register_combiners) = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); - if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_register_combiners */ -#ifdef GL_NV_register_combiners2 - CONST_CAST(GLEW_NV_register_combiners2) = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); - if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_register_combiners2 */ -#ifdef GL_NV_shader_atomic_float - CONST_CAST(GLEW_NV_shader_atomic_float) = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); -#endif /* GL_NV_shader_atomic_float */ -#ifdef GL_NV_shader_buffer_load - CONST_CAST(GLEW_NV_shader_buffer_load) = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); - if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_shader_buffer_load */ -#ifdef GL_NV_tessellation_program5 - CONST_CAST(GLEW_NV_tessellation_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); -#endif /* GL_NV_tessellation_program5 */ -#ifdef GL_NV_texgen_emboss - CONST_CAST(GLEW_NV_texgen_emboss) = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); -#endif /* GL_NV_texgen_emboss */ -#ifdef GL_NV_texgen_reflection - CONST_CAST(GLEW_NV_texgen_reflection) = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); -#endif /* GL_NV_texgen_reflection */ -#ifdef GL_NV_texture_barrier - CONST_CAST(GLEW_NV_texture_barrier) = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); - if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_texture_barrier */ -#ifdef GL_NV_texture_compression_vtc - CONST_CAST(GLEW_NV_texture_compression_vtc) = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); -#endif /* GL_NV_texture_compression_vtc */ -#ifdef GL_NV_texture_env_combine4 - CONST_CAST(GLEW_NV_texture_env_combine4) = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); -#endif /* GL_NV_texture_env_combine4 */ -#ifdef GL_NV_texture_expand_normal - CONST_CAST(GLEW_NV_texture_expand_normal) = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); -#endif /* GL_NV_texture_expand_normal */ -#ifdef GL_NV_texture_multisample - CONST_CAST(GLEW_NV_texture_multisample) = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); - if (glewExperimental || GLEW_NV_texture_multisample) CONST_CAST(GLEW_NV_texture_multisample) = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_texture_multisample */ -#ifdef GL_NV_texture_rectangle - CONST_CAST(GLEW_NV_texture_rectangle) = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); -#endif /* GL_NV_texture_rectangle */ -#ifdef GL_NV_texture_shader - CONST_CAST(GLEW_NV_texture_shader) = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); -#endif /* GL_NV_texture_shader */ -#ifdef GL_NV_texture_shader2 - CONST_CAST(GLEW_NV_texture_shader2) = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); -#endif /* GL_NV_texture_shader2 */ -#ifdef GL_NV_texture_shader3 - CONST_CAST(GLEW_NV_texture_shader3) = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); -#endif /* GL_NV_texture_shader3 */ -#ifdef GL_NV_transform_feedback - CONST_CAST(GLEW_NV_transform_feedback) = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); - if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_transform_feedback */ -#ifdef GL_NV_transform_feedback2 - CONST_CAST(GLEW_NV_transform_feedback2) = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); - if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_transform_feedback2 */ -#ifdef GL_NV_vdpau_interop - CONST_CAST(GLEW_NV_vdpau_interop) = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); - if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vdpau_interop */ -#ifdef GL_NV_vertex_array_range - CONST_CAST(GLEW_NV_vertex_array_range) = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_array_range */ -#ifdef GL_NV_vertex_array_range2 - CONST_CAST(GLEW_NV_vertex_array_range2) = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); -#endif /* GL_NV_vertex_array_range2 */ -#ifdef GL_NV_vertex_attrib_integer_64bit - CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_attrib_integer_64bit */ -#ifdef GL_NV_vertex_buffer_unified_memory - CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_buffer_unified_memory */ -#ifdef GL_NV_vertex_program - CONST_CAST(GLEW_NV_vertex_program) = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_program */ -#ifdef GL_NV_vertex_program1_1 - CONST_CAST(GLEW_NV_vertex_program1_1) = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); -#endif /* GL_NV_vertex_program1_1 */ -#ifdef GL_NV_vertex_program2 - CONST_CAST(GLEW_NV_vertex_program2) = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); -#endif /* GL_NV_vertex_program2 */ -#ifdef GL_NV_vertex_program2_option - CONST_CAST(GLEW_NV_vertex_program2_option) = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); -#endif /* GL_NV_vertex_program2_option */ -#ifdef GL_NV_vertex_program3 - CONST_CAST(GLEW_NV_vertex_program3) = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); -#endif /* GL_NV_vertex_program3 */ -#ifdef GL_NV_vertex_program4 - CONST_CAST(GLEW_NV_vertex_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); -#endif /* GL_NV_vertex_program4 */ -#ifdef GL_NV_video_capture - CONST_CAST(GLEW_NV_video_capture) = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); - if (glewExperimental || GLEW_NV_video_capture) CONST_CAST(GLEW_NV_video_capture) = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_video_capture */ -#ifdef GL_OES_byte_coordinates - CONST_CAST(GLEW_OES_byte_coordinates) = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); -#endif /* GL_OES_byte_coordinates */ -#ifdef GL_OES_compressed_paletted_texture - CONST_CAST(GLEW_OES_compressed_paletted_texture) = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); -#endif /* GL_OES_compressed_paletted_texture */ -#ifdef GL_OES_read_format - CONST_CAST(GLEW_OES_read_format) = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); -#endif /* GL_OES_read_format */ -#ifdef GL_OES_single_precision - CONST_CAST(GLEW_OES_single_precision) = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); - if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_OES_single_precision */ -#ifdef GL_OML_interlace - CONST_CAST(GLEW_OML_interlace) = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); -#endif /* GL_OML_interlace */ -#ifdef GL_OML_resample - CONST_CAST(GLEW_OML_resample) = _glewSearchExtension("GL_OML_resample", extStart, extEnd); -#endif /* GL_OML_resample */ -#ifdef GL_OML_subsample - CONST_CAST(GLEW_OML_subsample) = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); -#endif /* GL_OML_subsample */ -#ifdef GL_PGI_misc_hints - CONST_CAST(GLEW_PGI_misc_hints) = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); -#endif /* GL_PGI_misc_hints */ -#ifdef GL_PGI_vertex_hints - CONST_CAST(GLEW_PGI_vertex_hints) = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); -#endif /* GL_PGI_vertex_hints */ -#ifdef GL_REGAL_error_string - CONST_CAST(GLEW_REGAL_error_string) = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_error_string) CONST_CAST(GLEW_REGAL_error_string) = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_error_string */ -#ifdef GL_REGAL_extension_query - CONST_CAST(GLEW_REGAL_extension_query) = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_extension_query) CONST_CAST(GLEW_REGAL_extension_query) = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_extension_query */ -#ifdef GL_REGAL_log - CONST_CAST(GLEW_REGAL_log) = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); -#endif /* GL_REGAL_log */ -#ifdef GL_REND_screen_coordinates - CONST_CAST(GLEW_REND_screen_coordinates) = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); -#endif /* GL_REND_screen_coordinates */ -#ifdef GL_S3_s3tc - CONST_CAST(GLEW_S3_s3tc) = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); -#endif /* GL_S3_s3tc */ -#ifdef GL_SGIS_color_range - CONST_CAST(GLEW_SGIS_color_range) = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); -#endif /* GL_SGIS_color_range */ -#ifdef GL_SGIS_detail_texture - CONST_CAST(GLEW_SGIS_detail_texture) = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_detail_texture */ -#ifdef GL_SGIS_fog_function - CONST_CAST(GLEW_SGIS_fog_function) = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_fog_function */ -#ifdef GL_SGIS_generate_mipmap - CONST_CAST(GLEW_SGIS_generate_mipmap) = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); -#endif /* GL_SGIS_generate_mipmap */ -#ifdef GL_SGIS_multisample - CONST_CAST(GLEW_SGIS_multisample) = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_multisample */ -#ifdef GL_SGIS_pixel_texture - CONST_CAST(GLEW_SGIS_pixel_texture) = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); -#endif /* GL_SGIS_pixel_texture */ -#ifdef GL_SGIS_point_line_texgen - CONST_CAST(GLEW_SGIS_point_line_texgen) = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); -#endif /* GL_SGIS_point_line_texgen */ -#ifdef GL_SGIS_sharpen_texture - CONST_CAST(GLEW_SGIS_sharpen_texture) = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_sharpen_texture */ -#ifdef GL_SGIS_texture4D - CONST_CAST(GLEW_SGIS_texture4D) = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_texture4D */ -#ifdef GL_SGIS_texture_border_clamp - CONST_CAST(GLEW_SGIS_texture_border_clamp) = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); -#endif /* GL_SGIS_texture_border_clamp */ -#ifdef GL_SGIS_texture_edge_clamp - CONST_CAST(GLEW_SGIS_texture_edge_clamp) = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); -#endif /* GL_SGIS_texture_edge_clamp */ -#ifdef GL_SGIS_texture_filter4 - CONST_CAST(GLEW_SGIS_texture_filter4) = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_texture_filter4 */ -#ifdef GL_SGIS_texture_lod - CONST_CAST(GLEW_SGIS_texture_lod) = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); -#endif /* GL_SGIS_texture_lod */ -#ifdef GL_SGIS_texture_select - CONST_CAST(GLEW_SGIS_texture_select) = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); -#endif /* GL_SGIS_texture_select */ -#ifdef GL_SGIX_async - CONST_CAST(GLEW_SGIX_async) = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_async */ -#ifdef GL_SGIX_async_histogram - CONST_CAST(GLEW_SGIX_async_histogram) = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); -#endif /* GL_SGIX_async_histogram */ -#ifdef GL_SGIX_async_pixel - CONST_CAST(GLEW_SGIX_async_pixel) = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); -#endif /* GL_SGIX_async_pixel */ -#ifdef GL_SGIX_blend_alpha_minmax - CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); -#endif /* GL_SGIX_blend_alpha_minmax */ -#ifdef GL_SGIX_clipmap - CONST_CAST(GLEW_SGIX_clipmap) = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); -#endif /* GL_SGIX_clipmap */ -#ifdef GL_SGIX_convolution_accuracy - CONST_CAST(GLEW_SGIX_convolution_accuracy) = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); -#endif /* GL_SGIX_convolution_accuracy */ -#ifdef GL_SGIX_depth_texture - CONST_CAST(GLEW_SGIX_depth_texture) = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); -#endif /* GL_SGIX_depth_texture */ -#ifdef GL_SGIX_flush_raster - CONST_CAST(GLEW_SGIX_flush_raster) = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_flush_raster */ -#ifdef GL_SGIX_fog_offset - CONST_CAST(GLEW_SGIX_fog_offset) = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); -#endif /* GL_SGIX_fog_offset */ -#ifdef GL_SGIX_fog_texture - CONST_CAST(GLEW_SGIX_fog_texture) = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_fog_texture */ -#ifdef GL_SGIX_fragment_specular_lighting - CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_fragment_specular_lighting */ -#ifdef GL_SGIX_framezoom - CONST_CAST(GLEW_SGIX_framezoom) = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_framezoom */ -#ifdef GL_SGIX_interlace - CONST_CAST(GLEW_SGIX_interlace) = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); -#endif /* GL_SGIX_interlace */ -#ifdef GL_SGIX_ir_instrument1 - CONST_CAST(GLEW_SGIX_ir_instrument1) = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); -#endif /* GL_SGIX_ir_instrument1 */ -#ifdef GL_SGIX_list_priority - CONST_CAST(GLEW_SGIX_list_priority) = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); -#endif /* GL_SGIX_list_priority */ -#ifdef GL_SGIX_pixel_texture - CONST_CAST(GLEW_SGIX_pixel_texture) = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_pixel_texture */ -#ifdef GL_SGIX_pixel_texture_bits - CONST_CAST(GLEW_SGIX_pixel_texture_bits) = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); -#endif /* GL_SGIX_pixel_texture_bits */ -#ifdef GL_SGIX_reference_plane - CONST_CAST(GLEW_SGIX_reference_plane) = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_reference_plane */ -#ifdef GL_SGIX_resample - CONST_CAST(GLEW_SGIX_resample) = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); -#endif /* GL_SGIX_resample */ -#ifdef GL_SGIX_shadow - CONST_CAST(GLEW_SGIX_shadow) = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); -#endif /* GL_SGIX_shadow */ -#ifdef GL_SGIX_shadow_ambient - CONST_CAST(GLEW_SGIX_shadow_ambient) = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); -#endif /* GL_SGIX_shadow_ambient */ -#ifdef GL_SGIX_sprite - CONST_CAST(GLEW_SGIX_sprite) = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_sprite */ -#ifdef GL_SGIX_tag_sample_buffer - CONST_CAST(GLEW_SGIX_tag_sample_buffer) = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_tag_sample_buffer */ -#ifdef GL_SGIX_texture_add_env - CONST_CAST(GLEW_SGIX_texture_add_env) = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); -#endif /* GL_SGIX_texture_add_env */ -#ifdef GL_SGIX_texture_coordinate_clamp - CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); -#endif /* GL_SGIX_texture_coordinate_clamp */ -#ifdef GL_SGIX_texture_lod_bias - CONST_CAST(GLEW_SGIX_texture_lod_bias) = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); -#endif /* GL_SGIX_texture_lod_bias */ -#ifdef GL_SGIX_texture_multi_buffer - CONST_CAST(GLEW_SGIX_texture_multi_buffer) = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); -#endif /* GL_SGIX_texture_multi_buffer */ -#ifdef GL_SGIX_texture_range - CONST_CAST(GLEW_SGIX_texture_range) = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); -#endif /* GL_SGIX_texture_range */ -#ifdef GL_SGIX_texture_scale_bias - CONST_CAST(GLEW_SGIX_texture_scale_bias) = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); -#endif /* GL_SGIX_texture_scale_bias */ -#ifdef GL_SGIX_vertex_preclip - CONST_CAST(GLEW_SGIX_vertex_preclip) = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); -#endif /* GL_SGIX_vertex_preclip */ -#ifdef GL_SGIX_vertex_preclip_hint - CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); -#endif /* GL_SGIX_vertex_preclip_hint */ -#ifdef GL_SGIX_ycrcb - CONST_CAST(GLEW_SGIX_ycrcb) = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); -#endif /* GL_SGIX_ycrcb */ -#ifdef GL_SGI_color_matrix - CONST_CAST(GLEW_SGI_color_matrix) = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); -#endif /* GL_SGI_color_matrix */ -#ifdef GL_SGI_color_table - CONST_CAST(GLEW_SGI_color_table) = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); - if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGI_color_table */ -#ifdef GL_SGI_texture_color_table - CONST_CAST(GLEW_SGI_texture_color_table) = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); -#endif /* GL_SGI_texture_color_table */ -#ifdef GL_SUNX_constant_data - CONST_CAST(GLEW_SUNX_constant_data) = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); - if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUNX_constant_data */ -#ifdef GL_SUN_convolution_border_modes - CONST_CAST(GLEW_SUN_convolution_border_modes) = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); -#endif /* GL_SUN_convolution_border_modes */ -#ifdef GL_SUN_global_alpha - CONST_CAST(GLEW_SUN_global_alpha) = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); - if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_global_alpha */ -#ifdef GL_SUN_mesh_array - CONST_CAST(GLEW_SUN_mesh_array) = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); -#endif /* GL_SUN_mesh_array */ -#ifdef GL_SUN_read_video_pixels - CONST_CAST(GLEW_SUN_read_video_pixels) = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); - if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_read_video_pixels */ -#ifdef GL_SUN_slice_accum - CONST_CAST(GLEW_SUN_slice_accum) = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); -#endif /* GL_SUN_slice_accum */ -#ifdef GL_SUN_triangle_list - CONST_CAST(GLEW_SUN_triangle_list) = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); - if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_triangle_list */ -#ifdef GL_SUN_vertex - CONST_CAST(GLEW_SUN_vertex) = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); - if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_vertex */ -#ifdef GL_WIN_phong_shading - CONST_CAST(GLEW_WIN_phong_shading) = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); -#endif /* GL_WIN_phong_shading */ -#ifdef GL_WIN_specular_fog - CONST_CAST(GLEW_WIN_specular_fog) = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); -#endif /* GL_WIN_specular_fog */ -#ifdef GL_WIN_swap_hint - CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); - if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_WIN_swap_hint */ - - return GLEW_OK; -} - - -#if defined(_WIN32) - -#if !defined(GLEW_MX) - -PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; - -PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; -PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; -PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; -PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; -PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; -PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; -PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; -PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; -PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; - -PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; -PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; -PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; -PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; - -PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; - -PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; - -PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; -PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; - -PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; -PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; -PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; -PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; -PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; - -PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; -PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; -PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; - -PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; -PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; -PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; - -PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; -PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; -PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; -PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; - -PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; - -PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; -PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; - -PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; -PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; -PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; -PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; -PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; - -PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; -PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; -PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; - -PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; -PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; - -PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; -PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; - -PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; -PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; -PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; -PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; - -PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; -PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; -PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; -PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; -PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; -PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; -PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; -PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; -PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; -PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; -PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; -PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; - -PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; -PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; -PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; -PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; - -PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; -PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; -PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; -PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; - -PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; -PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; -PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; -PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; - -PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; -PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; -PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; -PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; -PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; -PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; -PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; -PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; - -PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; - -PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; -PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; -PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; -PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; -PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; - -PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; -PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; -PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; - -PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; -PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; -PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; -PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; -PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; -PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; - -PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; -PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; - -PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; -PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; -PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; -PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; -PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; - -PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; -PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; -PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; -PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; -PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; -PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; - -PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; -PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; -PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; -PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; -PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; -PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; -GLboolean __WGLEW_3DFX_multisample = GL_FALSE; -GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; -GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; -GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; -GLboolean __WGLEW_ARB_create_context = GL_FALSE; -GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; -GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; -GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; -GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; -GLboolean __WGLEW_ARB_multisample = GL_FALSE; -GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; -GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; -GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; -GLboolean __WGLEW_ARB_render_texture = GL_FALSE; -GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; -GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; -GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; -GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; -GLboolean __WGLEW_EXT_depth_float = GL_FALSE; -GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; -GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; -GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; -GLboolean __WGLEW_EXT_multisample = GL_FALSE; -GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; -GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; -GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; -GLboolean __WGLEW_EXT_swap_control = GL_FALSE; -GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; -GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; -GLboolean __WGLEW_I3D_gamma = GL_FALSE; -GLboolean __WGLEW_I3D_genlock = GL_FALSE; -GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; -GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; -GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; -GLboolean __WGLEW_NV_DX_interop = GL_FALSE; -GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; -GLboolean __WGLEW_NV_copy_image = GL_FALSE; -GLboolean __WGLEW_NV_float_buffer = GL_FALSE; -GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; -GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; -GLboolean __WGLEW_NV_present_video = GL_FALSE; -GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; -GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; -GLboolean __WGLEW_NV_swap_group = GL_FALSE; -GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; -GLboolean __WGLEW_NV_video_capture = GL_FALSE; -GLboolean __WGLEW_NV_video_output = GL_FALSE; -GLboolean __WGLEW_OML_sync_control = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef WGL_3DFX_multisample - -#endif /* WGL_3DFX_multisample */ - -#ifdef WGL_3DL_stereo_control - -static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; - - return r; -} - -#endif /* WGL_3DL_stereo_control */ - -#ifdef WGL_AMD_gpu_association - -static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; - r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; - r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; - r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; - r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; - r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; - r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; - r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; - r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; - - return r; -} - -#endif /* WGL_AMD_gpu_association */ - -#ifdef WGL_ARB_buffer_region - -static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; - r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; - r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; - r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_buffer_region */ - -#ifdef WGL_ARB_create_context - -static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_create_context */ - -#ifdef WGL_ARB_create_context_profile - -#endif /* WGL_ARB_create_context_profile */ - -#ifdef WGL_ARB_create_context_robustness - -#endif /* WGL_ARB_create_context_robustness */ - -#ifdef WGL_ARB_extensions_string - -static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_extensions_string */ - -#ifdef WGL_ARB_framebuffer_sRGB - -#endif /* WGL_ARB_framebuffer_sRGB */ - -#ifdef WGL_ARB_make_current_read - -static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; - r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_make_current_read */ - -#ifdef WGL_ARB_multisample - -#endif /* WGL_ARB_multisample */ - -#ifdef WGL_ARB_pbuffer - -static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; - r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; - r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; - r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; - r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_pbuffer */ - -#ifdef WGL_ARB_pixel_format - -static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; - r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; - r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_pixel_format */ - -#ifdef WGL_ARB_pixel_format_float - -#endif /* WGL_ARB_pixel_format_float */ - -#ifdef WGL_ARB_render_texture - -static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; - r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; - r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_render_texture */ - -#ifdef WGL_ATI_pixel_format_float - -#endif /* WGL_ATI_pixel_format_float */ - -#ifdef WGL_ATI_render_texture_rectangle - -#endif /* WGL_ATI_render_texture_rectangle */ - -#ifdef WGL_EXT_create_context_es2_profile - -#endif /* WGL_EXT_create_context_es2_profile */ - -#ifdef WGL_EXT_create_context_es_profile - -#endif /* WGL_EXT_create_context_es_profile */ - -#ifdef WGL_EXT_depth_float - -#endif /* WGL_EXT_depth_float */ - -#ifdef WGL_EXT_display_color_table - -static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; - r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; - r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; - r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_display_color_table */ - -#ifdef WGL_EXT_extensions_string - -static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_extensions_string */ - -#ifdef WGL_EXT_framebuffer_sRGB - -#endif /* WGL_EXT_framebuffer_sRGB */ - -#ifdef WGL_EXT_make_current_read - -static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; - r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_make_current_read */ - -#ifdef WGL_EXT_multisample - -#endif /* WGL_EXT_multisample */ - -#ifdef WGL_EXT_pbuffer - -static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; - r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; - r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; - r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; - r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_pbuffer */ - -#ifdef WGL_EXT_pixel_format - -static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; - r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; - r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_pixel_format */ - -#ifdef WGL_EXT_pixel_format_packed_float - -#endif /* WGL_EXT_pixel_format_packed_float */ - -#ifdef WGL_EXT_swap_control - -static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; - r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_swap_control */ - -#ifdef WGL_EXT_swap_control_tear - -#endif /* WGL_EXT_swap_control_tear */ - -#ifdef WGL_I3D_digital_video_control - -static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; - r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_digital_video_control */ - -#ifdef WGL_I3D_gamma - -static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; - r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; - r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; - r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_gamma */ - -#ifdef WGL_I3D_genlock - -static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; - r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; - r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; - r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; - r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; - r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; - r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; - r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; - r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; - r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; - r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; - r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_genlock */ - -#ifdef WGL_I3D_image_buffer - -static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; - r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; - r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; - r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_image_buffer */ - -#ifdef WGL_I3D_swap_frame_lock - -static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; - r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; - r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; - r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_swap_frame_lock */ - -#ifdef WGL_I3D_swap_frame_usage - -static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; - r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; - r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; - r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_swap_frame_usage */ - -#ifdef WGL_NV_DX_interop - -static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; - r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; - r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; - r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; - r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; - r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; - r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; - r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_DX_interop */ - -#ifdef WGL_NV_DX_interop2 - -#endif /* WGL_NV_DX_interop2 */ - -#ifdef WGL_NV_copy_image - -static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_copy_image */ - -#ifdef WGL_NV_float_buffer - -#endif /* WGL_NV_float_buffer */ - -#ifdef WGL_NV_gpu_affinity - -static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; - r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; - r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; - r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; - r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_gpu_affinity */ - -#ifdef WGL_NV_multisample_coverage - -#endif /* WGL_NV_multisample_coverage */ - -#ifdef WGL_NV_present_video - -static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; - r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; - r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_present_video */ - -#ifdef WGL_NV_render_depth_texture - -#endif /* WGL_NV_render_depth_texture */ - -#ifdef WGL_NV_render_texture_rectangle - -#endif /* WGL_NV_render_texture_rectangle */ - -#ifdef WGL_NV_swap_group - -static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; - r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; - r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; - r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; - r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; - r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_swap_group */ - -#ifdef WGL_NV_vertex_array_range - -static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; - r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_vertex_array_range */ - -#ifdef WGL_NV_video_capture - -static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; - r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_video_capture */ - -#ifdef WGL_NV_video_output - -static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; - r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; - r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; - r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; - r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; - r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_video_output */ - -#ifdef WGL_OML_sync_control - -static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; - r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; - r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; - r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; - r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; - r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; - - return r; -} - -#endif /* WGL_OML_sync_control */ - -/* ------------------------------------------------------------------------- */ - -static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; -static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; - -GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - if (_wglewGetExtensionsStringARB == NULL) - if (_wglewGetExtensionsStringEXT == NULL) - return GL_FALSE; - else - start = (const GLubyte*)_wglewGetExtensionsStringEXT(); - else - start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); - if (start == 0) - return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) -{ - GLboolean crippled; - const GLubyte* extStart; - const GLubyte* extEnd; - /* find wgl extension string query functions */ - _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); - _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); - /* query wgl extension string */ - if (_wglewGetExtensionsStringARB == NULL) - if (_wglewGetExtensionsStringEXT == NULL) - extStart = (const GLubyte*)""; - else - extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); - else - extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); - extEnd = extStart + _glewStrLen(extStart); - /* initialize extensions */ - crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; -#ifdef WGL_3DFX_multisample - CONST_CAST(WGLEW_3DFX_multisample) = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); -#endif /* WGL_3DFX_multisample */ -#ifdef WGL_3DL_stereo_control - CONST_CAST(WGLEW_3DL_stereo_control) = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); - if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_3DL_stereo_control */ -#ifdef WGL_AMD_gpu_association - CONST_CAST(WGLEW_AMD_gpu_association) = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); - if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_AMD_gpu_association */ -#ifdef WGL_ARB_buffer_region - CONST_CAST(WGLEW_ARB_buffer_region) = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_buffer_region */ -#ifdef WGL_ARB_create_context - CONST_CAST(WGLEW_ARB_create_context) = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_create_context */ -#ifdef WGL_ARB_create_context_profile - CONST_CAST(WGLEW_ARB_create_context_profile) = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); -#endif /* WGL_ARB_create_context_profile */ -#ifdef WGL_ARB_create_context_robustness - CONST_CAST(WGLEW_ARB_create_context_robustness) = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); -#endif /* WGL_ARB_create_context_robustness */ -#ifdef WGL_ARB_extensions_string - CONST_CAST(WGLEW_ARB_extensions_string) = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_extensions_string */ -#ifdef WGL_ARB_framebuffer_sRGB - CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* WGL_ARB_framebuffer_sRGB */ -#ifdef WGL_ARB_make_current_read - CONST_CAST(WGLEW_ARB_make_current_read) = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_make_current_read */ -#ifdef WGL_ARB_multisample - CONST_CAST(WGLEW_ARB_multisample) = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); -#endif /* WGL_ARB_multisample */ -#ifdef WGL_ARB_pbuffer - CONST_CAST(WGLEW_ARB_pbuffer) = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_pbuffer */ -#ifdef WGL_ARB_pixel_format - CONST_CAST(WGLEW_ARB_pixel_format) = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_pixel_format */ -#ifdef WGL_ARB_pixel_format_float - CONST_CAST(WGLEW_ARB_pixel_format_float) = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); -#endif /* WGL_ARB_pixel_format_float */ -#ifdef WGL_ARB_render_texture - CONST_CAST(WGLEW_ARB_render_texture) = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_render_texture */ -#ifdef WGL_ATI_pixel_format_float - CONST_CAST(WGLEW_ATI_pixel_format_float) = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); -#endif /* WGL_ATI_pixel_format_float */ -#ifdef WGL_ATI_render_texture_rectangle - CONST_CAST(WGLEW_ATI_render_texture_rectangle) = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); -#endif /* WGL_ATI_render_texture_rectangle */ -#ifdef WGL_EXT_create_context_es2_profile - CONST_CAST(WGLEW_EXT_create_context_es2_profile) = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); -#endif /* WGL_EXT_create_context_es2_profile */ -#ifdef WGL_EXT_create_context_es_profile - CONST_CAST(WGLEW_EXT_create_context_es_profile) = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); -#endif /* WGL_EXT_create_context_es_profile */ -#ifdef WGL_EXT_depth_float - CONST_CAST(WGLEW_EXT_depth_float) = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); -#endif /* WGL_EXT_depth_float */ -#ifdef WGL_EXT_display_color_table - CONST_CAST(WGLEW_EXT_display_color_table) = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_display_color_table */ -#ifdef WGL_EXT_extensions_string - CONST_CAST(WGLEW_EXT_extensions_string) = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_extensions_string */ -#ifdef WGL_EXT_framebuffer_sRGB - CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* WGL_EXT_framebuffer_sRGB */ -#ifdef WGL_EXT_make_current_read - CONST_CAST(WGLEW_EXT_make_current_read) = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_make_current_read */ -#ifdef WGL_EXT_multisample - CONST_CAST(WGLEW_EXT_multisample) = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); -#endif /* WGL_EXT_multisample */ -#ifdef WGL_EXT_pbuffer - CONST_CAST(WGLEW_EXT_pbuffer) = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_pbuffer */ -#ifdef WGL_EXT_pixel_format - CONST_CAST(WGLEW_EXT_pixel_format) = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_pixel_format */ -#ifdef WGL_EXT_pixel_format_packed_float - CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); -#endif /* WGL_EXT_pixel_format_packed_float */ -#ifdef WGL_EXT_swap_control - CONST_CAST(WGLEW_EXT_swap_control) = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_swap_control */ -#ifdef WGL_EXT_swap_control_tear - CONST_CAST(WGLEW_EXT_swap_control_tear) = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); -#endif /* WGL_EXT_swap_control_tear */ -#ifdef WGL_I3D_digital_video_control - CONST_CAST(WGLEW_I3D_digital_video_control) = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_digital_video_control */ -#ifdef WGL_I3D_gamma - CONST_CAST(WGLEW_I3D_gamma) = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_gamma */ -#ifdef WGL_I3D_genlock - CONST_CAST(WGLEW_I3D_genlock) = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_genlock */ -#ifdef WGL_I3D_image_buffer - CONST_CAST(WGLEW_I3D_image_buffer) = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_image_buffer */ -#ifdef WGL_I3D_swap_frame_lock - CONST_CAST(WGLEW_I3D_swap_frame_lock) = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_swap_frame_lock */ -#ifdef WGL_I3D_swap_frame_usage - CONST_CAST(WGLEW_I3D_swap_frame_usage) = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_swap_frame_usage */ -#ifdef WGL_NV_DX_interop - CONST_CAST(WGLEW_NV_DX_interop) = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); - if (glewExperimental || WGLEW_NV_DX_interop|| crippled) CONST_CAST(WGLEW_NV_DX_interop)= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_DX_interop */ -#ifdef WGL_NV_DX_interop2 - CONST_CAST(WGLEW_NV_DX_interop2) = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); -#endif /* WGL_NV_DX_interop2 */ -#ifdef WGL_NV_copy_image - CONST_CAST(WGLEW_NV_copy_image) = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); - if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_copy_image */ -#ifdef WGL_NV_float_buffer - CONST_CAST(WGLEW_NV_float_buffer) = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); -#endif /* WGL_NV_float_buffer */ -#ifdef WGL_NV_gpu_affinity - CONST_CAST(WGLEW_NV_gpu_affinity) = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); - if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_gpu_affinity */ -#ifdef WGL_NV_multisample_coverage - CONST_CAST(WGLEW_NV_multisample_coverage) = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); -#endif /* WGL_NV_multisample_coverage */ -#ifdef WGL_NV_present_video - CONST_CAST(WGLEW_NV_present_video) = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); - if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_present_video */ -#ifdef WGL_NV_render_depth_texture - CONST_CAST(WGLEW_NV_render_depth_texture) = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); -#endif /* WGL_NV_render_depth_texture */ -#ifdef WGL_NV_render_texture_rectangle - CONST_CAST(WGLEW_NV_render_texture_rectangle) = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); -#endif /* WGL_NV_render_texture_rectangle */ -#ifdef WGL_NV_swap_group - CONST_CAST(WGLEW_NV_swap_group) = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); - if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_swap_group */ -#ifdef WGL_NV_vertex_array_range - CONST_CAST(WGLEW_NV_vertex_array_range) = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_vertex_array_range */ -#ifdef WGL_NV_video_capture - CONST_CAST(WGLEW_NV_video_capture) = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); - if (glewExperimental || WGLEW_NV_video_capture|| crippled) CONST_CAST(WGLEW_NV_video_capture)= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_video_capture */ -#ifdef WGL_NV_video_output - CONST_CAST(WGLEW_NV_video_output) = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); - if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_video_output */ -#ifdef WGL_OML_sync_control - CONST_CAST(WGLEW_OML_sync_control) = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); - if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_OML_sync_control */ - - return GLEW_OK; -} - -#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) - -PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; - -PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; -PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; -PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; -PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; -PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; -PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; -PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; -PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; -PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; -PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; -PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; -PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; -PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; -PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; -PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; -PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; -PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; - -PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; - -PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; -PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; -PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; - -PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; -PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; -PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; -PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; - -PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; - -PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; -PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; - -PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; - -PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; - -PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; - -PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; - -PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; - -PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; -PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; - -PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; - -PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; -PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; - -PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; -PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; -PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; -PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; -PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; -PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; - -PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; -PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; - -PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; -PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; -PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; -PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; -PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; - -PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; -PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; -PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; -PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; -PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; -PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; - -PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; -PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; -PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; -PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; -PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; - -PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; -PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; -PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; -PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; -PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; -PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; - -PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; -PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; -PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; -PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; -PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; -PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; -PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; -PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; - -PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; -PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; -PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; -PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; -PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; - -PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; -PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; - -PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; - -PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; -PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; -PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; -PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; -PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; - -PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; - -PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; -PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; - -PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; - -PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; -PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; - -PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; - -PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; -PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; - -#if !defined(GLEW_MX) - -GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; -GLboolean __GLXEW_3DFX_multisample = GL_FALSE; -GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; -GLboolean __GLXEW_ARB_create_context = GL_FALSE; -GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; -GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; -GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; -GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; -GLboolean __GLXEW_ARB_multisample = GL_FALSE; -GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; -GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; -GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; -GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; -GLboolean __GLXEW_ATI_render_texture = GL_FALSE; -GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; -GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; -GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; -GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __GLXEW_EXT_import_context = GL_FALSE; -GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; -GLboolean __GLXEW_EXT_swap_control = GL_FALSE; -GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; -GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; -GLboolean __GLXEW_EXT_visual_info = GL_FALSE; -GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; -GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; -GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; -GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; -GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; -GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; -GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; -GLboolean __GLXEW_MESA_swap_control = GL_FALSE; -GLboolean __GLXEW_NV_copy_image = GL_FALSE; -GLboolean __GLXEW_NV_float_buffer = GL_FALSE; -GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; -GLboolean __GLXEW_NV_present_video = GL_FALSE; -GLboolean __GLXEW_NV_swap_group = GL_FALSE; -GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; -GLboolean __GLXEW_NV_video_capture = GL_FALSE; -GLboolean __GLXEW_NV_video_out = GL_FALSE; -GLboolean __GLXEW_OML_swap_method = GL_FALSE; -GLboolean __GLXEW_OML_sync_control = GL_FALSE; -GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; -GLboolean __GLXEW_SGIS_color_range = GL_FALSE; -GLboolean __GLXEW_SGIS_multisample = GL_FALSE; -GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; -GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; -GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; -GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; -GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; -GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; -GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; -GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; -GLboolean __GLXEW_SGI_cushion = GL_FALSE; -GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; -GLboolean __GLXEW_SGI_swap_control = GL_FALSE; -GLboolean __GLXEW_SGI_video_sync = GL_FALSE; -GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; -GLboolean __GLXEW_SUN_video_resize = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef GLX_VERSION_1_2 - -static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; - - return r; -} - -#endif /* GLX_VERSION_1_2 */ - -#ifdef GLX_VERSION_1_3 - -static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; - r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; - r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; - r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; - r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; - r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; - r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; - r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; - r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; - r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; - r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; - r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; - r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; - r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; - r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; - r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; - r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; - - return r; -} - -#endif /* GLX_VERSION_1_3 */ - -#ifdef GLX_VERSION_1_4 - -#endif /* GLX_VERSION_1_4 */ - -#ifdef GLX_3DFX_multisample - -#endif /* GLX_3DFX_multisample */ - -#ifdef GLX_AMD_gpu_association - -#endif /* GLX_AMD_gpu_association */ - -#ifdef GLX_ARB_create_context - -static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; - - return r; -} - -#endif /* GLX_ARB_create_context */ - -#ifdef GLX_ARB_create_context_profile - -#endif /* GLX_ARB_create_context_profile */ - -#ifdef GLX_ARB_create_context_robustness - -#endif /* GLX_ARB_create_context_robustness */ - -#ifdef GLX_ARB_fbconfig_float - -#endif /* GLX_ARB_fbconfig_float */ - -#ifdef GLX_ARB_framebuffer_sRGB - -#endif /* GLX_ARB_framebuffer_sRGB */ - -#ifdef GLX_ARB_get_proc_address - -#endif /* GLX_ARB_get_proc_address */ - -#ifdef GLX_ARB_multisample - -#endif /* GLX_ARB_multisample */ - -#ifdef GLX_ARB_robustness_application_isolation - -#endif /* GLX_ARB_robustness_application_isolation */ - -#ifdef GLX_ARB_robustness_share_group_isolation - -#endif /* GLX_ARB_robustness_share_group_isolation */ - -#ifdef GLX_ARB_vertex_buffer_object - -#endif /* GLX_ARB_vertex_buffer_object */ - -#ifdef GLX_ATI_pixel_format_float - -#endif /* GLX_ATI_pixel_format_float */ - -#ifdef GLX_ATI_render_texture - -static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; - r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; - r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; - - return r; -} - -#endif /* GLX_ATI_render_texture */ - -#ifdef GLX_EXT_create_context_es2_profile - -#endif /* GLX_EXT_create_context_es2_profile */ - -#ifdef GLX_EXT_create_context_es_profile - -#endif /* GLX_EXT_create_context_es_profile */ - -#ifdef GLX_EXT_fbconfig_packed_float - -#endif /* GLX_EXT_fbconfig_packed_float */ - -#ifdef GLX_EXT_framebuffer_sRGB - -#endif /* GLX_EXT_framebuffer_sRGB */ - -#ifdef GLX_EXT_import_context - -static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; - r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; - r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; - r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_import_context */ - -#ifdef GLX_EXT_scene_marker - -#endif /* GLX_EXT_scene_marker */ - -#ifdef GLX_EXT_swap_control - -static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_swap_control */ - -#ifdef GLX_EXT_swap_control_tear - -#endif /* GLX_EXT_swap_control_tear */ - -#ifdef GLX_EXT_texture_from_pixmap - -static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; - r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_texture_from_pixmap */ - -#ifdef GLX_EXT_visual_info - -#endif /* GLX_EXT_visual_info */ - -#ifdef GLX_EXT_visual_rating - -#endif /* GLX_EXT_visual_rating */ - -#ifdef GLX_INTEL_swap_event - -#endif /* GLX_INTEL_swap_event */ - -#ifdef GLX_MESA_agp_offset - -static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_agp_offset */ - -#ifdef GLX_MESA_copy_sub_buffer - -static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_copy_sub_buffer */ - -#ifdef GLX_MESA_pixmap_colormap - -static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_pixmap_colormap */ - -#ifdef GLX_MESA_release_buffers - -static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_release_buffers */ - -#ifdef GLX_MESA_set_3dfx_mode - -static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_set_3dfx_mode */ - -#ifdef GLX_MESA_swap_control - -static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; - r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_swap_control */ - -#ifdef GLX_NV_copy_image - -static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_copy_image */ - -#ifdef GLX_NV_float_buffer - -#endif /* GLX_NV_float_buffer */ - -#ifdef GLX_NV_multisample_coverage - -#endif /* GLX_NV_multisample_coverage */ - -#ifdef GLX_NV_present_video - -static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; - r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_present_video */ - -#ifdef GLX_NV_swap_group - -static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; - r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; - r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; - r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; - r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; - r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_swap_group */ - -#ifdef GLX_NV_vertex_array_range - -static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; - r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_vertex_array_range */ - -#ifdef GLX_NV_video_capture - -static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; - r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_video_capture */ - -#ifdef GLX_NV_video_out - -static GLboolean _glewInit_GLX_NV_video_out (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; - r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; - r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; - r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; - r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; - r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_video_out */ - -#ifdef GLX_OML_swap_method - -#endif /* GLX_OML_swap_method */ - -#ifdef GLX_OML_sync_control - -static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; - r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; - r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; - r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; - r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; - - return r; -} - -#endif /* GLX_OML_sync_control */ - -#ifdef GLX_SGIS_blended_overlay - -#endif /* GLX_SGIS_blended_overlay */ - -#ifdef GLX_SGIS_color_range - -#endif /* GLX_SGIS_color_range */ - -#ifdef GLX_SGIS_multisample - -#endif /* GLX_SGIS_multisample */ - -#ifdef GLX_SGIS_shared_multisample - -#endif /* GLX_SGIS_shared_multisample */ - -#ifdef GLX_SGIX_fbconfig - -static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; - r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; - r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; - r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; - r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; - r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_fbconfig */ - -#ifdef GLX_SGIX_hyperpipe - -static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; - r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; - r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_hyperpipe */ - -#ifdef GLX_SGIX_pbuffer - -static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; - r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; - r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; - r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; - r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_pbuffer */ - -#ifdef GLX_SGIX_swap_barrier - -static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; - r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_swap_barrier */ - -#ifdef GLX_SGIX_swap_group - -static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_swap_group */ - -#ifdef GLX_SGIX_video_resize - -static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; - r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; - r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; - r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; - r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_video_resize */ - -#ifdef GLX_SGIX_visual_select_group - -#endif /* GLX_SGIX_visual_select_group */ - -#ifdef GLX_SGI_cushion - -static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_cushion */ - -#ifdef GLX_SGI_make_current_read - -static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; - r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_make_current_read */ - -#ifdef GLX_SGI_swap_control - -static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_swap_control */ - -#ifdef GLX_SGI_video_sync - -static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; - r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_video_sync */ - -#ifdef GLX_SUN_get_transparent_index - -static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; - - return r; -} - -#endif /* GLX_SUN_get_transparent_index */ - -#ifdef GLX_SUN_video_resize - -static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; - r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; - - return r; -} - -#endif /* GLX_SUN_video_resize */ - -/* ------------------------------------------------------------------------ */ - -GLboolean glxewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - - if (glXGetCurrentDisplay == NULL) return GL_FALSE; - start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); - if (0 == start) return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) -{ - int major, minor; - const GLubyte* extStart; - const GLubyte* extEnd; - /* initialize core GLX 1.2 */ - if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; - /* initialize flags */ - CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; - /* query GLX version */ - glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); - if (major == 1 && minor <= 3) - { - switch (minor) - { - case 3: - CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; - break; - case 2: - CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; - CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; - break; - default: - return GLEW_ERROR_GLX_VERSION_11_ONLY; - break; - } - } - /* query GLX extension string */ - extStart = 0; - if (glXGetCurrentDisplay != NULL) - extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); - if (extStart == 0) - extStart = (const GLubyte *)""; - extEnd = extStart + _glewStrLen(extStart); - /* initialize extensions */ -#ifdef GLX_VERSION_1_3 - if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_VERSION_1_3 */ -#ifdef GLX_3DFX_multisample - CONST_CAST(GLXEW_3DFX_multisample) = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); -#endif /* GLX_3DFX_multisample */ -#ifdef GLX_AMD_gpu_association - CONST_CAST(GLXEW_AMD_gpu_association) = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); -#endif /* GLX_AMD_gpu_association */ -#ifdef GLX_ARB_create_context - CONST_CAST(GLXEW_ARB_create_context) = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); - if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_ARB_create_context */ -#ifdef GLX_ARB_create_context_profile - CONST_CAST(GLXEW_ARB_create_context_profile) = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); -#endif /* GLX_ARB_create_context_profile */ -#ifdef GLX_ARB_create_context_robustness - CONST_CAST(GLXEW_ARB_create_context_robustness) = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); -#endif /* GLX_ARB_create_context_robustness */ -#ifdef GLX_ARB_fbconfig_float - CONST_CAST(GLXEW_ARB_fbconfig_float) = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); -#endif /* GLX_ARB_fbconfig_float */ -#ifdef GLX_ARB_framebuffer_sRGB - CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* GLX_ARB_framebuffer_sRGB */ -#ifdef GLX_ARB_get_proc_address - CONST_CAST(GLXEW_ARB_get_proc_address) = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); -#endif /* GLX_ARB_get_proc_address */ -#ifdef GLX_ARB_multisample - CONST_CAST(GLXEW_ARB_multisample) = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); -#endif /* GLX_ARB_multisample */ -#ifdef GLX_ARB_robustness_application_isolation - CONST_CAST(GLXEW_ARB_robustness_application_isolation) = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); -#endif /* GLX_ARB_robustness_application_isolation */ -#ifdef GLX_ARB_robustness_share_group_isolation - CONST_CAST(GLXEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); -#endif /* GLX_ARB_robustness_share_group_isolation */ -#ifdef GLX_ARB_vertex_buffer_object - CONST_CAST(GLXEW_ARB_vertex_buffer_object) = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); -#endif /* GLX_ARB_vertex_buffer_object */ -#ifdef GLX_ATI_pixel_format_float - CONST_CAST(GLXEW_ATI_pixel_format_float) = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); -#endif /* GLX_ATI_pixel_format_float */ -#ifdef GLX_ATI_render_texture - CONST_CAST(GLXEW_ATI_render_texture) = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); - if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_ATI_render_texture */ -#ifdef GLX_EXT_create_context_es2_profile - CONST_CAST(GLXEW_EXT_create_context_es2_profile) = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); -#endif /* GLX_EXT_create_context_es2_profile */ -#ifdef GLX_EXT_create_context_es_profile - CONST_CAST(GLXEW_EXT_create_context_es_profile) = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); -#endif /* GLX_EXT_create_context_es_profile */ -#ifdef GLX_EXT_fbconfig_packed_float - CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); -#endif /* GLX_EXT_fbconfig_packed_float */ -#ifdef GLX_EXT_framebuffer_sRGB - CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* GLX_EXT_framebuffer_sRGB */ -#ifdef GLX_EXT_import_context - CONST_CAST(GLXEW_EXT_import_context) = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_import_context */ -#ifdef GLX_EXT_scene_marker - CONST_CAST(GLXEW_EXT_scene_marker) = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); -#endif /* GLX_EXT_scene_marker */ -#ifdef GLX_EXT_swap_control - CONST_CAST(GLXEW_EXT_swap_control) = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_swap_control */ -#ifdef GLX_EXT_swap_control_tear - CONST_CAST(GLXEW_EXT_swap_control_tear) = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); -#endif /* GLX_EXT_swap_control_tear */ -#ifdef GLX_EXT_texture_from_pixmap - CONST_CAST(GLXEW_EXT_texture_from_pixmap) = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_texture_from_pixmap */ -#ifdef GLX_EXT_visual_info - CONST_CAST(GLXEW_EXT_visual_info) = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); -#endif /* GLX_EXT_visual_info */ -#ifdef GLX_EXT_visual_rating - CONST_CAST(GLXEW_EXT_visual_rating) = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); -#endif /* GLX_EXT_visual_rating */ -#ifdef GLX_INTEL_swap_event - CONST_CAST(GLXEW_INTEL_swap_event) = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); -#endif /* GLX_INTEL_swap_event */ -#ifdef GLX_MESA_agp_offset - CONST_CAST(GLXEW_MESA_agp_offset) = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_agp_offset */ -#ifdef GLX_MESA_copy_sub_buffer - CONST_CAST(GLXEW_MESA_copy_sub_buffer) = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_copy_sub_buffer */ -#ifdef GLX_MESA_pixmap_colormap - CONST_CAST(GLXEW_MESA_pixmap_colormap) = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_pixmap_colormap */ -#ifdef GLX_MESA_release_buffers - CONST_CAST(GLXEW_MESA_release_buffers) = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_release_buffers */ -#ifdef GLX_MESA_set_3dfx_mode - CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_set_3dfx_mode */ -#ifdef GLX_MESA_swap_control - CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_swap_control */ -#ifdef GLX_NV_copy_image - CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); - if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_copy_image */ -#ifdef GLX_NV_float_buffer - CONST_CAST(GLXEW_NV_float_buffer) = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); -#endif /* GLX_NV_float_buffer */ -#ifdef GLX_NV_multisample_coverage - CONST_CAST(GLXEW_NV_multisample_coverage) = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); -#endif /* GLX_NV_multisample_coverage */ -#ifdef GLX_NV_present_video - CONST_CAST(GLXEW_NV_present_video) = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); - if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_present_video */ -#ifdef GLX_NV_swap_group - CONST_CAST(GLXEW_NV_swap_group) = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); - if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_swap_group */ -#ifdef GLX_NV_vertex_array_range - CONST_CAST(GLXEW_NV_vertex_array_range) = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_vertex_array_range */ -#ifdef GLX_NV_video_capture - CONST_CAST(GLXEW_NV_video_capture) = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); - if (glewExperimental || GLXEW_NV_video_capture) CONST_CAST(GLXEW_NV_video_capture) = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_video_capture */ -#ifdef GLX_NV_video_out - CONST_CAST(GLXEW_NV_video_out) = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); - if (glewExperimental || GLXEW_NV_video_out) CONST_CAST(GLXEW_NV_video_out) = !_glewInit_GLX_NV_video_out(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_video_out */ -#ifdef GLX_OML_swap_method - CONST_CAST(GLXEW_OML_swap_method) = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); -#endif /* GLX_OML_swap_method */ -#ifdef GLX_OML_sync_control - CONST_CAST(GLXEW_OML_sync_control) = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); - if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_OML_sync_control */ -#ifdef GLX_SGIS_blended_overlay - CONST_CAST(GLXEW_SGIS_blended_overlay) = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); -#endif /* GLX_SGIS_blended_overlay */ -#ifdef GLX_SGIS_color_range - CONST_CAST(GLXEW_SGIS_color_range) = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); -#endif /* GLX_SGIS_color_range */ -#ifdef GLX_SGIS_multisample - CONST_CAST(GLXEW_SGIS_multisample) = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); -#endif /* GLX_SGIS_multisample */ -#ifdef GLX_SGIS_shared_multisample - CONST_CAST(GLXEW_SGIS_shared_multisample) = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); -#endif /* GLX_SGIS_shared_multisample */ -#ifdef GLX_SGIX_fbconfig - CONST_CAST(GLXEW_SGIX_fbconfig) = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_fbconfig */ -#ifdef GLX_SGIX_hyperpipe - CONST_CAST(GLXEW_SGIX_hyperpipe) = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_hyperpipe */ -#ifdef GLX_SGIX_pbuffer - CONST_CAST(GLXEW_SGIX_pbuffer) = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_pbuffer */ -#ifdef GLX_SGIX_swap_barrier - CONST_CAST(GLXEW_SGIX_swap_barrier) = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_swap_barrier */ -#ifdef GLX_SGIX_swap_group - CONST_CAST(GLXEW_SGIX_swap_group) = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_swap_group */ -#ifdef GLX_SGIX_video_resize - CONST_CAST(GLXEW_SGIX_video_resize) = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_video_resize */ -#ifdef GLX_SGIX_visual_select_group - CONST_CAST(GLXEW_SGIX_visual_select_group) = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); -#endif /* GLX_SGIX_visual_select_group */ -#ifdef GLX_SGI_cushion - CONST_CAST(GLXEW_SGI_cushion) = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_cushion */ -#ifdef GLX_SGI_make_current_read - CONST_CAST(GLXEW_SGI_make_current_read) = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_make_current_read */ -#ifdef GLX_SGI_swap_control - CONST_CAST(GLXEW_SGI_swap_control) = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_swap_control */ -#ifdef GLX_SGI_video_sync - CONST_CAST(GLXEW_SGI_video_sync) = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_video_sync */ -#ifdef GLX_SUN_get_transparent_index - CONST_CAST(GLXEW_SUN_get_transparent_index) = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); - if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SUN_get_transparent_index */ -#ifdef GLX_SUN_video_resize - CONST_CAST(GLXEW_SUN_video_resize) = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); - if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SUN_video_resize */ - - return GLEW_OK; -} - -#endif /* !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ - -/* ------------------------------------------------------------------------ */ - -const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) -{ - static const GLubyte* _glewErrorString[] = - { - (const GLubyte*)"No error", - (const GLubyte*)"Missing GL version", - (const GLubyte*)"GL 1.1 and up are not supported", - (const GLubyte*)"GLX 1.2 and up are not supported", - (const GLubyte*)"Unknown error" - }; - const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; - return _glewErrorString[(int)error > max_error ? max_error : (int)error]; -} - -const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) -{ - static const GLubyte* _glewString[] = - { - (const GLubyte*)NULL, - (const GLubyte*)"1.9.0", - (const GLubyte*)"1", - (const GLubyte*)"9", - (const GLubyte*)"0" - }; - const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; - return _glewString[(int)name > max_string ? 0 : (int)name]; -} - -/* ------------------------------------------------------------------------ */ - -GLboolean glewExperimental = GL_FALSE; - -#if !defined(GLEW_MX) - -#if defined(_WIN32) -extern GLenum GLEWAPIENTRY wglewContextInit (void); -#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) -extern GLenum GLEWAPIENTRY glxewContextInit (void); -#endif /* _WIN32 */ - -GLenum GLEWAPIENTRY glewInit (void) -{ - GLenum r; - r = glewContextInit(); - if ( r != 0 ) return r; -#if defined(_WIN32) - return wglewContextInit(); -#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ - return glxewContextInit(); -#else - return r; -#endif /* _WIN32 */ -} - -#endif /* !GLEW_MX */ -#ifdef GLEW_MX -GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) -#else -GLboolean GLEWAPIENTRY glewIsSupported (const char* name) -#endif -{ - GLubyte* pos = (GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) - { -#ifdef GL_VERSION_1_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) - { - ret = GLEW_VERSION_1_2; - continue; - } -#endif -#ifdef GL_VERSION_1_2_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) - { - ret = GLEW_VERSION_1_2_1; - continue; - } -#endif -#ifdef GL_VERSION_1_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) - { - ret = GLEW_VERSION_1_3; - continue; - } -#endif -#ifdef GL_VERSION_1_4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) - { - ret = GLEW_VERSION_1_4; - continue; - } -#endif -#ifdef GL_VERSION_1_5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) - { - ret = GLEW_VERSION_1_5; - continue; - } -#endif -#ifdef GL_VERSION_2_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) - { - ret = GLEW_VERSION_2_0; - continue; - } -#endif -#ifdef GL_VERSION_2_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) - { - ret = GLEW_VERSION_2_1; - continue; - } -#endif -#ifdef GL_VERSION_3_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) - { - ret = GLEW_VERSION_3_0; - continue; - } -#endif -#ifdef GL_VERSION_3_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) - { - ret = GLEW_VERSION_3_1; - continue; - } -#endif -#ifdef GL_VERSION_3_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) - { - ret = GLEW_VERSION_3_2; - continue; - } -#endif -#ifdef GL_VERSION_3_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) - { - ret = GLEW_VERSION_3_3; - continue; - } -#endif -#ifdef GL_VERSION_4_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) - { - ret = GLEW_VERSION_4_0; - continue; - } -#endif -#ifdef GL_VERSION_4_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) - { - ret = GLEW_VERSION_4_1; - continue; - } -#endif -#ifdef GL_VERSION_4_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) - { - ret = GLEW_VERSION_4_2; - continue; - } -#endif -#ifdef GL_VERSION_4_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) - { - ret = GLEW_VERSION_4_3; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef GL_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_3DFX_multisample; - continue; - } -#endif -#ifdef GL_3DFX_tbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) - { - ret = GLEW_3DFX_tbuffer; - continue; - } -#endif -#ifdef GL_3DFX_texture_compression_FXT1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) - { - ret = GLEW_3DFX_texture_compression_FXT1; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef GL_AMD_blend_minmax_factor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) - { - ret = GLEW_AMD_blend_minmax_factor; - continue; - } -#endif -#ifdef GL_AMD_conservative_depth - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) - { - ret = GLEW_AMD_conservative_depth; - continue; - } -#endif -#ifdef GL_AMD_debug_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) - { - ret = GLEW_AMD_debug_output; - continue; - } -#endif -#ifdef GL_AMD_depth_clamp_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) - { - ret = GLEW_AMD_depth_clamp_separate; - continue; - } -#endif -#ifdef GL_AMD_draw_buffers_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) - { - ret = GLEW_AMD_draw_buffers_blend; - continue; - } -#endif -#ifdef GL_AMD_multi_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) - { - ret = GLEW_AMD_multi_draw_indirect; - continue; - } -#endif -#ifdef GL_AMD_name_gen_delete - if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) - { - ret = GLEW_AMD_name_gen_delete; - continue; - } -#endif -#ifdef GL_AMD_performance_monitor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) - { - ret = GLEW_AMD_performance_monitor; - continue; - } -#endif -#ifdef GL_AMD_pinned_memory - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) - { - ret = GLEW_AMD_pinned_memory; - continue; - } -#endif -#ifdef GL_AMD_query_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) - { - ret = GLEW_AMD_query_buffer_object; - continue; - } -#endif -#ifdef GL_AMD_sample_positions - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) - { - ret = GLEW_AMD_sample_positions; - continue; - } -#endif -#ifdef GL_AMD_seamless_cubemap_per_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) - { - ret = GLEW_AMD_seamless_cubemap_per_texture; - continue; - } -#endif -#ifdef GL_AMD_shader_stencil_export - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) - { - ret = GLEW_AMD_shader_stencil_export; - continue; - } -#endif -#ifdef GL_AMD_stencil_operation_extended - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) - { - ret = GLEW_AMD_stencil_operation_extended; - continue; - } -#endif -#ifdef GL_AMD_texture_texture4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) - { - ret = GLEW_AMD_texture_texture4; - continue; - } -#endif -#ifdef GL_AMD_transform_feedback3_lines_triangles - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) - { - ret = GLEW_AMD_transform_feedback3_lines_triangles; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_layer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) - { - ret = GLEW_AMD_vertex_shader_layer; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_tessellator - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) - { - ret = GLEW_AMD_vertex_shader_tessellator; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_viewport_index - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) - { - ret = GLEW_AMD_vertex_shader_viewport_index; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) - { -#ifdef GL_APPLE_aux_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) - { - ret = GLEW_APPLE_aux_depth_stencil; - continue; - } -#endif -#ifdef GL_APPLE_client_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) - { - ret = GLEW_APPLE_client_storage; - continue; - } -#endif -#ifdef GL_APPLE_element_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) - { - ret = GLEW_APPLE_element_array; - continue; - } -#endif -#ifdef GL_APPLE_fence - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) - { - ret = GLEW_APPLE_fence; - continue; - } -#endif -#ifdef GL_APPLE_float_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) - { - ret = GLEW_APPLE_float_pixels; - continue; - } -#endif -#ifdef GL_APPLE_flush_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) - { - ret = GLEW_APPLE_flush_buffer_range; - continue; - } -#endif -#ifdef GL_APPLE_object_purgeable - if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) - { - ret = GLEW_APPLE_object_purgeable; - continue; - } -#endif -#ifdef GL_APPLE_pixel_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) - { - ret = GLEW_APPLE_pixel_buffer; - continue; - } -#endif -#ifdef GL_APPLE_rgb_422 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) - { - ret = GLEW_APPLE_rgb_422; - continue; - } -#endif -#ifdef GL_APPLE_row_bytes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) - { - ret = GLEW_APPLE_row_bytes; - continue; - } -#endif -#ifdef GL_APPLE_specular_vector - if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) - { - ret = GLEW_APPLE_specular_vector; - continue; - } -#endif -#ifdef GL_APPLE_texture_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) - { - ret = GLEW_APPLE_texture_range; - continue; - } -#endif -#ifdef GL_APPLE_transform_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) - { - ret = GLEW_APPLE_transform_hint; - continue; - } -#endif -#ifdef GL_APPLE_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_APPLE_vertex_array_object; - continue; - } -#endif -#ifdef GL_APPLE_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLEW_APPLE_vertex_array_range; - continue; - } -#endif -#ifdef GL_APPLE_vertex_program_evaluators - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) - { - ret = GLEW_APPLE_vertex_program_evaluators; - continue; - } -#endif -#ifdef GL_APPLE_ycbcr_422 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) - { - ret = GLEW_APPLE_ycbcr_422; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef GL_ARB_ES2_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) - { - ret = GLEW_ARB_ES2_compatibility; - continue; - } -#endif -#ifdef GL_ARB_ES3_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) - { - ret = GLEW_ARB_ES3_compatibility; - continue; - } -#endif -#ifdef GL_ARB_arrays_of_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) - { - ret = GLEW_ARB_arrays_of_arrays; - continue; - } -#endif -#ifdef GL_ARB_base_instance - if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) - { - ret = GLEW_ARB_base_instance; - continue; - } -#endif -#ifdef GL_ARB_blend_func_extended - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) - { - ret = GLEW_ARB_blend_func_extended; - continue; - } -#endif -#ifdef GL_ARB_cl_event - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) - { - ret = GLEW_ARB_cl_event; - continue; - } -#endif -#ifdef GL_ARB_clear_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) - { - ret = GLEW_ARB_clear_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_color_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) - { - ret = GLEW_ARB_color_buffer_float; - continue; - } -#endif -#ifdef GL_ARB_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) - { - ret = GLEW_ARB_compatibility; - continue; - } -#endif -#ifdef GL_ARB_compressed_texture_pixel_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) - { - ret = GLEW_ARB_compressed_texture_pixel_storage; - continue; - } -#endif -#ifdef GL_ARB_compute_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) - { - ret = GLEW_ARB_compute_shader; - continue; - } -#endif -#ifdef GL_ARB_conservative_depth - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) - { - ret = GLEW_ARB_conservative_depth; - continue; - } -#endif -#ifdef GL_ARB_copy_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) - { - ret = GLEW_ARB_copy_buffer; - continue; - } -#endif -#ifdef GL_ARB_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLEW_ARB_copy_image; - continue; - } -#endif -#ifdef GL_ARB_debug_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) - { - ret = GLEW_ARB_debug_output; - continue; - } -#endif -#ifdef GL_ARB_depth_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) - { - ret = GLEW_ARB_depth_buffer_float; - continue; - } -#endif -#ifdef GL_ARB_depth_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) - { - ret = GLEW_ARB_depth_clamp; - continue; - } -#endif -#ifdef GL_ARB_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) - { - ret = GLEW_ARB_depth_texture; - continue; - } -#endif -#ifdef GL_ARB_draw_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) - { - ret = GLEW_ARB_draw_buffers; - continue; - } -#endif -#ifdef GL_ARB_draw_buffers_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) - { - ret = GLEW_ARB_draw_buffers_blend; - continue; - } -#endif -#ifdef GL_ARB_draw_elements_base_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) - { - ret = GLEW_ARB_draw_elements_base_vertex; - continue; - } -#endif -#ifdef GL_ARB_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) - { - ret = GLEW_ARB_draw_indirect; - continue; - } -#endif -#ifdef GL_ARB_draw_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) - { - ret = GLEW_ARB_draw_instanced; - continue; - } -#endif -#ifdef GL_ARB_explicit_attrib_location - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) - { - ret = GLEW_ARB_explicit_attrib_location; - continue; - } -#endif -#ifdef GL_ARB_explicit_uniform_location - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) - { - ret = GLEW_ARB_explicit_uniform_location; - continue; - } -#endif -#ifdef GL_ARB_fragment_coord_conventions - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) - { - ret = GLEW_ARB_fragment_coord_conventions; - continue; - } -#endif -#ifdef GL_ARB_fragment_layer_viewport - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) - { - ret = GLEW_ARB_fragment_layer_viewport; - continue; - } -#endif -#ifdef GL_ARB_fragment_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) - { - ret = GLEW_ARB_fragment_program; - continue; - } -#endif -#ifdef GL_ARB_fragment_program_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) - { - ret = GLEW_ARB_fragment_program_shadow; - continue; - } -#endif -#ifdef GL_ARB_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) - { - ret = GLEW_ARB_fragment_shader; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_no_attachments - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) - { - ret = GLEW_ARB_framebuffer_no_attachments; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) - { - ret = GLEW_ARB_framebuffer_object; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef GL_ARB_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_ARB_geometry_shader4; - continue; - } -#endif -#ifdef GL_ARB_get_program_binary - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) - { - ret = GLEW_ARB_get_program_binary; - continue; - } -#endif -#ifdef GL_ARB_gpu_shader5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) - { - ret = GLEW_ARB_gpu_shader5; - continue; - } -#endif -#ifdef GL_ARB_gpu_shader_fp64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) - { - ret = GLEW_ARB_gpu_shader_fp64; - continue; - } -#endif -#ifdef GL_ARB_half_float_pixel - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) - { - ret = GLEW_ARB_half_float_pixel; - continue; - } -#endif -#ifdef GL_ARB_half_float_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) - { - ret = GLEW_ARB_half_float_vertex; - continue; - } -#endif -#ifdef GL_ARB_imaging - if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) - { - ret = GLEW_ARB_imaging; - continue; - } -#endif -#ifdef GL_ARB_instanced_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) - { - ret = GLEW_ARB_instanced_arrays; - continue; - } -#endif -#ifdef GL_ARB_internalformat_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) - { - ret = GLEW_ARB_internalformat_query; - continue; - } -#endif -#ifdef GL_ARB_internalformat_query2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) - { - ret = GLEW_ARB_internalformat_query2; - continue; - } -#endif -#ifdef GL_ARB_invalidate_subdata - if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) - { - ret = GLEW_ARB_invalidate_subdata; - continue; - } -#endif -#ifdef GL_ARB_map_buffer_alignment - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) - { - ret = GLEW_ARB_map_buffer_alignment; - continue; - } -#endif -#ifdef GL_ARB_map_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) - { - ret = GLEW_ARB_map_buffer_range; - continue; - } -#endif -#ifdef GL_ARB_matrix_palette - if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) - { - ret = GLEW_ARB_matrix_palette; - continue; - } -#endif -#ifdef GL_ARB_multi_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) - { - ret = GLEW_ARB_multi_draw_indirect; - continue; - } -#endif -#ifdef GL_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_ARB_multisample; - continue; - } -#endif -#ifdef GL_ARB_multitexture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) - { - ret = GLEW_ARB_multitexture; - continue; - } -#endif -#ifdef GL_ARB_occlusion_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) - { - ret = GLEW_ARB_occlusion_query; - continue; - } -#endif -#ifdef GL_ARB_occlusion_query2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) - { - ret = GLEW_ARB_occlusion_query2; - continue; - } -#endif -#ifdef GL_ARB_pixel_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) - { - ret = GLEW_ARB_pixel_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_point_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) - { - ret = GLEW_ARB_point_parameters; - continue; - } -#endif -#ifdef GL_ARB_point_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) - { - ret = GLEW_ARB_point_sprite; - continue; - } -#endif -#ifdef GL_ARB_program_interface_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) - { - ret = GLEW_ARB_program_interface_query; - continue; - } -#endif -#ifdef GL_ARB_provoking_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) - { - ret = GLEW_ARB_provoking_vertex; - continue; - } -#endif -#ifdef GL_ARB_robust_buffer_access_behavior - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) - { - ret = GLEW_ARB_robust_buffer_access_behavior; - continue; - } -#endif -#ifdef GL_ARB_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) - { - ret = GLEW_ARB_robustness; - continue; - } -#endif -#ifdef GL_ARB_robustness_application_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) - { - ret = GLEW_ARB_robustness_application_isolation; - continue; - } -#endif -#ifdef GL_ARB_robustness_share_group_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) - { - ret = GLEW_ARB_robustness_share_group_isolation; - continue; - } -#endif -#ifdef GL_ARB_sample_shading - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) - { - ret = GLEW_ARB_sample_shading; - continue; - } -#endif -#ifdef GL_ARB_sampler_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) - { - ret = GLEW_ARB_sampler_objects; - continue; - } -#endif -#ifdef GL_ARB_seamless_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) - { - ret = GLEW_ARB_seamless_cube_map; - continue; - } -#endif -#ifdef GL_ARB_separate_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) - { - ret = GLEW_ARB_separate_shader_objects; - continue; - } -#endif -#ifdef GL_ARB_shader_atomic_counters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) - { - ret = GLEW_ARB_shader_atomic_counters; - continue; - } -#endif -#ifdef GL_ARB_shader_bit_encoding - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) - { - ret = GLEW_ARB_shader_bit_encoding; - continue; - } -#endif -#ifdef GL_ARB_shader_image_load_store - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) - { - ret = GLEW_ARB_shader_image_load_store; - continue; - } -#endif -#ifdef GL_ARB_shader_image_size - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) - { - ret = GLEW_ARB_shader_image_size; - continue; - } -#endif -#ifdef GL_ARB_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) - { - ret = GLEW_ARB_shader_objects; - continue; - } -#endif -#ifdef GL_ARB_shader_precision - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) - { - ret = GLEW_ARB_shader_precision; - continue; - } -#endif -#ifdef GL_ARB_shader_stencil_export - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) - { - ret = GLEW_ARB_shader_stencil_export; - continue; - } -#endif -#ifdef GL_ARB_shader_storage_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) - { - ret = GLEW_ARB_shader_storage_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_shader_subroutine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) - { - ret = GLEW_ARB_shader_subroutine; - continue; - } -#endif -#ifdef GL_ARB_shader_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) - { - ret = GLEW_ARB_shader_texture_lod; - continue; - } -#endif -#ifdef GL_ARB_shading_language_100 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) - { - ret = GLEW_ARB_shading_language_100; - continue; - } -#endif -#ifdef GL_ARB_shading_language_420pack - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) - { - ret = GLEW_ARB_shading_language_420pack; - continue; - } -#endif -#ifdef GL_ARB_shading_language_include - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) - { - ret = GLEW_ARB_shading_language_include; - continue; - } -#endif -#ifdef GL_ARB_shading_language_packing - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) - { - ret = GLEW_ARB_shading_language_packing; - continue; - } -#endif -#ifdef GL_ARB_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) - { - ret = GLEW_ARB_shadow; - continue; - } -#endif -#ifdef GL_ARB_shadow_ambient - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) - { - ret = GLEW_ARB_shadow_ambient; - continue; - } -#endif -#ifdef GL_ARB_stencil_texturing - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) - { - ret = GLEW_ARB_stencil_texturing; - continue; - } -#endif -#ifdef GL_ARB_sync - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) - { - ret = GLEW_ARB_sync; - continue; - } -#endif -#ifdef GL_ARB_tessellation_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) - { - ret = GLEW_ARB_tessellation_shader; - continue; - } -#endif -#ifdef GL_ARB_texture_border_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) - { - ret = GLEW_ARB_texture_border_clamp; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) - { - ret = GLEW_ARB_texture_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_object_rgb32 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) - { - ret = GLEW_ARB_texture_buffer_object_rgb32; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) - { - ret = GLEW_ARB_texture_buffer_range; - continue; - } -#endif -#ifdef GL_ARB_texture_compression - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) - { - ret = GLEW_ARB_texture_compression; - continue; - } -#endif -#ifdef GL_ARB_texture_compression_bptc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) - { - ret = GLEW_ARB_texture_compression_bptc; - continue; - } -#endif -#ifdef GL_ARB_texture_compression_rgtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) - { - ret = GLEW_ARB_texture_compression_rgtc; - continue; - } -#endif -#ifdef GL_ARB_texture_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) - { - ret = GLEW_ARB_texture_cube_map; - continue; - } -#endif -#ifdef GL_ARB_texture_cube_map_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) - { - ret = GLEW_ARB_texture_cube_map_array; - continue; - } -#endif -#ifdef GL_ARB_texture_env_add - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) - { - ret = GLEW_ARB_texture_env_add; - continue; - } -#endif -#ifdef GL_ARB_texture_env_combine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) - { - ret = GLEW_ARB_texture_env_combine; - continue; - } -#endif -#ifdef GL_ARB_texture_env_crossbar - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) - { - ret = GLEW_ARB_texture_env_crossbar; - continue; - } -#endif -#ifdef GL_ARB_texture_env_dot3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) - { - ret = GLEW_ARB_texture_env_dot3; - continue; - } -#endif -#ifdef GL_ARB_texture_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) - { - ret = GLEW_ARB_texture_float; - continue; - } -#endif -#ifdef GL_ARB_texture_gather - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) - { - ret = GLEW_ARB_texture_gather; - continue; - } -#endif -#ifdef GL_ARB_texture_mirrored_repeat - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) - { - ret = GLEW_ARB_texture_mirrored_repeat; - continue; - } -#endif -#ifdef GL_ARB_texture_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) - { - ret = GLEW_ARB_texture_multisample; - continue; - } -#endif -#ifdef GL_ARB_texture_non_power_of_two - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) - { - ret = GLEW_ARB_texture_non_power_of_two; - continue; - } -#endif -#ifdef GL_ARB_texture_query_levels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) - { - ret = GLEW_ARB_texture_query_levels; - continue; - } -#endif -#ifdef GL_ARB_texture_query_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) - { - ret = GLEW_ARB_texture_query_lod; - continue; - } -#endif -#ifdef GL_ARB_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_ARB_texture_rectangle; - continue; - } -#endif -#ifdef GL_ARB_texture_rg - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) - { - ret = GLEW_ARB_texture_rg; - continue; - } -#endif -#ifdef GL_ARB_texture_rgb10_a2ui - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) - { - ret = GLEW_ARB_texture_rgb10_a2ui; - continue; - } -#endif -#ifdef GL_ARB_texture_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) - { - ret = GLEW_ARB_texture_storage; - continue; - } -#endif -#ifdef GL_ARB_texture_storage_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) - { - ret = GLEW_ARB_texture_storage_multisample; - continue; - } -#endif -#ifdef GL_ARB_texture_swizzle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) - { - ret = GLEW_ARB_texture_swizzle; - continue; - } -#endif -#ifdef GL_ARB_texture_view - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) - { - ret = GLEW_ARB_texture_view; - continue; - } -#endif -#ifdef GL_ARB_timer_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) - { - ret = GLEW_ARB_timer_query; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) - { - ret = GLEW_ARB_transform_feedback2; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) - { - ret = GLEW_ARB_transform_feedback3; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) - { - ret = GLEW_ARB_transform_feedback_instanced; - continue; - } -#endif -#ifdef GL_ARB_transpose_matrix - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) - { - ret = GLEW_ARB_transpose_matrix; - continue; - } -#endif -#ifdef GL_ARB_uniform_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) - { - ret = GLEW_ARB_uniform_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_array_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) - { - ret = GLEW_ARB_vertex_array_bgra; - continue; - } -#endif -#ifdef GL_ARB_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_ARB_vertex_array_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_attrib_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) - { - ret = GLEW_ARB_vertex_attrib_64bit; - continue; - } -#endif -#ifdef GL_ARB_vertex_attrib_binding - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) - { - ret = GLEW_ARB_vertex_attrib_binding; - continue; - } -#endif -#ifdef GL_ARB_vertex_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) - { - ret = GLEW_ARB_vertex_blend; - continue; - } -#endif -#ifdef GL_ARB_vertex_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) - { - ret = GLEW_ARB_vertex_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) - { - ret = GLEW_ARB_vertex_program; - continue; - } -#endif -#ifdef GL_ARB_vertex_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) - { - ret = GLEW_ARB_vertex_shader; - continue; - } -#endif -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) - { - ret = GLEW_ARB_vertex_type_2_10_10_10_rev; - continue; - } -#endif -#ifdef GL_ARB_viewport_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) - { - ret = GLEW_ARB_viewport_array; - continue; - } -#endif -#ifdef GL_ARB_window_pos - if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) - { - ret = GLEW_ARB_window_pos; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) - { -#ifdef GL_ATIX_point_sprites - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) - { - ret = GLEW_ATIX_point_sprites; - continue; - } -#endif -#ifdef GL_ATIX_texture_env_combine3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) - { - ret = GLEW_ATIX_texture_env_combine3; - continue; - } -#endif -#ifdef GL_ATIX_texture_env_route - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) - { - ret = GLEW_ATIX_texture_env_route; - continue; - } -#endif -#ifdef GL_ATIX_vertex_shader_output_point_size - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) - { - ret = GLEW_ATIX_vertex_shader_output_point_size; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef GL_ATI_draw_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) - { - ret = GLEW_ATI_draw_buffers; - continue; - } -#endif -#ifdef GL_ATI_element_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) - { - ret = GLEW_ATI_element_array; - continue; - } -#endif -#ifdef GL_ATI_envmap_bumpmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) - { - ret = GLEW_ATI_envmap_bumpmap; - continue; - } -#endif -#ifdef GL_ATI_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) - { - ret = GLEW_ATI_fragment_shader; - continue; - } -#endif -#ifdef GL_ATI_map_object_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) - { - ret = GLEW_ATI_map_object_buffer; - continue; - } -#endif -#ifdef GL_ATI_meminfo - if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) - { - ret = GLEW_ATI_meminfo; - continue; - } -#endif -#ifdef GL_ATI_pn_triangles - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) - { - ret = GLEW_ATI_pn_triangles; - continue; - } -#endif -#ifdef GL_ATI_separate_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) - { - ret = GLEW_ATI_separate_stencil; - continue; - } -#endif -#ifdef GL_ATI_shader_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) - { - ret = GLEW_ATI_shader_texture_lod; - continue; - } -#endif -#ifdef GL_ATI_text_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) - { - ret = GLEW_ATI_text_fragment_shader; - continue; - } -#endif -#ifdef GL_ATI_texture_compression_3dc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) - { - ret = GLEW_ATI_texture_compression_3dc; - continue; - } -#endif -#ifdef GL_ATI_texture_env_combine3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) - { - ret = GLEW_ATI_texture_env_combine3; - continue; - } -#endif -#ifdef GL_ATI_texture_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) - { - ret = GLEW_ATI_texture_float; - continue; - } -#endif -#ifdef GL_ATI_texture_mirror_once - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) - { - ret = GLEW_ATI_texture_mirror_once; - continue; - } -#endif -#ifdef GL_ATI_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_ATI_vertex_array_object; - continue; - } -#endif -#ifdef GL_ATI_vertex_attrib_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) - { - ret = GLEW_ATI_vertex_attrib_array_object; - continue; - } -#endif -#ifdef GL_ATI_vertex_streams - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) - { - ret = GLEW_ATI_vertex_streams; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef GL_EXT_422_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) - { - ret = GLEW_EXT_422_pixels; - continue; - } -#endif -#ifdef GL_EXT_Cg_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) - { - ret = GLEW_EXT_Cg_shader; - continue; - } -#endif -#ifdef GL_EXT_abgr - if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) - { - ret = GLEW_EXT_abgr; - continue; - } -#endif -#ifdef GL_EXT_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) - { - ret = GLEW_EXT_bgra; - continue; - } -#endif -#ifdef GL_EXT_bindable_uniform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) - { - ret = GLEW_EXT_bindable_uniform; - continue; - } -#endif -#ifdef GL_EXT_blend_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) - { - ret = GLEW_EXT_blend_color; - continue; - } -#endif -#ifdef GL_EXT_blend_equation_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) - { - ret = GLEW_EXT_blend_equation_separate; - continue; - } -#endif -#ifdef GL_EXT_blend_func_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) - { - ret = GLEW_EXT_blend_func_separate; - continue; - } -#endif -#ifdef GL_EXT_blend_logic_op - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) - { - ret = GLEW_EXT_blend_logic_op; - continue; - } -#endif -#ifdef GL_EXT_blend_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) - { - ret = GLEW_EXT_blend_minmax; - continue; - } -#endif -#ifdef GL_EXT_blend_subtract - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) - { - ret = GLEW_EXT_blend_subtract; - continue; - } -#endif -#ifdef GL_EXT_clip_volume_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) - { - ret = GLEW_EXT_clip_volume_hint; - continue; - } -#endif -#ifdef GL_EXT_cmyka - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) - { - ret = GLEW_EXT_cmyka; - continue; - } -#endif -#ifdef GL_EXT_color_subtable - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) - { - ret = GLEW_EXT_color_subtable; - continue; - } -#endif -#ifdef GL_EXT_compiled_vertex_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) - { - ret = GLEW_EXT_compiled_vertex_array; - continue; - } -#endif -#ifdef GL_EXT_convolution - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) - { - ret = GLEW_EXT_convolution; - continue; - } -#endif -#ifdef GL_EXT_coordinate_frame - if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) - { - ret = GLEW_EXT_coordinate_frame; - continue; - } -#endif -#ifdef GL_EXT_copy_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) - { - ret = GLEW_EXT_copy_texture; - continue; - } -#endif -#ifdef GL_EXT_cull_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) - { - ret = GLEW_EXT_cull_vertex; - continue; - } -#endif -#ifdef GL_EXT_debug_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) - { - ret = GLEW_EXT_debug_marker; - continue; - } -#endif -#ifdef GL_EXT_depth_bounds_test - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) - { - ret = GLEW_EXT_depth_bounds_test; - continue; - } -#endif -#ifdef GL_EXT_direct_state_access - if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) - { - ret = GLEW_EXT_direct_state_access; - continue; - } -#endif -#ifdef GL_EXT_draw_buffers2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) - { - ret = GLEW_EXT_draw_buffers2; - continue; - } -#endif -#ifdef GL_EXT_draw_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) - { - ret = GLEW_EXT_draw_instanced; - continue; - } -#endif -#ifdef GL_EXT_draw_range_elements - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) - { - ret = GLEW_EXT_draw_range_elements; - continue; - } -#endif -#ifdef GL_EXT_fog_coord - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) - { - ret = GLEW_EXT_fog_coord; - continue; - } -#endif -#ifdef GL_EXT_fragment_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) - { - ret = GLEW_EXT_fragment_lighting; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_blit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) - { - ret = GLEW_EXT_framebuffer_blit; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) - { - ret = GLEW_EXT_framebuffer_multisample; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_multisample_blit_scaled - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) - { - ret = GLEW_EXT_framebuffer_multisample_blit_scaled; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) - { - ret = GLEW_EXT_framebuffer_object; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef GL_EXT_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_EXT_geometry_shader4; - continue; - } -#endif -#ifdef GL_EXT_gpu_program_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) - { - ret = GLEW_EXT_gpu_program_parameters; - continue; - } -#endif -#ifdef GL_EXT_gpu_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) - { - ret = GLEW_EXT_gpu_shader4; - continue; - } -#endif -#ifdef GL_EXT_histogram - if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) - { - ret = GLEW_EXT_histogram; - continue; - } -#endif -#ifdef GL_EXT_index_array_formats - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) - { - ret = GLEW_EXT_index_array_formats; - continue; - } -#endif -#ifdef GL_EXT_index_func - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) - { - ret = GLEW_EXT_index_func; - continue; - } -#endif -#ifdef GL_EXT_index_material - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) - { - ret = GLEW_EXT_index_material; - continue; - } -#endif -#ifdef GL_EXT_index_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) - { - ret = GLEW_EXT_index_texture; - continue; - } -#endif -#ifdef GL_EXT_light_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) - { - ret = GLEW_EXT_light_texture; - continue; - } -#endif -#ifdef GL_EXT_misc_attribute - if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) - { - ret = GLEW_EXT_misc_attribute; - continue; - } -#endif -#ifdef GL_EXT_multi_draw_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) - { - ret = GLEW_EXT_multi_draw_arrays; - continue; - } -#endif -#ifdef GL_EXT_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_EXT_multisample; - continue; - } -#endif -#ifdef GL_EXT_packed_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) - { - ret = GLEW_EXT_packed_depth_stencil; - continue; - } -#endif -#ifdef GL_EXT_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) - { - ret = GLEW_EXT_packed_float; - continue; - } -#endif -#ifdef GL_EXT_packed_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) - { - ret = GLEW_EXT_packed_pixels; - continue; - } -#endif -#ifdef GL_EXT_paletted_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) - { - ret = GLEW_EXT_paletted_texture; - continue; - } -#endif -#ifdef GL_EXT_pixel_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) - { - ret = GLEW_EXT_pixel_buffer_object; - continue; - } -#endif -#ifdef GL_EXT_pixel_transform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) - { - ret = GLEW_EXT_pixel_transform; - continue; - } -#endif -#ifdef GL_EXT_pixel_transform_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) - { - ret = GLEW_EXT_pixel_transform_color_table; - continue; - } -#endif -#ifdef GL_EXT_point_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) - { - ret = GLEW_EXT_point_parameters; - continue; - } -#endif -#ifdef GL_EXT_polygon_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) - { - ret = GLEW_EXT_polygon_offset; - continue; - } -#endif -#ifdef GL_EXT_provoking_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) - { - ret = GLEW_EXT_provoking_vertex; - continue; - } -#endif -#ifdef GL_EXT_rescale_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) - { - ret = GLEW_EXT_rescale_normal; - continue; - } -#endif -#ifdef GL_EXT_scene_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) - { - ret = GLEW_EXT_scene_marker; - continue; - } -#endif -#ifdef GL_EXT_secondary_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) - { - ret = GLEW_EXT_secondary_color; - continue; - } -#endif -#ifdef GL_EXT_separate_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) - { - ret = GLEW_EXT_separate_shader_objects; - continue; - } -#endif -#ifdef GL_EXT_separate_specular_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) - { - ret = GLEW_EXT_separate_specular_color; - continue; - } -#endif -#ifdef GL_EXT_shader_image_load_store - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) - { - ret = GLEW_EXT_shader_image_load_store; - continue; - } -#endif -#ifdef GL_EXT_shadow_funcs - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) - { - ret = GLEW_EXT_shadow_funcs; - continue; - } -#endif -#ifdef GL_EXT_shared_texture_palette - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) - { - ret = GLEW_EXT_shared_texture_palette; - continue; - } -#endif -#ifdef GL_EXT_stencil_clear_tag - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) - { - ret = GLEW_EXT_stencil_clear_tag; - continue; - } -#endif -#ifdef GL_EXT_stencil_two_side - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) - { - ret = GLEW_EXT_stencil_two_side; - continue; - } -#endif -#ifdef GL_EXT_stencil_wrap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) - { - ret = GLEW_EXT_stencil_wrap; - continue; - } -#endif -#ifdef GL_EXT_subtexture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) - { - ret = GLEW_EXT_subtexture; - continue; - } -#endif -#ifdef GL_EXT_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) - { - ret = GLEW_EXT_texture; - continue; - } -#endif -#ifdef GL_EXT_texture3D - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) - { - ret = GLEW_EXT_texture3D; - continue; - } -#endif -#ifdef GL_EXT_texture_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) - { - ret = GLEW_EXT_texture_array; - continue; - } -#endif -#ifdef GL_EXT_texture_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) - { - ret = GLEW_EXT_texture_buffer_object; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_dxt1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) - { - ret = GLEW_EXT_texture_compression_dxt1; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_latc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) - { - ret = GLEW_EXT_texture_compression_latc; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_rgtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) - { - ret = GLEW_EXT_texture_compression_rgtc; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_s3tc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) - { - ret = GLEW_EXT_texture_compression_s3tc; - continue; - } -#endif -#ifdef GL_EXT_texture_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) - { - ret = GLEW_EXT_texture_cube_map; - continue; - } -#endif -#ifdef GL_EXT_texture_edge_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) - { - ret = GLEW_EXT_texture_edge_clamp; - continue; - } -#endif -#ifdef GL_EXT_texture_env - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) - { - ret = GLEW_EXT_texture_env; - continue; - } -#endif -#ifdef GL_EXT_texture_env_add - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) - { - ret = GLEW_EXT_texture_env_add; - continue; - } -#endif -#ifdef GL_EXT_texture_env_combine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) - { - ret = GLEW_EXT_texture_env_combine; - continue; - } -#endif -#ifdef GL_EXT_texture_env_dot3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) - { - ret = GLEW_EXT_texture_env_dot3; - continue; - } -#endif -#ifdef GL_EXT_texture_filter_anisotropic - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) - { - ret = GLEW_EXT_texture_filter_anisotropic; - continue; - } -#endif -#ifdef GL_EXT_texture_integer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) - { - ret = GLEW_EXT_texture_integer; - continue; - } -#endif -#ifdef GL_EXT_texture_lod_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) - { - ret = GLEW_EXT_texture_lod_bias; - continue; - } -#endif -#ifdef GL_EXT_texture_mirror_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) - { - ret = GLEW_EXT_texture_mirror_clamp; - continue; - } -#endif -#ifdef GL_EXT_texture_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) - { - ret = GLEW_EXT_texture_object; - continue; - } -#endif -#ifdef GL_EXT_texture_perturb_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) - { - ret = GLEW_EXT_texture_perturb_normal; - continue; - } -#endif -#ifdef GL_EXT_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_EXT_texture_rectangle; - continue; - } -#endif -#ifdef GL_EXT_texture_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) - { - ret = GLEW_EXT_texture_sRGB; - continue; - } -#endif -#ifdef GL_EXT_texture_sRGB_decode - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) - { - ret = GLEW_EXT_texture_sRGB_decode; - continue; - } -#endif -#ifdef GL_EXT_texture_shared_exponent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) - { - ret = GLEW_EXT_texture_shared_exponent; - continue; - } -#endif -#ifdef GL_EXT_texture_snorm - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) - { - ret = GLEW_EXT_texture_snorm; - continue; - } -#endif -#ifdef GL_EXT_texture_swizzle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) - { - ret = GLEW_EXT_texture_swizzle; - continue; - } -#endif -#ifdef GL_EXT_timer_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) - { - ret = GLEW_EXT_timer_query; - continue; - } -#endif -#ifdef GL_EXT_transform_feedback - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) - { - ret = GLEW_EXT_transform_feedback; - continue; - } -#endif -#ifdef GL_EXT_vertex_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) - { - ret = GLEW_EXT_vertex_array; - continue; - } -#endif -#ifdef GL_EXT_vertex_array_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) - { - ret = GLEW_EXT_vertex_array_bgra; - continue; - } -#endif -#ifdef GL_EXT_vertex_attrib_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) - { - ret = GLEW_EXT_vertex_attrib_64bit; - continue; - } -#endif -#ifdef GL_EXT_vertex_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) - { - ret = GLEW_EXT_vertex_shader; - continue; - } -#endif -#ifdef GL_EXT_vertex_weighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) - { - ret = GLEW_EXT_vertex_weighting; - continue; - } -#endif -#ifdef GL_EXT_x11_sync_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) - { - ret = GLEW_EXT_x11_sync_object; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) - { -#ifdef GL_GREMEDY_frame_terminator - if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) - { - ret = GLEW_GREMEDY_frame_terminator; - continue; - } -#endif -#ifdef GL_GREMEDY_string_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) - { - ret = GLEW_GREMEDY_string_marker; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) - { -#ifdef GL_HP_convolution_border_modes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) - { - ret = GLEW_HP_convolution_border_modes; - continue; - } -#endif -#ifdef GL_HP_image_transform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) - { - ret = GLEW_HP_image_transform; - continue; - } -#endif -#ifdef GL_HP_occlusion_test - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) - { - ret = GLEW_HP_occlusion_test; - continue; - } -#endif -#ifdef GL_HP_texture_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) - { - ret = GLEW_HP_texture_lighting; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) - { -#ifdef GL_IBM_cull_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) - { - ret = GLEW_IBM_cull_vertex; - continue; - } -#endif -#ifdef GL_IBM_multimode_draw_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) - { - ret = GLEW_IBM_multimode_draw_arrays; - continue; - } -#endif -#ifdef GL_IBM_rasterpos_clip - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) - { - ret = GLEW_IBM_rasterpos_clip; - continue; - } -#endif -#ifdef GL_IBM_static_data - if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) - { - ret = GLEW_IBM_static_data; - continue; - } -#endif -#ifdef GL_IBM_texture_mirrored_repeat - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) - { - ret = GLEW_IBM_texture_mirrored_repeat; - continue; - } -#endif -#ifdef GL_IBM_vertex_array_lists - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) - { - ret = GLEW_IBM_vertex_array_lists; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) - { -#ifdef GL_INGR_color_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) - { - ret = GLEW_INGR_color_clamp; - continue; - } -#endif -#ifdef GL_INGR_interlace_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) - { - ret = GLEW_INGR_interlace_read; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) - { -#ifdef GL_INTEL_parallel_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) - { - ret = GLEW_INTEL_parallel_arrays; - continue; - } -#endif -#ifdef GL_INTEL_texture_scissor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) - { - ret = GLEW_INTEL_texture_scissor; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) - { -#ifdef GL_KHR_debug - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) - { - ret = GLEW_KHR_debug; - continue; - } -#endif -#ifdef GL_KHR_texture_compression_astc_ldr - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) - { - ret = GLEW_KHR_texture_compression_astc_ldr; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) - { -#ifdef GL_KTX_buffer_region - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) - { - ret = GLEW_KTX_buffer_region; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) - { -#ifdef GL_MESAX_texture_stack - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) - { - ret = GLEW_MESAX_texture_stack; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) - { -#ifdef GL_MESA_pack_invert - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) - { - ret = GLEW_MESA_pack_invert; - continue; - } -#endif -#ifdef GL_MESA_resize_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) - { - ret = GLEW_MESA_resize_buffers; - continue; - } -#endif -#ifdef GL_MESA_window_pos - if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) - { - ret = GLEW_MESA_window_pos; - continue; - } -#endif -#ifdef GL_MESA_ycbcr_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) - { - ret = GLEW_MESA_ycbcr_texture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) - { -#ifdef GL_NVX_gpu_memory_info - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) - { - ret = GLEW_NVX_gpu_memory_info; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef GL_NV_bindless_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) - { - ret = GLEW_NV_bindless_texture; - continue; - } -#endif -#ifdef GL_NV_blend_square - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) - { - ret = GLEW_NV_blend_square; - continue; - } -#endif -#ifdef GL_NV_conditional_render - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) - { - ret = GLEW_NV_conditional_render; - continue; - } -#endif -#ifdef GL_NV_copy_depth_to_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) - { - ret = GLEW_NV_copy_depth_to_color; - continue; - } -#endif -#ifdef GL_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLEW_NV_copy_image; - continue; - } -#endif -#ifdef GL_NV_depth_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) - { - ret = GLEW_NV_depth_buffer_float; - continue; - } -#endif -#ifdef GL_NV_depth_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) - { - ret = GLEW_NV_depth_clamp; - continue; - } -#endif -#ifdef GL_NV_depth_range_unclamped - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) - { - ret = GLEW_NV_depth_range_unclamped; - continue; - } -#endif -#ifdef GL_NV_evaluators - if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) - { - ret = GLEW_NV_evaluators; - continue; - } -#endif -#ifdef GL_NV_explicit_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) - { - ret = GLEW_NV_explicit_multisample; - continue; - } -#endif -#ifdef GL_NV_fence - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) - { - ret = GLEW_NV_fence; - continue; - } -#endif -#ifdef GL_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = GLEW_NV_float_buffer; - continue; - } -#endif -#ifdef GL_NV_fog_distance - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) - { - ret = GLEW_NV_fog_distance; - continue; - } -#endif -#ifdef GL_NV_fragment_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) - { - ret = GLEW_NV_fragment_program; - continue; - } -#endif -#ifdef GL_NV_fragment_program2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) - { - ret = GLEW_NV_fragment_program2; - continue; - } -#endif -#ifdef GL_NV_fragment_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) - { - ret = GLEW_NV_fragment_program4; - continue; - } -#endif -#ifdef GL_NV_fragment_program_option - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) - { - ret = GLEW_NV_fragment_program_option; - continue; - } -#endif -#ifdef GL_NV_framebuffer_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) - { - ret = GLEW_NV_framebuffer_multisample_coverage; - continue; - } -#endif -#ifdef GL_NV_geometry_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) - { - ret = GLEW_NV_geometry_program4; - continue; - } -#endif -#ifdef GL_NV_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_NV_geometry_shader4; - continue; - } -#endif -#ifdef GL_NV_gpu_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) - { - ret = GLEW_NV_gpu_program4; - continue; - } -#endif -#ifdef GL_NV_gpu_program5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) - { - ret = GLEW_NV_gpu_program5; - continue; - } -#endif -#ifdef GL_NV_gpu_program_fp64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) - { - ret = GLEW_NV_gpu_program_fp64; - continue; - } -#endif -#ifdef GL_NV_gpu_shader5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) - { - ret = GLEW_NV_gpu_shader5; - continue; - } -#endif -#ifdef GL_NV_half_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) - { - ret = GLEW_NV_half_float; - continue; - } -#endif -#ifdef GL_NV_light_max_exponent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) - { - ret = GLEW_NV_light_max_exponent; - continue; - } -#endif -#ifdef GL_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = GLEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef GL_NV_multisample_filter_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) - { - ret = GLEW_NV_multisample_filter_hint; - continue; - } -#endif -#ifdef GL_NV_occlusion_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) - { - ret = GLEW_NV_occlusion_query; - continue; - } -#endif -#ifdef GL_NV_packed_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) - { - ret = GLEW_NV_packed_depth_stencil; - continue; - } -#endif -#ifdef GL_NV_parameter_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) - { - ret = GLEW_NV_parameter_buffer_object; - continue; - } -#endif -#ifdef GL_NV_parameter_buffer_object2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) - { - ret = GLEW_NV_parameter_buffer_object2; - continue; - } -#endif -#ifdef GL_NV_path_rendering - if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) - { - ret = GLEW_NV_path_rendering; - continue; - } -#endif -#ifdef GL_NV_pixel_data_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) - { - ret = GLEW_NV_pixel_data_range; - continue; - } -#endif -#ifdef GL_NV_point_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) - { - ret = GLEW_NV_point_sprite; - continue; - } -#endif -#ifdef GL_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = GLEW_NV_present_video; - continue; - } -#endif -#ifdef GL_NV_primitive_restart - if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) - { - ret = GLEW_NV_primitive_restart; - continue; - } -#endif -#ifdef GL_NV_register_combiners - if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) - { - ret = GLEW_NV_register_combiners; - continue; - } -#endif -#ifdef GL_NV_register_combiners2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) - { - ret = GLEW_NV_register_combiners2; - continue; - } -#endif -#ifdef GL_NV_shader_atomic_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) - { - ret = GLEW_NV_shader_atomic_float; - continue; - } -#endif -#ifdef GL_NV_shader_buffer_load - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) - { - ret = GLEW_NV_shader_buffer_load; - continue; - } -#endif -#ifdef GL_NV_tessellation_program5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) - { - ret = GLEW_NV_tessellation_program5; - continue; - } -#endif -#ifdef GL_NV_texgen_emboss - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) - { - ret = GLEW_NV_texgen_emboss; - continue; - } -#endif -#ifdef GL_NV_texgen_reflection - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) - { - ret = GLEW_NV_texgen_reflection; - continue; - } -#endif -#ifdef GL_NV_texture_barrier - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) - { - ret = GLEW_NV_texture_barrier; - continue; - } -#endif -#ifdef GL_NV_texture_compression_vtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) - { - ret = GLEW_NV_texture_compression_vtc; - continue; - } -#endif -#ifdef GL_NV_texture_env_combine4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) - { - ret = GLEW_NV_texture_env_combine4; - continue; - } -#endif -#ifdef GL_NV_texture_expand_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) - { - ret = GLEW_NV_texture_expand_normal; - continue; - } -#endif -#ifdef GL_NV_texture_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) - { - ret = GLEW_NV_texture_multisample; - continue; - } -#endif -#ifdef GL_NV_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_NV_texture_rectangle; - continue; - } -#endif -#ifdef GL_NV_texture_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) - { - ret = GLEW_NV_texture_shader; - continue; - } -#endif -#ifdef GL_NV_texture_shader2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) - { - ret = GLEW_NV_texture_shader2; - continue; - } -#endif -#ifdef GL_NV_texture_shader3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) - { - ret = GLEW_NV_texture_shader3; - continue; - } -#endif -#ifdef GL_NV_transform_feedback - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) - { - ret = GLEW_NV_transform_feedback; - continue; - } -#endif -#ifdef GL_NV_transform_feedback2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) - { - ret = GLEW_NV_transform_feedback2; - continue; - } -#endif -#ifdef GL_NV_vdpau_interop - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) - { - ret = GLEW_NV_vdpau_interop; - continue; - } -#endif -#ifdef GL_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef GL_NV_vertex_array_range2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) - { - ret = GLEW_NV_vertex_array_range2; - continue; - } -#endif -#ifdef GL_NV_vertex_attrib_integer_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) - { - ret = GLEW_NV_vertex_attrib_integer_64bit; - continue; - } -#endif -#ifdef GL_NV_vertex_buffer_unified_memory - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) - { - ret = GLEW_NV_vertex_buffer_unified_memory; - continue; - } -#endif -#ifdef GL_NV_vertex_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) - { - ret = GLEW_NV_vertex_program; - continue; - } -#endif -#ifdef GL_NV_vertex_program1_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) - { - ret = GLEW_NV_vertex_program1_1; - continue; - } -#endif -#ifdef GL_NV_vertex_program2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) - { - ret = GLEW_NV_vertex_program2; - continue; - } -#endif -#ifdef GL_NV_vertex_program2_option - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) - { - ret = GLEW_NV_vertex_program2_option; - continue; - } -#endif -#ifdef GL_NV_vertex_program3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) - { - ret = GLEW_NV_vertex_program3; - continue; - } -#endif -#ifdef GL_NV_vertex_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) - { - ret = GLEW_NV_vertex_program4; - continue; - } -#endif -#ifdef GL_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = GLEW_NV_video_capture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) - { -#ifdef GL_OES_byte_coordinates - if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) - { - ret = GLEW_OES_byte_coordinates; - continue; - } -#endif -#ifdef GL_OES_compressed_paletted_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) - { - ret = GLEW_OES_compressed_paletted_texture; - continue; - } -#endif -#ifdef GL_OES_read_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) - { - ret = GLEW_OES_read_format; - continue; - } -#endif -#ifdef GL_OES_single_precision - if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) - { - ret = GLEW_OES_single_precision; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef GL_OML_interlace - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) - { - ret = GLEW_OML_interlace; - continue; - } -#endif -#ifdef GL_OML_resample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) - { - ret = GLEW_OML_resample; - continue; - } -#endif -#ifdef GL_OML_subsample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) - { - ret = GLEW_OML_subsample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) - { -#ifdef GL_PGI_misc_hints - if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) - { - ret = GLEW_PGI_misc_hints; - continue; - } -#endif -#ifdef GL_PGI_vertex_hints - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) - { - ret = GLEW_PGI_vertex_hints; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) - { -#ifdef GL_REGAL_error_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) - { - ret = GLEW_REGAL_error_string; - continue; - } -#endif -#ifdef GL_REGAL_extension_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) - { - ret = GLEW_REGAL_extension_query; - continue; - } -#endif -#ifdef GL_REGAL_log - if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) - { - ret = GLEW_REGAL_log; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) - { -#ifdef GL_REND_screen_coordinates - if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) - { - ret = GLEW_REND_screen_coordinates; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) - { -#ifdef GL_S3_s3tc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) - { - ret = GLEW_S3_s3tc; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) - { -#ifdef GL_SGIS_color_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) - { - ret = GLEW_SGIS_color_range; - continue; - } -#endif -#ifdef GL_SGIS_detail_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) - { - ret = GLEW_SGIS_detail_texture; - continue; - } -#endif -#ifdef GL_SGIS_fog_function - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) - { - ret = GLEW_SGIS_fog_function; - continue; - } -#endif -#ifdef GL_SGIS_generate_mipmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) - { - ret = GLEW_SGIS_generate_mipmap; - continue; - } -#endif -#ifdef GL_SGIS_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_SGIS_multisample; - continue; - } -#endif -#ifdef GL_SGIS_pixel_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) - { - ret = GLEW_SGIS_pixel_texture; - continue; - } -#endif -#ifdef GL_SGIS_point_line_texgen - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) - { - ret = GLEW_SGIS_point_line_texgen; - continue; - } -#endif -#ifdef GL_SGIS_sharpen_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) - { - ret = GLEW_SGIS_sharpen_texture; - continue; - } -#endif -#ifdef GL_SGIS_texture4D - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) - { - ret = GLEW_SGIS_texture4D; - continue; - } -#endif -#ifdef GL_SGIS_texture_border_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) - { - ret = GLEW_SGIS_texture_border_clamp; - continue; - } -#endif -#ifdef GL_SGIS_texture_edge_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) - { - ret = GLEW_SGIS_texture_edge_clamp; - continue; - } -#endif -#ifdef GL_SGIS_texture_filter4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) - { - ret = GLEW_SGIS_texture_filter4; - continue; - } -#endif -#ifdef GL_SGIS_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) - { - ret = GLEW_SGIS_texture_lod; - continue; - } -#endif -#ifdef GL_SGIS_texture_select - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) - { - ret = GLEW_SGIS_texture_select; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) - { -#ifdef GL_SGIX_async - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) - { - ret = GLEW_SGIX_async; - continue; - } -#endif -#ifdef GL_SGIX_async_histogram - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) - { - ret = GLEW_SGIX_async_histogram; - continue; - } -#endif -#ifdef GL_SGIX_async_pixel - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) - { - ret = GLEW_SGIX_async_pixel; - continue; - } -#endif -#ifdef GL_SGIX_blend_alpha_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) - { - ret = GLEW_SGIX_blend_alpha_minmax; - continue; - } -#endif -#ifdef GL_SGIX_clipmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) - { - ret = GLEW_SGIX_clipmap; - continue; - } -#endif -#ifdef GL_SGIX_convolution_accuracy - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) - { - ret = GLEW_SGIX_convolution_accuracy; - continue; - } -#endif -#ifdef GL_SGIX_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) - { - ret = GLEW_SGIX_depth_texture; - continue; - } -#endif -#ifdef GL_SGIX_flush_raster - if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) - { - ret = GLEW_SGIX_flush_raster; - continue; - } -#endif -#ifdef GL_SGIX_fog_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) - { - ret = GLEW_SGIX_fog_offset; - continue; - } -#endif -#ifdef GL_SGIX_fog_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) - { - ret = GLEW_SGIX_fog_texture; - continue; - } -#endif -#ifdef GL_SGIX_fragment_specular_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) - { - ret = GLEW_SGIX_fragment_specular_lighting; - continue; - } -#endif -#ifdef GL_SGIX_framezoom - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) - { - ret = GLEW_SGIX_framezoom; - continue; - } -#endif -#ifdef GL_SGIX_interlace - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) - { - ret = GLEW_SGIX_interlace; - continue; - } -#endif -#ifdef GL_SGIX_ir_instrument1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) - { - ret = GLEW_SGIX_ir_instrument1; - continue; - } -#endif -#ifdef GL_SGIX_list_priority - if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) - { - ret = GLEW_SGIX_list_priority; - continue; - } -#endif -#ifdef GL_SGIX_pixel_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) - { - ret = GLEW_SGIX_pixel_texture; - continue; - } -#endif -#ifdef GL_SGIX_pixel_texture_bits - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) - { - ret = GLEW_SGIX_pixel_texture_bits; - continue; - } -#endif -#ifdef GL_SGIX_reference_plane - if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) - { - ret = GLEW_SGIX_reference_plane; - continue; - } -#endif -#ifdef GL_SGIX_resample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) - { - ret = GLEW_SGIX_resample; - continue; - } -#endif -#ifdef GL_SGIX_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) - { - ret = GLEW_SGIX_shadow; - continue; - } -#endif -#ifdef GL_SGIX_shadow_ambient - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) - { - ret = GLEW_SGIX_shadow_ambient; - continue; - } -#endif -#ifdef GL_SGIX_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) - { - ret = GLEW_SGIX_sprite; - continue; - } -#endif -#ifdef GL_SGIX_tag_sample_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) - { - ret = GLEW_SGIX_tag_sample_buffer; - continue; - } -#endif -#ifdef GL_SGIX_texture_add_env - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) - { - ret = GLEW_SGIX_texture_add_env; - continue; - } -#endif -#ifdef GL_SGIX_texture_coordinate_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) - { - ret = GLEW_SGIX_texture_coordinate_clamp; - continue; - } -#endif -#ifdef GL_SGIX_texture_lod_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) - { - ret = GLEW_SGIX_texture_lod_bias; - continue; - } -#endif -#ifdef GL_SGIX_texture_multi_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) - { - ret = GLEW_SGIX_texture_multi_buffer; - continue; - } -#endif -#ifdef GL_SGIX_texture_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) - { - ret = GLEW_SGIX_texture_range; - continue; - } -#endif -#ifdef GL_SGIX_texture_scale_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) - { - ret = GLEW_SGIX_texture_scale_bias; - continue; - } -#endif -#ifdef GL_SGIX_vertex_preclip - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) - { - ret = GLEW_SGIX_vertex_preclip; - continue; - } -#endif -#ifdef GL_SGIX_vertex_preclip_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) - { - ret = GLEW_SGIX_vertex_preclip_hint; - continue; - } -#endif -#ifdef GL_SGIX_ycrcb - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) - { - ret = GLEW_SGIX_ycrcb; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) - { -#ifdef GL_SGI_color_matrix - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) - { - ret = GLEW_SGI_color_matrix; - continue; - } -#endif -#ifdef GL_SGI_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) - { - ret = GLEW_SGI_color_table; - continue; - } -#endif -#ifdef GL_SGI_texture_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) - { - ret = GLEW_SGI_texture_color_table; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) - { -#ifdef GL_SUNX_constant_data - if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) - { - ret = GLEW_SUNX_constant_data; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) - { -#ifdef GL_SUN_convolution_border_modes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) - { - ret = GLEW_SUN_convolution_border_modes; - continue; - } -#endif -#ifdef GL_SUN_global_alpha - if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) - { - ret = GLEW_SUN_global_alpha; - continue; - } -#endif -#ifdef GL_SUN_mesh_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) - { - ret = GLEW_SUN_mesh_array; - continue; - } -#endif -#ifdef GL_SUN_read_video_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) - { - ret = GLEW_SUN_read_video_pixels; - continue; - } -#endif -#ifdef GL_SUN_slice_accum - if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) - { - ret = GLEW_SUN_slice_accum; - continue; - } -#endif -#ifdef GL_SUN_triangle_list - if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) - { - ret = GLEW_SUN_triangle_list; - continue; - } -#endif -#ifdef GL_SUN_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) - { - ret = GLEW_SUN_vertex; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) - { -#ifdef GL_WIN_phong_shading - if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) - { - ret = GLEW_WIN_phong_shading; - continue; - } -#endif -#ifdef GL_WIN_specular_fog - if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) - { - ret = GLEW_WIN_specular_fog; - continue; - } -#endif -#ifdef GL_WIN_swap_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) - { - ret = GLEW_WIN_swap_hint; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#if defined(_WIN32) - -#if defined(GLEW_MX) -GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) -#else -GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) -#endif -{ - GLubyte* pos = (GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef WGL_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_3DFX_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) - { -#ifdef WGL_3DL_stereo_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) - { - ret = WGLEW_3DL_stereo_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef WGL_AMD_gpu_association - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) - { - ret = WGLEW_AMD_gpu_association; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef WGL_ARB_buffer_region - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) - { - ret = WGLEW_ARB_buffer_region; - continue; - } -#endif -#ifdef WGL_ARB_create_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) - { - ret = WGLEW_ARB_create_context; - continue; - } -#endif -#ifdef WGL_ARB_create_context_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) - { - ret = WGLEW_ARB_create_context_profile; - continue; - } -#endif -#ifdef WGL_ARB_create_context_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) - { - ret = WGLEW_ARB_create_context_robustness; - continue; - } -#endif -#ifdef WGL_ARB_extensions_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) - { - ret = WGLEW_ARB_extensions_string; - continue; - } -#endif -#ifdef WGL_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = WGLEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef WGL_ARB_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = WGLEW_ARB_make_current_read; - continue; - } -#endif -#ifdef WGL_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_ARB_multisample; - continue; - } -#endif -#ifdef WGL_ARB_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = WGLEW_ARB_pbuffer; - continue; - } -#endif -#ifdef WGL_ARB_pixel_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) - { - ret = WGLEW_ARB_pixel_format; - continue; - } -#endif -#ifdef WGL_ARB_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = WGLEW_ARB_pixel_format_float; - continue; - } -#endif -#ifdef WGL_ARB_render_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) - { - ret = WGLEW_ARB_render_texture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef WGL_ATI_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = WGLEW_ATI_pixel_format_float; - continue; - } -#endif -#ifdef WGL_ATI_render_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) - { - ret = WGLEW_ATI_render_texture_rectangle; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef WGL_EXT_create_context_es2_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) - { - ret = WGLEW_EXT_create_context_es2_profile; - continue; - } -#endif -#ifdef WGL_EXT_create_context_es_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) - { - ret = WGLEW_EXT_create_context_es_profile; - continue; - } -#endif -#ifdef WGL_EXT_depth_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) - { - ret = WGLEW_EXT_depth_float; - continue; - } -#endif -#ifdef WGL_EXT_display_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) - { - ret = WGLEW_EXT_display_color_table; - continue; - } -#endif -#ifdef WGL_EXT_extensions_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) - { - ret = WGLEW_EXT_extensions_string; - continue; - } -#endif -#ifdef WGL_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = WGLEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef WGL_EXT_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = WGLEW_EXT_make_current_read; - continue; - } -#endif -#ifdef WGL_EXT_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_EXT_multisample; - continue; - } -#endif -#ifdef WGL_EXT_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = WGLEW_EXT_pbuffer; - continue; - } -#endif -#ifdef WGL_EXT_pixel_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) - { - ret = WGLEW_EXT_pixel_format; - continue; - } -#endif -#ifdef WGL_EXT_pixel_format_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) - { - ret = WGLEW_EXT_pixel_format_packed_float; - continue; - } -#endif -#ifdef WGL_EXT_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = WGLEW_EXT_swap_control; - continue; - } -#endif -#ifdef WGL_EXT_swap_control_tear - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) - { - ret = WGLEW_EXT_swap_control_tear; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) - { -#ifdef WGL_I3D_digital_video_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) - { - ret = WGLEW_I3D_digital_video_control; - continue; - } -#endif -#ifdef WGL_I3D_gamma - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) - { - ret = WGLEW_I3D_gamma; - continue; - } -#endif -#ifdef WGL_I3D_genlock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) - { - ret = WGLEW_I3D_genlock; - continue; - } -#endif -#ifdef WGL_I3D_image_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) - { - ret = WGLEW_I3D_image_buffer; - continue; - } -#endif -#ifdef WGL_I3D_swap_frame_lock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) - { - ret = WGLEW_I3D_swap_frame_lock; - continue; - } -#endif -#ifdef WGL_I3D_swap_frame_usage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) - { - ret = WGLEW_I3D_swap_frame_usage; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef WGL_NV_DX_interop - if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) - { - ret = WGLEW_NV_DX_interop; - continue; - } -#endif -#ifdef WGL_NV_DX_interop2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) - { - ret = WGLEW_NV_DX_interop2; - continue; - } -#endif -#ifdef WGL_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = WGLEW_NV_copy_image; - continue; - } -#endif -#ifdef WGL_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = WGLEW_NV_float_buffer; - continue; - } -#endif -#ifdef WGL_NV_gpu_affinity - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) - { - ret = WGLEW_NV_gpu_affinity; - continue; - } -#endif -#ifdef WGL_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = WGLEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef WGL_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = WGLEW_NV_present_video; - continue; - } -#endif -#ifdef WGL_NV_render_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) - { - ret = WGLEW_NV_render_depth_texture; - continue; - } -#endif -#ifdef WGL_NV_render_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) - { - ret = WGLEW_NV_render_texture_rectangle; - continue; - } -#endif -#ifdef WGL_NV_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = WGLEW_NV_swap_group; - continue; - } -#endif -#ifdef WGL_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = WGLEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef WGL_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = WGLEW_NV_video_capture; - continue; - } -#endif -#ifdef WGL_NV_video_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) - { - ret = WGLEW_NV_video_output; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef WGL_OML_sync_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) - { - ret = WGLEW_OML_sync_control; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#elif !defined(__ANDROID__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) - -#if defined(GLEW_MX) -GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) -#else -GLboolean glxewIsSupported (const char* name) -#endif -{ - GLubyte* pos = (GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) - { -#ifdef GLX_VERSION_1_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) - { - ret = GLXEW_VERSION_1_2; - continue; - } -#endif -#ifdef GLX_VERSION_1_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) - { - ret = GLXEW_VERSION_1_3; - continue; - } -#endif -#ifdef GLX_VERSION_1_4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) - { - ret = GLXEW_VERSION_1_4; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef GLX_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_3DFX_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef GLX_AMD_gpu_association - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) - { - ret = GLXEW_AMD_gpu_association; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef GLX_ARB_create_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) - { - ret = GLXEW_ARB_create_context; - continue; - } -#endif -#ifdef GLX_ARB_create_context_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) - { - ret = GLXEW_ARB_create_context_profile; - continue; - } -#endif -#ifdef GLX_ARB_create_context_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) - { - ret = GLXEW_ARB_create_context_robustness; - continue; - } -#endif -#ifdef GLX_ARB_fbconfig_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) - { - ret = GLXEW_ARB_fbconfig_float; - continue; - } -#endif -#ifdef GLX_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLXEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef GLX_ARB_get_proc_address - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) - { - ret = GLXEW_ARB_get_proc_address; - continue; - } -#endif -#ifdef GLX_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_ARB_multisample; - continue; - } -#endif -#ifdef GLX_ARB_robustness_application_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) - { - ret = GLXEW_ARB_robustness_application_isolation; - continue; - } -#endif -#ifdef GLX_ARB_robustness_share_group_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) - { - ret = GLXEW_ARB_robustness_share_group_isolation; - continue; - } -#endif -#ifdef GLX_ARB_vertex_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) - { - ret = GLXEW_ARB_vertex_buffer_object; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef GLX_ATI_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = GLXEW_ATI_pixel_format_float; - continue; - } -#endif -#ifdef GLX_ATI_render_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) - { - ret = GLXEW_ATI_render_texture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef GLX_EXT_create_context_es2_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) - { - ret = GLXEW_EXT_create_context_es2_profile; - continue; - } -#endif -#ifdef GLX_EXT_create_context_es_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) - { - ret = GLXEW_EXT_create_context_es_profile; - continue; - } -#endif -#ifdef GLX_EXT_fbconfig_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) - { - ret = GLXEW_EXT_fbconfig_packed_float; - continue; - } -#endif -#ifdef GLX_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLXEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef GLX_EXT_import_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) - { - ret = GLXEW_EXT_import_context; - continue; - } -#endif -#ifdef GLX_EXT_scene_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) - { - ret = GLXEW_EXT_scene_marker; - continue; - } -#endif -#ifdef GLX_EXT_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_EXT_swap_control; - continue; - } -#endif -#ifdef GLX_EXT_swap_control_tear - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) - { - ret = GLXEW_EXT_swap_control_tear; - continue; - } -#endif -#ifdef GLX_EXT_texture_from_pixmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) - { - ret = GLXEW_EXT_texture_from_pixmap; - continue; - } -#endif -#ifdef GLX_EXT_visual_info - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) - { - ret = GLXEW_EXT_visual_info; - continue; - } -#endif -#ifdef GLX_EXT_visual_rating - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) - { - ret = GLXEW_EXT_visual_rating; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) - { -#ifdef GLX_INTEL_swap_event - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) - { - ret = GLXEW_INTEL_swap_event; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) - { -#ifdef GLX_MESA_agp_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) - { - ret = GLXEW_MESA_agp_offset; - continue; - } -#endif -#ifdef GLX_MESA_copy_sub_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) - { - ret = GLXEW_MESA_copy_sub_buffer; - continue; - } -#endif -#ifdef GLX_MESA_pixmap_colormap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) - { - ret = GLXEW_MESA_pixmap_colormap; - continue; - } -#endif -#ifdef GLX_MESA_release_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) - { - ret = GLXEW_MESA_release_buffers; - continue; - } -#endif -#ifdef GLX_MESA_set_3dfx_mode - if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) - { - ret = GLXEW_MESA_set_3dfx_mode; - continue; - } -#endif -#ifdef GLX_MESA_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_MESA_swap_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef GLX_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLXEW_NV_copy_image; - continue; - } -#endif -#ifdef GLX_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = GLXEW_NV_float_buffer; - continue; - } -#endif -#ifdef GLX_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = GLXEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef GLX_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = GLXEW_NV_present_video; - continue; - } -#endif -#ifdef GLX_NV_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = GLXEW_NV_swap_group; - continue; - } -#endif -#ifdef GLX_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLXEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef GLX_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = GLXEW_NV_video_capture; - continue; - } -#endif -#ifdef GLX_NV_video_out - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) - { - ret = GLXEW_NV_video_out; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef GLX_OML_swap_method - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) - { - ret = GLXEW_OML_swap_method; - continue; - } -#endif -#ifdef GLX_OML_sync_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) - { - ret = GLXEW_OML_sync_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) - { -#ifdef GLX_SGIS_blended_overlay - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) - { - ret = GLXEW_SGIS_blended_overlay; - continue; - } -#endif -#ifdef GLX_SGIS_color_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) - { - ret = GLXEW_SGIS_color_range; - continue; - } -#endif -#ifdef GLX_SGIS_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_SGIS_multisample; - continue; - } -#endif -#ifdef GLX_SGIS_shared_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) - { - ret = GLXEW_SGIS_shared_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) - { -#ifdef GLX_SGIX_fbconfig - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) - { - ret = GLXEW_SGIX_fbconfig; - continue; - } -#endif -#ifdef GLX_SGIX_hyperpipe - if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) - { - ret = GLXEW_SGIX_hyperpipe; - continue; - } -#endif -#ifdef GLX_SGIX_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = GLXEW_SGIX_pbuffer; - continue; - } -#endif -#ifdef GLX_SGIX_swap_barrier - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) - { - ret = GLXEW_SGIX_swap_barrier; - continue; - } -#endif -#ifdef GLX_SGIX_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = GLXEW_SGIX_swap_group; - continue; - } -#endif -#ifdef GLX_SGIX_video_resize - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) - { - ret = GLXEW_SGIX_video_resize; - continue; - } -#endif -#ifdef GLX_SGIX_visual_select_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) - { - ret = GLXEW_SGIX_visual_select_group; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) - { -#ifdef GLX_SGI_cushion - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) - { - ret = GLXEW_SGI_cushion; - continue; - } -#endif -#ifdef GLX_SGI_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = GLXEW_SGI_make_current_read; - continue; - } -#endif -#ifdef GLX_SGI_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_SGI_swap_control; - continue; - } -#endif -#ifdef GLX_SGI_video_sync - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) - { - ret = GLXEW_SGI_video_sync; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) - { -#ifdef GLX_SUN_get_transparent_index - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) - { - ret = GLXEW_SUN_get_transparent_index; - continue; - } -#endif -#ifdef GLX_SUN_video_resize - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) - { - ret = GLXEW_SUN_video_resize; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#endif /* _WIN32 */ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "glew.h" + +#if defined(_WIN32) +# include "wglew.h" +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include "glxew.h" +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = dlopen("libRegal.dylib", RTLD_LAZY); +#else + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); +#endif + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#else + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#endif + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Define GLboolean const cast. + */ +#define CONST_CAST(x) (*(GLboolean*)&x) + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return (s[i] == '\0' || s[i] == c) ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +#if !defined(_WIN32) || !defined(GLEW_MX) + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; +PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; +PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; +PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; +PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; +PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; + +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; + +PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; +PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; +PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + +PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; + +PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; +PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; +PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; +PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; +PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; +PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; +PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; +PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; +PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; +PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + +PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; + +PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; +PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; +PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; +PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; +PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; +PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; +PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; +PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; +PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; +PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; +PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; +PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; +PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; +PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; +PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT = NULL; +PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT = NULL; +PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT = NULL; +PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT = NULL; +PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; +PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; +PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; +PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; +PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; +PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; + +PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; +PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; + +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; +PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; +PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; +PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; +PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; +PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; +PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; +PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; +PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; +PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; +PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; +PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; +PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; +PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; +PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; +PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; +PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; +PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; +PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; +PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; +PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; +PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; +PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; +PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; +PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; +PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; +PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; +PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; +PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; +PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; +PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; +PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; +PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; +PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; + +PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; + +PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; +PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; +PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; +PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; +PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; +PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; +PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; + +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; + +PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; +PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; +PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; +PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; +PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; +PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; +PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; +PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; +PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; +PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; + +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; +PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; +PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; +PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; +PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; +PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; +PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + +PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; +PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; +PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; + +PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; + +PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; + +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; + +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; + +PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; +PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; +PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; +PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; +PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; +PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; +PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; + +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; +PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; +PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; +PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; + +PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; +PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; +PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; +PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; +PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; +PFNGLORTHOFOESPROC __glewOrthofOES = NULL; + +PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; + +PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; +PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; +GLboolean __GLEW_VERSION_4_3 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; +GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; +GLboolean __GLEW_AMD_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_compute_shader = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_copy_image = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; +GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_texture_view = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_debug_marker = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_float = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_integer = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; +GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; +GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KHR_debug = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NV_bindless_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_multisample = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_NV_video_capture = GL_FALSE; +GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; +GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; +GLboolean __GLEW_OES_read_format = GL_FALSE; +GLboolean __GLEW_OES_single_precision = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_REGAL_error_string = GL_FALSE; +GLboolean __GLEW_REGAL_extension_query = GL_FALSE; +GLboolean __GLEW_REGAL_log = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_2_1 + +#endif /* GL_VERSION_1_2_1 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; + r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_VERSION_2_1 + +static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; + r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; + r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; + r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; + r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; + r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_1 */ + +#ifdef GL_VERSION_3_0 + +static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_1 + +#endif /* GL_VERSION_4_1 */ + +#ifdef GL_VERSION_4_2 + +#endif /* GL_VERSION_4_2 */ + +#ifdef GL_VERSION_4_3 + +#endif /* GL_VERSION_4_3 */ + +#ifdef GL_3DFX_multisample + +#endif /* GL_3DFX_multisample */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_3DFX_texture_compression_FXT1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifdef GL_AMD_blend_minmax_factor + +#endif /* GL_AMD_blend_minmax_factor */ + +#ifdef GL_AMD_conservative_depth + +#endif /* GL_AMD_conservative_depth */ + +#ifdef GL_AMD_debug_output + +static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_depth_clamp_separate + +#endif /* GL_AMD_depth_clamp_separate */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_pinned_memory + +#endif /* GL_AMD_pinned_memory */ + +#ifdef GL_AMD_query_buffer_object + +#endif /* GL_AMD_query_buffer_object */ + +#ifdef GL_AMD_sample_positions + +static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sample_positions */ + +#ifdef GL_AMD_seamless_cubemap_per_texture + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifdef GL_AMD_shader_stencil_export + +#endif /* GL_AMD_shader_stencil_export */ + +#ifdef GL_AMD_stencil_operation_extended + +static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_stencil_operation_extended */ + +#ifdef GL_AMD_texture_texture4 + +#endif /* GL_AMD_texture_texture4 */ + +#ifdef GL_AMD_transform_feedback3_lines_triangles + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifdef GL_AMD_vertex_shader_layer + +#endif /* GL_AMD_vertex_shader_layer */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_AMD_vertex_shader_viewport_index + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifdef GL_APPLE_aux_depth_stencil + +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifdef GL_APPLE_client_storage + +#endif /* GL_APPLE_client_storage */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_float_pixels + +#endif /* GL_APPLE_float_pixels */ + +#ifdef GL_APPLE_flush_buffer_range + +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; + r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_flush_buffer_range */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_pixel_buffer + +#endif /* GL_APPLE_pixel_buffer */ + +#ifdef GL_APPLE_rgb_422 + +#endif /* GL_APPLE_rgb_422 */ + +#ifdef GL_APPLE_row_bytes + +#endif /* GL_APPLE_row_bytes */ + +#ifdef GL_APPLE_specular_vector + +#endif /* GL_APPLE_specular_vector */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_transform_hint + +#endif /* GL_APPLE_transform_hint */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_vertex_program_evaluators + +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_APPLE_ycbcr_422 + +#endif /* GL_APPLE_ycbcr_422 */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_ES3_compatibility + +#endif /* GL_ARB_ES3_compatibility */ + +#ifdef GL_ARB_arrays_of_arrays + +#endif /* GL_ARB_arrays_of_arrays */ + +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_clear_buffer_object + +static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; + r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; + r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; + r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_buffer_object */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_compatibility + +#endif /* GL_ARB_compatibility */ + +#ifdef GL_ARB_compressed_texture_pixel_storage + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifdef GL_ARB_compute_shader + +static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; + r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_shader */ + +#ifdef GL_ARB_conservative_depth + +#endif /* GL_ARB_conservative_depth */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_copy_image + +static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_image */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_depth_buffer_float + +#endif /* GL_ARB_depth_buffer_float */ + +#ifdef GL_ARB_depth_clamp + +#endif /* GL_ARB_depth_clamp */ + +#ifdef GL_ARB_depth_texture + +#endif /* GL_ARB_depth_texture */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_draw_buffers_blend + +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers_blend */ + +#ifdef GL_ARB_draw_elements_base_vertex + +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_draw_instanced + +#endif /* GL_ARB_draw_instanced */ + +#ifdef GL_ARB_explicit_attrib_location + +#endif /* GL_ARB_explicit_attrib_location */ + +#ifdef GL_ARB_explicit_uniform_location + +#endif /* GL_ARB_explicit_uniform_location */ + +#ifdef GL_ARB_fragment_coord_conventions + +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifdef GL_ARB_fragment_layer_viewport + +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifdef GL_ARB_fragment_program + +#endif /* GL_ARB_fragment_program */ + +#ifdef GL_ARB_fragment_program_shadow + +#endif /* GL_ARB_fragment_program_shadow */ + +#ifdef GL_ARB_fragment_shader + +#endif /* GL_ARB_fragment_shader */ + +#ifdef GL_ARB_framebuffer_no_attachments + +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; + r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; + r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_framebuffer_sRGB + +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_gpu_shader5 + +#endif /* GL_ARB_gpu_shader5 */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_half_float_pixel + +#endif /* GL_ARB_half_float_pixel */ + +#ifdef GL_ARB_half_float_vertex + +#endif /* GL_ARB_half_float_vertex */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_internalformat_query2 + +static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query2 */ + +#ifdef GL_ARB_invalidate_subdata + +static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; + r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; + r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; + r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; + r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; + r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_invalidate_subdata */ + +#ifdef GL_ARB_map_buffer_alignment + +#endif /* GL_ARB_map_buffer_alignment */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multi_draw_indirect + +static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; + r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_draw_indirect */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_occlusion_query2 + +#endif /* GL_ARB_occlusion_query2 */ + +#ifdef GL_ARB_pixel_buffer_object + +#endif /* GL_ARB_pixel_buffer_object */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_point_sprite + +#endif /* GL_ARB_point_sprite */ + +#ifdef GL_ARB_program_interface_query + +static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; + r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; + r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; + r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; + r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; + r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_program_interface_query */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_robust_buffer_access_behavior + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_robustness_application_isolation + +#endif /* GL_ARB_robustness_application_isolation */ + +#ifdef GL_ARB_robustness_share_group_isolation + +#endif /* GL_ARB_robustness_share_group_isolation */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_seamless_cube_map + +#endif /* GL_ARB_seamless_cube_map */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + +#ifdef GL_ARB_shader_bit_encoding + +#endif /* GL_ARB_shader_bit_encoding */ + +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ + +#ifdef GL_ARB_shader_image_size + +#endif /* GL_ARB_shader_image_size */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shader_precision + +#endif /* GL_ARB_shader_precision */ + +#ifdef GL_ARB_shader_stencil_export + +#endif /* GL_ARB_shader_stencil_export */ + +#ifdef GL_ARB_shader_storage_buffer_object + +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifdef GL_ARB_shader_subroutine + +static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shader_texture_lod + +#endif /* GL_ARB_shader_texture_lod */ + +#ifdef GL_ARB_shading_language_100 + +#endif /* GL_ARB_shading_language_100 */ + +#ifdef GL_ARB_shading_language_420pack + +#endif /* GL_ARB_shading_language_420pack */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_shading_language_packing + +#endif /* GL_ARB_shading_language_packing */ + +#ifdef GL_ARB_shadow + +#endif /* GL_ARB_shadow */ + +#ifdef GL_ARB_shadow_ambient + +#endif /* GL_ARB_shadow_ambient */ + +#ifdef GL_ARB_stencil_texturing + +#endif /* GL_ARB_stencil_texturing */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_border_clamp + +#endif /* GL_ARB_texture_border_clamp */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_object_rgb32 + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifdef GL_ARB_texture_buffer_range + +static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; + r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_range */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_compression_bptc + +#endif /* GL_ARB_texture_compression_bptc */ + +#ifdef GL_ARB_texture_compression_rgtc + +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifdef GL_ARB_texture_cube_map + +#endif /* GL_ARB_texture_cube_map */ + +#ifdef GL_ARB_texture_cube_map_array + +#endif /* GL_ARB_texture_cube_map_array */ + +#ifdef GL_ARB_texture_env_add + +#endif /* GL_ARB_texture_env_add */ + +#ifdef GL_ARB_texture_env_combine + +#endif /* GL_ARB_texture_env_combine */ + +#ifdef GL_ARB_texture_env_crossbar + +#endif /* GL_ARB_texture_env_crossbar */ + +#ifdef GL_ARB_texture_env_dot3 + +#endif /* GL_ARB_texture_env_dot3 */ + +#ifdef GL_ARB_texture_float + +#endif /* GL_ARB_texture_float */ + +#ifdef GL_ARB_texture_gather + +#endif /* GL_ARB_texture_gather */ + +#ifdef GL_ARB_texture_mirrored_repeat + +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifdef GL_ARB_texture_multisample + +static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_multisample */ + +#ifdef GL_ARB_texture_non_power_of_two + +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifdef GL_ARB_texture_query_levels + +#endif /* GL_ARB_texture_query_levels */ + +#ifdef GL_ARB_texture_query_lod + +#endif /* GL_ARB_texture_query_lod */ + +#ifdef GL_ARB_texture_rectangle + +#endif /* GL_ARB_texture_rectangle */ + +#ifdef GL_ARB_texture_rg + +#endif /* GL_ARB_texture_rg */ + +#ifdef GL_ARB_texture_rgb10_a2ui + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifdef GL_ARB_texture_storage + +static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage */ + +#ifdef GL_ARB_texture_storage_multisample + +static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; + r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; + r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage_multisample */ + +#ifdef GL_ARB_texture_swizzle + +#endif /* GL_ARB_texture_swizzle */ + +#ifdef GL_ARB_texture_view + +static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_view */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_bgra + +#endif /* GL_ARB_vertex_array_bgra */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_attrib_binding + +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; + r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; + r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; + r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; + r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; + r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATIX_point_sprites + +#endif /* GL_ATIX_point_sprites */ + +#ifdef GL_ATIX_texture_env_combine3 + +#endif /* GL_ATIX_texture_env_combine3 */ + +#ifdef GL_ATIX_texture_env_route + +#endif /* GL_ATIX_texture_env_route */ + +#ifdef GL_ATIX_vertex_shader_output_point_size + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_meminfo + +#endif /* GL_ATI_meminfo */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_shader_texture_lod + +#endif /* GL_ATI_shader_texture_lod */ + +#ifdef GL_ATI_text_fragment_shader + +#endif /* GL_ATI_text_fragment_shader */ + +#ifdef GL_ATI_texture_compression_3dc + +#endif /* GL_ATI_texture_compression_3dc */ + +#ifdef GL_ATI_texture_env_combine3 + +#endif /* GL_ATI_texture_env_combine3 */ + +#ifdef GL_ATI_texture_float + +#endif /* GL_ATI_texture_float */ + +#ifdef GL_ATI_texture_mirror_once + +#endif /* GL_ATI_texture_mirror_once */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; + r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; + r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; + r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; + r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; + r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; + r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; + r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_422_pixels + +#endif /* GL_EXT_422_pixels */ + +#ifdef GL_EXT_Cg_shader + +#endif /* GL_EXT_Cg_shader */ + +#ifdef GL_EXT_abgr + +#endif /* GL_EXT_abgr */ + +#ifdef GL_EXT_bgra + +#endif /* GL_EXT_bgra */ + +#ifdef GL_EXT_bindable_uniform + +static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; + r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; + r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_bindable_uniform */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_logic_op + +#endif /* GL_EXT_blend_logic_op */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_blend_subtract + +#endif /* GL_EXT_blend_subtract */ + +#ifdef GL_EXT_clip_volume_hint + +#endif /* GL_EXT_clip_volume_hint */ + +#ifdef GL_EXT_cmyka + +#endif /* GL_EXT_cmyka */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_debug_marker + +static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; + r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; + r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_marker */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dEXT")) == NULL) || r; + r = ((glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dvEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dEXT")) == NULL) || r; + r = ((glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dvEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dEXT")) == NULL) || r; + r = ((glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dvEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dEXT")) == NULL) || r; + r = ((glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dvEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_draw_buffers2 + +static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; + r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; + r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; + r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; + r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; + r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers2 */ + +#ifdef GL_EXT_draw_instanced + +static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; + r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_instanced */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_framebuffer_sRGB + +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifdef GL_EXT_geometry_shader4 + +static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; + r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_geometry_shader4 */ + +#ifdef GL_EXT_gpu_program_parameters + +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; + r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_program_parameters */ + +#ifdef GL_EXT_gpu_shader4 + +static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; + r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; + r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; + r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; + r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; + r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; + r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; + r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; + r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; + r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; + r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; + r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; + r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; + r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; + r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; + r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; + r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; + r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; + r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; + r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; + r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; + r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; + r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; + r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; + r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; + r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; + r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; + r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; + r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; + r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; + r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; + r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; + r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; + r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_shader4 */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_array_formats + +#endif /* GL_EXT_index_array_formats */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_index_texture + +#endif /* GL_EXT_index_texture */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_misc_attribute + +#endif /* GL_EXT_misc_attribute */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_packed_depth_stencil + +#endif /* GL_EXT_packed_depth_stencil */ + +#ifdef GL_EXT_packed_float + +#endif /* GL_EXT_packed_float */ + +#ifdef GL_EXT_packed_pixels + +#endif /* GL_EXT_packed_pixels */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_buffer_object + +#endif /* GL_EXT_pixel_buffer_object */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_pixel_transform_color_table + +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_rescale_normal + +#endif /* GL_EXT_rescale_normal */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_separate_specular_color + +#endif /* GL_EXT_separate_specular_color */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shadow_funcs + +#endif /* GL_EXT_shadow_funcs */ + +#ifdef GL_EXT_shared_texture_palette + +#endif /* GL_EXT_shared_texture_palette */ + +#ifdef GL_EXT_stencil_clear_tag + +#endif /* GL_EXT_stencil_clear_tag */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_stencil_wrap + +#endif /* GL_EXT_stencil_wrap */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture + +#endif /* GL_EXT_texture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_array + +static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_array */ + +#ifdef GL_EXT_texture_buffer_object + +static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_buffer_object */ + +#ifdef GL_EXT_texture_compression_dxt1 + +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifdef GL_EXT_texture_compression_latc + +#endif /* GL_EXT_texture_compression_latc */ + +#ifdef GL_EXT_texture_compression_rgtc + +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifdef GL_EXT_texture_compression_s3tc + +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifdef GL_EXT_texture_cube_map + +#endif /* GL_EXT_texture_cube_map */ + +#ifdef GL_EXT_texture_edge_clamp + +#endif /* GL_EXT_texture_edge_clamp */ + +#ifdef GL_EXT_texture_env + +#endif /* GL_EXT_texture_env */ + +#ifdef GL_EXT_texture_env_add + +#endif /* GL_EXT_texture_env_add */ + +#ifdef GL_EXT_texture_env_combine + +#endif /* GL_EXT_texture_env_combine */ + +#ifdef GL_EXT_texture_env_dot3 + +#endif /* GL_EXT_texture_env_dot3 */ + +#ifdef GL_EXT_texture_filter_anisotropic + +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifdef GL_EXT_texture_integer + +static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; + r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; + r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; + r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; + r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; + r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_integer */ + +#ifdef GL_EXT_texture_lod_bias + +#endif /* GL_EXT_texture_lod_bias */ + +#ifdef GL_EXT_texture_mirror_clamp + +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_rectangle + +#endif /* GL_EXT_texture_rectangle */ + +#ifdef GL_EXT_texture_sRGB + +#endif /* GL_EXT_texture_sRGB */ + +#ifdef GL_EXT_texture_sRGB_decode + +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifdef GL_EXT_texture_shared_exponent + +#endif /* GL_EXT_texture_shared_exponent */ + +#ifdef GL_EXT_texture_snorm + +#endif /* GL_EXT_texture_snorm */ + +#ifdef GL_EXT_texture_swizzle + +#endif /* GL_EXT_texture_swizzle */ + +#ifdef GL_EXT_timer_query + +static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; + r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_timer_query */ + +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_array_bgra + +#endif /* GL_EXT_vertex_array_bgra */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_EXT_x11_sync_object + +static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_x11_sync_object */ + +#ifdef GL_GREMEDY_frame_terminator + +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_frame_terminator */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_convolution_border_modes + +#endif /* GL_HP_convolution_border_modes */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_HP_occlusion_test + +#endif /* GL_HP_occlusion_test */ + +#ifdef GL_HP_texture_lighting + +#endif /* GL_HP_texture_lighting */ + +#ifdef GL_IBM_cull_vertex + +#endif /* GL_IBM_cull_vertex */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_rasterpos_clip + +#endif /* GL_IBM_rasterpos_clip */ + +#ifdef GL_IBM_static_data + +#endif /* GL_IBM_static_data */ + +#ifdef GL_IBM_texture_mirrored_repeat + +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INGR_color_clamp + +#endif /* GL_INGR_color_clamp */ + +#ifdef GL_INGR_interlace_read + +#endif /* GL_INGR_interlace_read */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KHR_debug + +static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; + r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; + r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; + r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; + r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; + r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; + r = ((glGetPointerv = (PFNGLGETPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetPointerv")) == NULL) || r; + r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; + r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; + r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_debug */ + +#ifdef GL_KHR_texture_compression_astc_ldr + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESAX_texture_stack + +#endif /* GL_MESAX_texture_stack */ + +#ifdef GL_MESA_pack_invert + +#endif /* GL_MESA_pack_invert */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_MESA_ycbcr_texture + +#endif /* GL_MESA_ycbcr_texture */ + +#ifdef GL_NVX_gpu_memory_info + +#endif /* GL_NVX_gpu_memory_info */ + +#ifdef GL_NV_bindless_texture + +static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; + r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; + r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; + r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; + r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; + r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; + r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; + r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; + r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; + r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; + r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_texture */ + +#ifdef GL_NV_blend_square + +#endif /* GL_NV_blend_square */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_copy_depth_to_color + +#endif /* GL_NV_copy_depth_to_color */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ + +#ifdef GL_NV_depth_buffer_float + +static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; + r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; + r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_depth_buffer_float */ + +#ifdef GL_NV_depth_clamp + +#endif /* GL_NV_depth_clamp */ + +#ifdef GL_NV_depth_range_unclamped + +#endif /* GL_NV_depth_range_unclamped */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_float_buffer + +#endif /* GL_NV_float_buffer */ + +#ifdef GL_NV_fog_distance + +#endif /* GL_NV_fog_distance */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_fragment_program2 + +#endif /* GL_NV_fragment_program2 */ + +#ifdef GL_NV_fragment_program4 + +#endif /* GL_NV_fragment_program4 */ + +#ifdef GL_NV_fragment_program_option + +#endif /* GL_NV_fragment_program_option */ + +#ifdef GL_NV_framebuffer_multisample_coverage + +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifdef GL_NV_geometry_program4 + +static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_geometry_program4 */ + +#ifdef GL_NV_geometry_shader4 + +#endif /* GL_NV_geometry_shader4 */ + +#ifdef GL_NV_gpu_program4 + +static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; + r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; + r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_program4 */ + +#ifdef GL_NV_gpu_program5 + +#endif /* GL_NV_gpu_program5 */ + +#ifdef GL_NV_gpu_program_fp64 + +#endif /* GL_NV_gpu_program_fp64 */ + +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_light_max_exponent + +#endif /* GL_NV_light_max_exponent */ + +#ifdef GL_NV_multisample_coverage + +#endif /* GL_NV_multisample_coverage */ + +#ifdef GL_NV_multisample_filter_hint + +#endif /* GL_NV_multisample_filter_hint */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_packed_depth_stencil + +#endif /* GL_NV_packed_depth_stencil */ + +#ifdef GL_NV_parameter_buffer_object + +static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; + r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; + r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_parameter_buffer_object */ + +#ifdef GL_NV_parameter_buffer_object2 + +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_shader_atomic_float + +#endif /* GL_NV_shader_atomic_float */ + +#ifdef GL_NV_shader_buffer_load + +static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_shader_buffer_load */ + +#ifdef GL_NV_tessellation_program5 + +#endif /* GL_NV_tessellation_program5 */ + +#ifdef GL_NV_texgen_emboss + +#endif /* GL_NV_texgen_emboss */ + +#ifdef GL_NV_texgen_reflection + +#endif /* GL_NV_texgen_reflection */ + +#ifdef GL_NV_texture_barrier + +static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_compression_vtc + +#endif /* GL_NV_texture_compression_vtc */ + +#ifdef GL_NV_texture_env_combine4 + +#endif /* GL_NV_texture_env_combine4 */ + +#ifdef GL_NV_texture_expand_normal + +#endif /* GL_NV_texture_expand_normal */ + +#ifdef GL_NV_texture_multisample + +static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_multisample */ + +#ifdef GL_NV_texture_rectangle + +#endif /* GL_NV_texture_rectangle */ + +#ifdef GL_NV_texture_shader + +#endif /* GL_NV_texture_shader */ + +#ifdef GL_NV_texture_shader2 + +#endif /* GL_NV_texture_shader2 */ + +#ifdef GL_NV_texture_shader3 + +#endif /* GL_NV_texture_shader3 */ + +#ifdef GL_NV_transform_feedback + +static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; + r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; + r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; + r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; + r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; + r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; + r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; + r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; + r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; + r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback */ + +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_array_range2 + +#endif /* GL_NV_vertex_array_range2 */ + +#ifdef GL_NV_vertex_attrib_integer_64bit + +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_vertex_program1_1 + +#endif /* GL_NV_vertex_program1_1 */ + +#ifdef GL_NV_vertex_program2 + +#endif /* GL_NV_vertex_program2 */ + +#ifdef GL_NV_vertex_program2_option + +#endif /* GL_NV_vertex_program2_option */ + +#ifdef GL_NV_vertex_program3 + +#endif /* GL_NV_vertex_program3 */ + +#ifdef GL_NV_vertex_program4 + +#endif /* GL_NV_vertex_program4 */ + +#ifdef GL_NV_video_capture + +static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; + r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; + r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; + r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_video_capture */ + +#ifdef GL_OES_byte_coordinates + +#endif /* GL_OES_byte_coordinates */ + +#ifdef GL_OES_compressed_paletted_texture + +#endif /* GL_OES_compressed_paletted_texture */ + +#ifdef GL_OES_read_format + +#endif /* GL_OES_read_format */ + +#ifdef GL_OES_single_precision + +static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; + r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; + r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; + r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; + r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; + r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; + + return r; +} + +#endif /* GL_OES_single_precision */ + +#ifdef GL_OML_interlace + +#endif /* GL_OML_interlace */ + +#ifdef GL_OML_resample + +#endif /* GL_OML_resample */ + +#ifdef GL_OML_subsample + +#endif /* GL_OML_subsample */ + +#ifdef GL_PGI_misc_hints + +#endif /* GL_PGI_misc_hints */ + +#ifdef GL_PGI_vertex_hints + +#endif /* GL_PGI_vertex_hints */ + +#ifdef GL_REGAL_error_string + +static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_error_string */ + +#ifdef GL_REGAL_extension_query + +static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; + r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_extension_query */ + +#ifdef GL_REGAL_log + +#endif /* GL_REGAL_log */ + +#ifdef GL_REND_screen_coordinates + +#endif /* GL_REND_screen_coordinates */ + +#ifdef GL_S3_s3tc + +#endif /* GL_S3_s3tc */ + +#ifdef GL_SGIS_color_range + +#endif /* GL_SGIS_color_range */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_generate_mipmap + +#endif /* GL_SGIS_generate_mipmap */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_pixel_texture + +#endif /* GL_SGIS_pixel_texture */ + +#ifdef GL_SGIS_point_line_texgen + +#endif /* GL_SGIS_point_line_texgen */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_border_clamp + +#endif /* GL_SGIS_texture_border_clamp */ + +#ifdef GL_SGIS_texture_edge_clamp + +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIS_texture_lod + +#endif /* GL_SGIS_texture_lod */ + +#ifdef GL_SGIS_texture_select + +#endif /* GL_SGIS_texture_select */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_async_histogram + +#endif /* GL_SGIX_async_histogram */ + +#ifdef GL_SGIX_async_pixel + +#endif /* GL_SGIX_async_pixel */ + +#ifdef GL_SGIX_blend_alpha_minmax + +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifdef GL_SGIX_clipmap + +#endif /* GL_SGIX_clipmap */ + +#ifdef GL_SGIX_convolution_accuracy + +#endif /* GL_SGIX_convolution_accuracy */ + +#ifdef GL_SGIX_depth_texture + +#endif /* GL_SGIX_depth_texture */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_offset + +#endif /* GL_SGIX_fog_offset */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_interlace + +#endif /* GL_SGIX_interlace */ + +#ifdef GL_SGIX_ir_instrument1 + +#endif /* GL_SGIX_ir_instrument1 */ + +#ifdef GL_SGIX_list_priority + +#endif /* GL_SGIX_list_priority */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_pixel_texture_bits + +#endif /* GL_SGIX_pixel_texture_bits */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_resample + +#endif /* GL_SGIX_resample */ + +#ifdef GL_SGIX_shadow + +#endif /* GL_SGIX_shadow */ + +#ifdef GL_SGIX_shadow_ambient + +#endif /* GL_SGIX_shadow_ambient */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_texture_add_env + +#endif /* GL_SGIX_texture_add_env */ + +#ifdef GL_SGIX_texture_coordinate_clamp + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifdef GL_SGIX_texture_lod_bias + +#endif /* GL_SGIX_texture_lod_bias */ + +#ifdef GL_SGIX_texture_multi_buffer + +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifdef GL_SGIX_texture_range + +#endif /* GL_SGIX_texture_range */ + +#ifdef GL_SGIX_texture_scale_bias + +#endif /* GL_SGIX_texture_scale_bias */ + +#ifdef GL_SGIX_vertex_preclip + +#endif /* GL_SGIX_vertex_preclip */ + +#ifdef GL_SGIX_vertex_preclip_hint + +#endif /* GL_SGIX_vertex_preclip_hint */ + +#ifdef GL_SGIX_ycrcb + +#endif /* GL_SGIX_ycrcb */ + +#ifdef GL_SGI_color_matrix + +#endif /* GL_SGI_color_matrix */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_texture_color_table + +#endif /* GL_SGI_texture_color_table */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_convolution_border_modes + +#endif /* GL_SUN_convolution_border_modes */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_mesh_array + +#endif /* GL_SUN_mesh_array */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_slice_accum + +#endif /* GL_SUN_slice_accum */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_phong_shading + +#endif /* GL_WIN_phong_shading */ + +#ifdef GL_WIN_specular_fog + +#endif /* GL_WIN_specular_fog */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + start = (const GLubyte*)glGetString(GL_EXTENSIONS); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot; + GLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + CONST_CAST(GLEW_VERSION_4_3) = ( major > 4 ) || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + /* query opengl extensions string */ + extStart = glGetString(GL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte*)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_2_1 +#endif /* GL_VERSION_1_2_1 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_VERSION_2_1 + if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_1 */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_1 +#endif /* GL_VERSION_4_1 */ +#ifdef GL_VERSION_4_2 +#endif /* GL_VERSION_4_2 */ +#ifdef GL_VERSION_4_3 +#endif /* GL_VERSION_4_3 */ +#ifdef GL_3DFX_multisample + CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); +#endif /* GL_3DFX_multisample */ +#ifdef GL_3DFX_tbuffer + CONST_CAST(GLEW_3DFX_tbuffer) = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); + if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_3DFX_texture_compression_FXT1 + CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); +#endif /* GL_3DFX_texture_compression_FXT1 */ +#ifdef GL_AMD_blend_minmax_factor + CONST_CAST(GLEW_AMD_blend_minmax_factor) = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); +#endif /* GL_AMD_blend_minmax_factor */ +#ifdef GL_AMD_conservative_depth + CONST_CAST(GLEW_AMD_conservative_depth) = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); +#endif /* GL_AMD_conservative_depth */ +#ifdef GL_AMD_debug_output + CONST_CAST(GLEW_AMD_debug_output) = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_depth_clamp_separate + CONST_CAST(GLEW_AMD_depth_clamp_separate) = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); +#endif /* GL_AMD_depth_clamp_separate */ +#ifdef GL_AMD_draw_buffers_blend + CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_multi_draw_indirect + CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_multi_draw_indirect */ +#ifdef GL_AMD_name_gen_delete + CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); + if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_performance_monitor + CONST_CAST(GLEW_AMD_performance_monitor) = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); + if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_pinned_memory + CONST_CAST(GLEW_AMD_pinned_memory) = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); +#endif /* GL_AMD_pinned_memory */ +#ifdef GL_AMD_query_buffer_object + CONST_CAST(GLEW_AMD_query_buffer_object) = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); +#endif /* GL_AMD_query_buffer_object */ +#ifdef GL_AMD_sample_positions + CONST_CAST(GLEW_AMD_sample_positions) = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); + if (glewExperimental || GLEW_AMD_sample_positions) CONST_CAST(GLEW_AMD_sample_positions) = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_sample_positions */ +#ifdef GL_AMD_seamless_cubemap_per_texture + CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); +#endif /* GL_AMD_seamless_cubemap_per_texture */ +#ifdef GL_AMD_shader_stencil_export + CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); +#endif /* GL_AMD_shader_stencil_export */ +#ifdef GL_AMD_stencil_operation_extended + CONST_CAST(GLEW_AMD_stencil_operation_extended) = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); + if (glewExperimental || GLEW_AMD_stencil_operation_extended) CONST_CAST(GLEW_AMD_stencil_operation_extended) = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_stencil_operation_extended */ +#ifdef GL_AMD_texture_texture4 + CONST_CAST(GLEW_AMD_texture_texture4) = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); +#endif /* GL_AMD_texture_texture4 */ +#ifdef GL_AMD_transform_feedback3_lines_triangles + CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); +#endif /* GL_AMD_transform_feedback3_lines_triangles */ +#ifdef GL_AMD_vertex_shader_layer + CONST_CAST(GLEW_AMD_vertex_shader_layer) = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_layer */ +#ifdef GL_AMD_vertex_shader_tessellator + CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_AMD_vertex_shader_viewport_index + CONST_CAST(GLEW_AMD_vertex_shader_viewport_index) = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_viewport_index */ +#ifdef GL_APPLE_aux_depth_stencil + CONST_CAST(GLEW_APPLE_aux_depth_stencil) = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); +#endif /* GL_APPLE_aux_depth_stencil */ +#ifdef GL_APPLE_client_storage + CONST_CAST(GLEW_APPLE_client_storage) = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); +#endif /* GL_APPLE_client_storage */ +#ifdef GL_APPLE_element_array + CONST_CAST(GLEW_APPLE_element_array) = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + CONST_CAST(GLEW_APPLE_fence) = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_float_pixels + CONST_CAST(GLEW_APPLE_float_pixels) = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); +#endif /* GL_APPLE_float_pixels */ +#ifdef GL_APPLE_flush_buffer_range + CONST_CAST(GLEW_APPLE_flush_buffer_range) = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_flush_buffer_range */ +#ifdef GL_APPLE_object_purgeable + CONST_CAST(GLEW_APPLE_object_purgeable) = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_pixel_buffer + CONST_CAST(GLEW_APPLE_pixel_buffer) = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); +#endif /* GL_APPLE_pixel_buffer */ +#ifdef GL_APPLE_rgb_422 + CONST_CAST(GLEW_APPLE_rgb_422) = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); +#endif /* GL_APPLE_rgb_422 */ +#ifdef GL_APPLE_row_bytes + CONST_CAST(GLEW_APPLE_row_bytes) = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); +#endif /* GL_APPLE_row_bytes */ +#ifdef GL_APPLE_specular_vector + CONST_CAST(GLEW_APPLE_specular_vector) = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); +#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_texture_range + CONST_CAST(GLEW_APPLE_texture_range) = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_transform_hint + CONST_CAST(GLEW_APPLE_transform_hint) = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); +#endif /* GL_APPLE_transform_hint */ +#ifdef GL_APPLE_vertex_array_object + CONST_CAST(GLEW_APPLE_vertex_array_object) = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + CONST_CAST(GLEW_APPLE_vertex_array_range) = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_vertex_program_evaluators + CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_APPLE_ycbcr_422 + CONST_CAST(GLEW_APPLE_ycbcr_422) = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); +#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_ARB_ES2_compatibility + CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); + if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_ES3_compatibility + CONST_CAST(GLEW_ARB_ES3_compatibility) = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); +#endif /* GL_ARB_ES3_compatibility */ +#ifdef GL_ARB_arrays_of_arrays + CONST_CAST(GLEW_ARB_arrays_of_arrays) = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); +#endif /* GL_ARB_arrays_of_arrays */ +#ifdef GL_ARB_base_instance + CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); + if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_base_instance */ +#ifdef GL_ARB_blend_func_extended + CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); + if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_cl_event + CONST_CAST(GLEW_ARB_cl_event) = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); + if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_clear_buffer_object + CONST_CAST(GLEW_ARB_clear_buffer_object) = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_clear_buffer_object) CONST_CAST(GLEW_ARB_clear_buffer_object) = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_clear_buffer_object */ +#ifdef GL_ARB_color_buffer_float + CONST_CAST(GLEW_ARB_color_buffer_float) = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_compatibility + CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); +#endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_compressed_texture_pixel_storage + CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); +#endif /* GL_ARB_compressed_texture_pixel_storage */ +#ifdef GL_ARB_compute_shader + CONST_CAST(GLEW_ARB_compute_shader) = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_compute_shader) CONST_CAST(GLEW_ARB_compute_shader) = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_compute_shader */ +#ifdef GL_ARB_conservative_depth + CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); +#endif /* GL_ARB_conservative_depth */ +#ifdef GL_ARB_copy_buffer + CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_copy_image + CONST_CAST(GLEW_ARB_copy_image) = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_image) CONST_CAST(GLEW_ARB_copy_image) = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_image */ +#ifdef GL_ARB_debug_output + CONST_CAST(GLEW_ARB_debug_output) = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_depth_buffer_float + CONST_CAST(GLEW_ARB_depth_buffer_float) = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); +#endif /* GL_ARB_depth_buffer_float */ +#ifdef GL_ARB_depth_clamp + CONST_CAST(GLEW_ARB_depth_clamp) = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); +#endif /* GL_ARB_depth_clamp */ +#ifdef GL_ARB_depth_texture + CONST_CAST(GLEW_ARB_depth_texture) = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); +#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_draw_buffers + CONST_CAST(GLEW_ARB_draw_buffers) = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_draw_buffers_blend + CONST_CAST(GLEW_ARB_draw_buffers_blend) = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + CONST_CAST(GLEW_ARB_draw_indirect) = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_draw_instanced + CONST_CAST(GLEW_ARB_draw_instanced) = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); +#endif /* GL_ARB_draw_instanced */ +#ifdef GL_ARB_explicit_attrib_location + CONST_CAST(GLEW_ARB_explicit_attrib_location) = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); +#endif /* GL_ARB_explicit_attrib_location */ +#ifdef GL_ARB_explicit_uniform_location + CONST_CAST(GLEW_ARB_explicit_uniform_location) = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); +#endif /* GL_ARB_explicit_uniform_location */ +#ifdef GL_ARB_fragment_coord_conventions + CONST_CAST(GLEW_ARB_fragment_coord_conventions) = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); +#endif /* GL_ARB_fragment_coord_conventions */ +#ifdef GL_ARB_fragment_layer_viewport + CONST_CAST(GLEW_ARB_fragment_layer_viewport) = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); +#endif /* GL_ARB_fragment_layer_viewport */ +#ifdef GL_ARB_fragment_program + CONST_CAST(GLEW_ARB_fragment_program) = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); +#endif /* GL_ARB_fragment_program */ +#ifdef GL_ARB_fragment_program_shadow + CONST_CAST(GLEW_ARB_fragment_program_shadow) = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); +#endif /* GL_ARB_fragment_program_shadow */ +#ifdef GL_ARB_fragment_shader + CONST_CAST(GLEW_ARB_fragment_shader) = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); +#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_framebuffer_no_attachments + CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_no_attachments */ +#ifdef GL_ARB_framebuffer_object + CONST_CAST(GLEW_ARB_framebuffer_object) = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_framebuffer_sRGB + CONST_CAST(GLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_ARB_framebuffer_sRGB */ +#ifdef GL_ARB_geometry_shader4 + CONST_CAST(GLEW_ARB_geometry_shader4) = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + CONST_CAST(GLEW_ARB_get_program_binary) = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); + if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_gpu_shader5 + CONST_CAST(GLEW_ARB_gpu_shader5) = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); +#endif /* GL_ARB_gpu_shader5 */ +#ifdef GL_ARB_gpu_shader_fp64 + CONST_CAST(GLEW_ARB_gpu_shader_fp64) = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_half_float_pixel + CONST_CAST(GLEW_ARB_half_float_pixel) = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); +#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_half_float_vertex + CONST_CAST(GLEW_ARB_half_float_vertex) = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); +#endif /* GL_ARB_half_float_vertex */ +#ifdef GL_ARB_imaging + CONST_CAST(GLEW_ARB_imaging) = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); + if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_instanced_arrays + CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); + if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_internalformat_query2 + CONST_CAST(GLEW_ARB_internalformat_query2) = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query2) CONST_CAST(GLEW_ARB_internalformat_query2) = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query2 */ +#ifdef GL_ARB_invalidate_subdata + CONST_CAST(GLEW_ARB_invalidate_subdata) = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); + if (glewExperimental || GLEW_ARB_invalidate_subdata) CONST_CAST(GLEW_ARB_invalidate_subdata) = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_invalidate_subdata */ +#ifdef GL_ARB_map_buffer_alignment + CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); +#endif /* GL_ARB_map_buffer_alignment */ +#ifdef GL_ARB_map_buffer_range + CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_map_buffer_range */ +#ifdef GL_ARB_matrix_palette + CONST_CAST(GLEW_ARB_matrix_palette) = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); + if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_draw_indirect + CONST_CAST(GLEW_ARB_multi_draw_indirect) = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multi_draw_indirect) CONST_CAST(GLEW_ARB_multi_draw_indirect) = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multi_draw_indirect */ +#ifdef GL_ARB_multisample + CONST_CAST(GLEW_ARB_multisample) = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + CONST_CAST(GLEW_ARB_multitexture) = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + CONST_CAST(GLEW_ARB_occlusion_query) = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_occlusion_query2 + CONST_CAST(GLEW_ARB_occlusion_query2) = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); +#endif /* GL_ARB_occlusion_query2 */ +#ifdef GL_ARB_pixel_buffer_object + CONST_CAST(GLEW_ARB_pixel_buffer_object) = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); +#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_point_parameters + CONST_CAST(GLEW_ARB_point_parameters) = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_point_sprite + CONST_CAST(GLEW_ARB_point_sprite) = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); +#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_program_interface_query + CONST_CAST(GLEW_ARB_program_interface_query) = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_program_interface_query) CONST_CAST(GLEW_ARB_program_interface_query) = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_program_interface_query */ +#ifdef GL_ARB_provoking_vertex + CONST_CAST(GLEW_ARB_provoking_vertex) = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_robust_buffer_access_behavior + CONST_CAST(GLEW_ARB_robust_buffer_access_behavior) = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); +#endif /* GL_ARB_robust_buffer_access_behavior */ +#ifdef GL_ARB_robustness + CONST_CAST(GLEW_ARB_robustness) = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); + if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_robustness_application_isolation + CONST_CAST(GLEW_ARB_robustness_application_isolation) = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_application_isolation */ +#ifdef GL_ARB_robustness_share_group_isolation + CONST_CAST(GLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_share_group_isolation */ +#ifdef GL_ARB_sample_shading + CONST_CAST(GLEW_ARB_sample_shading) = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + CONST_CAST(GLEW_ARB_sampler_objects) = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_seamless_cube_map + CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); +#endif /* GL_ARB_seamless_cube_map */ +#ifdef GL_ARB_separate_shader_objects + CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_atomic_counters */ +#ifdef GL_ARB_shader_bit_encoding + CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); +#endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_image_load_store + CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_image_load_store */ +#ifdef GL_ARB_shader_image_size + CONST_CAST(GLEW_ARB_shader_image_size) = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); +#endif /* GL_ARB_shader_image_size */ +#ifdef GL_ARB_shader_objects + CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shader_precision + CONST_CAST(GLEW_ARB_shader_precision) = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); +#endif /* GL_ARB_shader_precision */ +#ifdef GL_ARB_shader_stencil_export + CONST_CAST(GLEW_ARB_shader_stencil_export) = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); +#endif /* GL_ARB_shader_stencil_export */ +#ifdef GL_ARB_shader_storage_buffer_object + CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_storage_buffer_object */ +#ifdef GL_ARB_shader_subroutine + CONST_CAST(GLEW_ARB_shader_subroutine) = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shader_texture_lod + CONST_CAST(GLEW_ARB_shader_texture_lod) = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); +#endif /* GL_ARB_shader_texture_lod */ +#ifdef GL_ARB_shading_language_100 + CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); +#endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_420pack + CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); +#endif /* GL_ARB_shading_language_420pack */ +#ifdef GL_ARB_shading_language_include + CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shading_language_packing + CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); +#endif /* GL_ARB_shading_language_packing */ +#ifdef GL_ARB_shadow + CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); +#endif /* GL_ARB_shadow */ +#ifdef GL_ARB_shadow_ambient + CONST_CAST(GLEW_ARB_shadow_ambient) = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); +#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_stencil_texturing + CONST_CAST(GLEW_ARB_stencil_texturing) = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); +#endif /* GL_ARB_stencil_texturing */ +#ifdef GL_ARB_sync + CONST_CAST(GLEW_ARB_sync) = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + CONST_CAST(GLEW_ARB_tessellation_shader) = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_border_clamp + CONST_CAST(GLEW_ARB_texture_border_clamp) = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); +#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_texture_buffer_object + CONST_CAST(GLEW_ARB_texture_buffer_object) = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_object_rgb32 + CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); +#endif /* GL_ARB_texture_buffer_object_rgb32 */ +#ifdef GL_ARB_texture_buffer_range + CONST_CAST(GLEW_ARB_texture_buffer_range) = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_range) CONST_CAST(GLEW_ARB_texture_buffer_range) = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_range */ +#ifdef GL_ARB_texture_compression + CONST_CAST(GLEW_ARB_texture_compression) = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_compression_bptc + CONST_CAST(GLEW_ARB_texture_compression_bptc) = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_bptc */ +#ifdef GL_ARB_texture_compression_rgtc + CONST_CAST(GLEW_ARB_texture_compression_rgtc) = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_rgtc */ +#ifdef GL_ARB_texture_cube_map + CONST_CAST(GLEW_ARB_texture_cube_map) = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map */ +#ifdef GL_ARB_texture_cube_map_array + CONST_CAST(GLEW_ARB_texture_cube_map_array) = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map_array */ +#ifdef GL_ARB_texture_env_add + CONST_CAST(GLEW_ARB_texture_env_add) = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); +#endif /* GL_ARB_texture_env_add */ +#ifdef GL_ARB_texture_env_combine + CONST_CAST(GLEW_ARB_texture_env_combine) = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); +#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_env_crossbar + CONST_CAST(GLEW_ARB_texture_env_crossbar) = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); +#endif /* GL_ARB_texture_env_crossbar */ +#ifdef GL_ARB_texture_env_dot3 + CONST_CAST(GLEW_ARB_texture_env_dot3) = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); +#endif /* GL_ARB_texture_env_dot3 */ +#ifdef GL_ARB_texture_float + CONST_CAST(GLEW_ARB_texture_float) = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); +#endif /* GL_ARB_texture_float */ +#ifdef GL_ARB_texture_gather + CONST_CAST(GLEW_ARB_texture_gather) = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); +#endif /* GL_ARB_texture_gather */ +#ifdef GL_ARB_texture_mirrored_repeat + CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_ARB_texture_mirrored_repeat */ +#ifdef GL_ARB_texture_multisample + CONST_CAST(GLEW_ARB_texture_multisample) = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_non_power_of_two + CONST_CAST(GLEW_ARB_texture_non_power_of_two) = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); +#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_query_levels + CONST_CAST(GLEW_ARB_texture_query_levels) = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); +#endif /* GL_ARB_texture_query_levels */ +#ifdef GL_ARB_texture_query_lod + CONST_CAST(GLEW_ARB_texture_query_lod) = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); +#endif /* GL_ARB_texture_query_lod */ +#ifdef GL_ARB_texture_rectangle + CONST_CAST(GLEW_ARB_texture_rectangle) = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); +#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_texture_rg + CONST_CAST(GLEW_ARB_texture_rg) = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); +#endif /* GL_ARB_texture_rg */ +#ifdef GL_ARB_texture_rgb10_a2ui + CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); +#endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_storage + CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage */ +#ifdef GL_ARB_texture_storage_multisample + CONST_CAST(GLEW_ARB_texture_storage_multisample) = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage_multisample) CONST_CAST(GLEW_ARB_texture_storage_multisample) = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage_multisample */ +#ifdef GL_ARB_texture_swizzle + CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); +#endif /* GL_ARB_texture_swizzle */ +#ifdef GL_ARB_texture_view + CONST_CAST(GLEW_ARB_texture_view) = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_view) CONST_CAST(GLEW_ARB_texture_view) = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_view */ +#ifdef GL_ARB_timer_query + CONST_CAST(GLEW_ARB_timer_query) = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + CONST_CAST(GLEW_ARB_transform_feedback2) = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback_instanced */ +#ifdef GL_ARB_transpose_matrix + CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + CONST_CAST(GLEW_ARB_uniform_buffer_object) = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_bgra + CONST_CAST(GLEW_ARB_vertex_array_bgra) = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); +#endif /* GL_ARB_vertex_array_bgra */ +#ifdef GL_ARB_vertex_array_object + CONST_CAST(GLEW_ARB_vertex_array_object) = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_attrib_binding + CONST_CAST(GLEW_ARB_vertex_attrib_binding) = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_binding) CONST_CAST(GLEW_ARB_vertex_attrib_binding) = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_binding */ +#ifdef GL_ARB_vertex_blend + CONST_CAST(GLEW_ARB_vertex_blend) = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + CONST_CAST(GLEW_ARB_vertex_buffer_object) = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + CONST_CAST(GLEW_ARB_vertex_program) = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + CONST_CAST(GLEW_ARB_vertex_shader) = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + CONST_CAST(GLEW_ARB_viewport_array) = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); + if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_viewport_array */ +#ifdef GL_ARB_window_pos + CONST_CAST(GLEW_ARB_window_pos) = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATIX_point_sprites + CONST_CAST(GLEW_ATIX_point_sprites) = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); +#endif /* GL_ATIX_point_sprites */ +#ifdef GL_ATIX_texture_env_combine3 + CONST_CAST(GLEW_ATIX_texture_env_combine3) = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATIX_texture_env_combine3 */ +#ifdef GL_ATIX_texture_env_route + CONST_CAST(GLEW_ATIX_texture_env_route) = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); +#endif /* GL_ATIX_texture_env_route */ +#ifdef GL_ATIX_vertex_shader_output_point_size + CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); +#endif /* GL_ATIX_vertex_shader_output_point_size */ +#ifdef GL_ATI_draw_buffers + CONST_CAST(GLEW_ATI_draw_buffers) = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + CONST_CAST(GLEW_ATI_element_array) = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); + if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + CONST_CAST(GLEW_ATI_envmap_bumpmap) = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + CONST_CAST(GLEW_ATI_fragment_shader) = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); + if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + CONST_CAST(GLEW_ATI_map_object_buffer) = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_meminfo + CONST_CAST(GLEW_ATI_meminfo) = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); +#endif /* GL_ATI_meminfo */ +#ifdef GL_ATI_pn_triangles + CONST_CAST(GLEW_ATI_pn_triangles) = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); + if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + CONST_CAST(GLEW_ATI_separate_stencil) = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); + if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_shader_texture_lod + CONST_CAST(GLEW_ATI_shader_texture_lod) = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); +#endif /* GL_ATI_shader_texture_lod */ +#ifdef GL_ATI_text_fragment_shader + CONST_CAST(GLEW_ATI_text_fragment_shader) = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); +#endif /* GL_ATI_text_fragment_shader */ +#ifdef GL_ATI_texture_compression_3dc + CONST_CAST(GLEW_ATI_texture_compression_3dc) = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); +#endif /* GL_ATI_texture_compression_3dc */ +#ifdef GL_ATI_texture_env_combine3 + CONST_CAST(GLEW_ATI_texture_env_combine3) = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATI_texture_env_combine3 */ +#ifdef GL_ATI_texture_float + CONST_CAST(GLEW_ATI_texture_float) = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); +#endif /* GL_ATI_texture_float */ +#ifdef GL_ATI_texture_mirror_once + CONST_CAST(GLEW_ATI_texture_mirror_once) = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); +#endif /* GL_ATI_texture_mirror_once */ +#ifdef GL_ATI_vertex_array_object + CONST_CAST(GLEW_ATI_vertex_array_object) = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + CONST_CAST(GLEW_ATI_vertex_streams) = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_422_pixels + CONST_CAST(GLEW_EXT_422_pixels) = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); +#endif /* GL_EXT_422_pixels */ +#ifdef GL_EXT_Cg_shader + CONST_CAST(GLEW_EXT_Cg_shader) = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); +#endif /* GL_EXT_Cg_shader */ +#ifdef GL_EXT_abgr + CONST_CAST(GLEW_EXT_abgr) = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); +#endif /* GL_EXT_abgr */ +#ifdef GL_EXT_bgra + CONST_CAST(GLEW_EXT_bgra) = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); +#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_bindable_uniform + CONST_CAST(GLEW_EXT_bindable_uniform) = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_bindable_uniform */ +#ifdef GL_EXT_blend_color + CONST_CAST(GLEW_EXT_blend_color) = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + CONST_CAST(GLEW_EXT_blend_equation_separate) = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_separate + CONST_CAST(GLEW_EXT_blend_func_separate) = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_logic_op + CONST_CAST(GLEW_EXT_blend_logic_op) = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); +#endif /* GL_EXT_blend_logic_op */ +#ifdef GL_EXT_blend_minmax + CONST_CAST(GLEW_EXT_blend_minmax) = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_blend_subtract + CONST_CAST(GLEW_EXT_blend_subtract) = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); +#endif /* GL_EXT_blend_subtract */ +#ifdef GL_EXT_clip_volume_hint + CONST_CAST(GLEW_EXT_clip_volume_hint) = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); +#endif /* GL_EXT_clip_volume_hint */ +#ifdef GL_EXT_cmyka + CONST_CAST(GLEW_EXT_cmyka) = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); +#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_color_subtable + CONST_CAST(GLEW_EXT_color_subtable) = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); + if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + CONST_CAST(GLEW_EXT_compiled_vertex_array) = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + CONST_CAST(GLEW_EXT_convolution) = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); + if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + CONST_CAST(GLEW_EXT_coordinate_frame) = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); + if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_texture + CONST_CAST(GLEW_EXT_copy_texture) = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + CONST_CAST(GLEW_EXT_cull_vertex) = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_marker + CONST_CAST(GLEW_EXT_debug_marker) = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_debug_marker) CONST_CAST(GLEW_EXT_debug_marker) = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_debug_marker */ +#ifdef GL_EXT_depth_bounds_test + CONST_CAST(GLEW_EXT_depth_bounds_test) = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); + if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + CONST_CAST(GLEW_EXT_direct_state_access) = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); + if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_draw_buffers2 + CONST_CAST(GLEW_EXT_draw_buffers2) = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_instanced + CONST_CAST(GLEW_EXT_draw_instanced) = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_instanced */ +#ifdef GL_EXT_draw_range_elements + CONST_CAST(GLEW_EXT_draw_range_elements) = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_fog_coord + CONST_CAST(GLEW_EXT_fog_coord) = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + CONST_CAST(GLEW_EXT_fragment_lighting) = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + CONST_CAST(GLEW_EXT_framebuffer_blit) = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ +#ifdef GL_EXT_framebuffer_object + CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_framebuffer_sRGB + CONST_CAST(GLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_EXT_framebuffer_sRGB */ +#ifdef GL_EXT_geometry_shader4 + CONST_CAST(GLEW_EXT_geometry_shader4) = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_geometry_shader4 */ +#ifdef GL_EXT_gpu_program_parameters + CONST_CAST(GLEW_EXT_gpu_program_parameters) = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_program_parameters */ +#ifdef GL_EXT_gpu_shader4 + CONST_CAST(GLEW_EXT_gpu_shader4) = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_shader4 */ +#ifdef GL_EXT_histogram + CONST_CAST(GLEW_EXT_histogram) = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); + if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_array_formats + CONST_CAST(GLEW_EXT_index_array_formats) = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); +#endif /* GL_EXT_index_array_formats */ +#ifdef GL_EXT_index_func + CONST_CAST(GLEW_EXT_index_func) = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + CONST_CAST(GLEW_EXT_index_material) = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_index_texture + CONST_CAST(GLEW_EXT_index_texture) = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); +#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_light_texture + CONST_CAST(GLEW_EXT_light_texture) = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_misc_attribute + CONST_CAST(GLEW_EXT_misc_attribute) = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); +#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_multi_draw_arrays + CONST_CAST(GLEW_EXT_multi_draw_arrays) = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multisample + CONST_CAST(GLEW_EXT_multisample) = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_packed_depth_stencil + CONST_CAST(GLEW_EXT_packed_depth_stencil) = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); +#endif /* GL_EXT_packed_depth_stencil */ +#ifdef GL_EXT_packed_float + CONST_CAST(GLEW_EXT_packed_float) = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); +#endif /* GL_EXT_packed_float */ +#ifdef GL_EXT_packed_pixels + CONST_CAST(GLEW_EXT_packed_pixels) = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); +#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_paletted_texture + CONST_CAST(GLEW_EXT_paletted_texture) = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_buffer_object + CONST_CAST(GLEW_EXT_pixel_buffer_object) = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); +#endif /* GL_EXT_pixel_buffer_object */ +#ifdef GL_EXT_pixel_transform + CONST_CAST(GLEW_EXT_pixel_transform) = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_pixel_transform_color_table + CONST_CAST(GLEW_EXT_pixel_transform_color_table) = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); +#endif /* GL_EXT_pixel_transform_color_table */ +#ifdef GL_EXT_point_parameters + CONST_CAST(GLEW_EXT_point_parameters) = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + CONST_CAST(GLEW_EXT_polygon_offset) = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); + if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_provoking_vertex + CONST_CAST(GLEW_EXT_provoking_vertex) = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_rescale_normal + CONST_CAST(GLEW_EXT_rescale_normal) = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); +#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_scene_marker + CONST_CAST(GLEW_EXT_scene_marker) = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_separate_shader_objects + CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_separate_specular_color + CONST_CAST(GLEW_EXT_separate_specular_color) = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); +#endif /* GL_EXT_separate_specular_color */ +#ifdef GL_EXT_shader_image_load_store + CONST_CAST(GLEW_EXT_shader_image_load_store) = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shadow_funcs + CONST_CAST(GLEW_EXT_shadow_funcs) = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); +#endif /* GL_EXT_shadow_funcs */ +#ifdef GL_EXT_shared_texture_palette + CONST_CAST(GLEW_EXT_shared_texture_palette) = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); +#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_stencil_clear_tag + CONST_CAST(GLEW_EXT_stencil_clear_tag) = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); +#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_stencil_two_side + CONST_CAST(GLEW_EXT_stencil_two_side) = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); + if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_stencil_wrap + CONST_CAST(GLEW_EXT_stencil_wrap) = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); +#endif /* GL_EXT_stencil_wrap */ +#ifdef GL_EXT_subtexture + CONST_CAST(GLEW_EXT_subtexture) = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture + CONST_CAST(GLEW_EXT_texture) = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); +#endif /* GL_EXT_texture */ +#ifdef GL_EXT_texture3D + CONST_CAST(GLEW_EXT_texture3D) = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_array + CONST_CAST(GLEW_EXT_texture_array) = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_array) CONST_CAST(GLEW_EXT_texture_array) = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_array */ +#ifdef GL_EXT_texture_buffer_object + CONST_CAST(GLEW_EXT_texture_buffer_object) = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_buffer_object */ +#ifdef GL_EXT_texture_compression_dxt1 + CONST_CAST(GLEW_EXT_texture_compression_dxt1) = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); +#endif /* GL_EXT_texture_compression_dxt1 */ +#ifdef GL_EXT_texture_compression_latc + CONST_CAST(GLEW_EXT_texture_compression_latc) = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_latc */ +#ifdef GL_EXT_texture_compression_rgtc + CONST_CAST(GLEW_EXT_texture_compression_rgtc) = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_rgtc */ +#ifdef GL_EXT_texture_compression_s3tc + CONST_CAST(GLEW_EXT_texture_compression_s3tc) = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_s3tc */ +#ifdef GL_EXT_texture_cube_map + CONST_CAST(GLEW_EXT_texture_cube_map) = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); +#endif /* GL_EXT_texture_cube_map */ +#ifdef GL_EXT_texture_edge_clamp + CONST_CAST(GLEW_EXT_texture_edge_clamp) = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_edge_clamp */ +#ifdef GL_EXT_texture_env + CONST_CAST(GLEW_EXT_texture_env) = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); +#endif /* GL_EXT_texture_env */ +#ifdef GL_EXT_texture_env_add + CONST_CAST(GLEW_EXT_texture_env_add) = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); +#endif /* GL_EXT_texture_env_add */ +#ifdef GL_EXT_texture_env_combine + CONST_CAST(GLEW_EXT_texture_env_combine) = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); +#endif /* GL_EXT_texture_env_combine */ +#ifdef GL_EXT_texture_env_dot3 + CONST_CAST(GLEW_EXT_texture_env_dot3) = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); +#endif /* GL_EXT_texture_env_dot3 */ +#ifdef GL_EXT_texture_filter_anisotropic + CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); +#endif /* GL_EXT_texture_filter_anisotropic */ +#ifdef GL_EXT_texture_integer + CONST_CAST(GLEW_EXT_texture_integer) = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_integer */ +#ifdef GL_EXT_texture_lod_bias + CONST_CAST(GLEW_EXT_texture_lod_bias) = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); +#endif /* GL_EXT_texture_lod_bias */ +#ifdef GL_EXT_texture_mirror_clamp + CONST_CAST(GLEW_EXT_texture_mirror_clamp) = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_mirror_clamp */ +#ifdef GL_EXT_texture_object + CONST_CAST(GLEW_EXT_texture_object) = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + CONST_CAST(GLEW_EXT_texture_perturb_normal) = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_rectangle + CONST_CAST(GLEW_EXT_texture_rectangle) = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); +#endif /* GL_EXT_texture_rectangle */ +#ifdef GL_EXT_texture_sRGB + CONST_CAST(GLEW_EXT_texture_sRGB) = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB */ +#ifdef GL_EXT_texture_sRGB_decode + CONST_CAST(GLEW_EXT_texture_sRGB_decode) = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB_decode */ +#ifdef GL_EXT_texture_shared_exponent + CONST_CAST(GLEW_EXT_texture_shared_exponent) = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); +#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_snorm + CONST_CAST(GLEW_EXT_texture_snorm) = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); +#endif /* GL_EXT_texture_snorm */ +#ifdef GL_EXT_texture_swizzle + CONST_CAST(GLEW_EXT_texture_swizzle) = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); +#endif /* GL_EXT_texture_swizzle */ +#ifdef GL_EXT_timer_query + CONST_CAST(GLEW_EXT_timer_query) = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + CONST_CAST(GLEW_EXT_transform_feedback) = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_transform_feedback */ +#ifdef GL_EXT_vertex_array + CONST_CAST(GLEW_EXT_vertex_array) = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_bgra + CONST_CAST(GLEW_EXT_vertex_array_bgra) = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); +#endif /* GL_EXT_vertex_array_bgra */ +#ifdef GL_EXT_vertex_attrib_64bit + CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_attrib_64bit */ +#ifdef GL_EXT_vertex_shader + CONST_CAST(GLEW_EXT_vertex_shader) = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + CONST_CAST(GLEW_EXT_vertex_weighting) = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_x11_sync_object + CONST_CAST(GLEW_EXT_x11_sync_object) = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_x11_sync_object) CONST_CAST(GLEW_EXT_x11_sync_object) = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_x11_sync_object */ +#ifdef GL_GREMEDY_frame_terminator + CONST_CAST(GLEW_GREMEDY_frame_terminator) = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_frame_terminator */ +#ifdef GL_GREMEDY_string_marker + CONST_CAST(GLEW_GREMEDY_string_marker) = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_convolution_border_modes + CONST_CAST(GLEW_HP_convolution_border_modes) = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); +#endif /* GL_HP_convolution_border_modes */ +#ifdef GL_HP_image_transform + CONST_CAST(GLEW_HP_image_transform) = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); + if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_HP_image_transform */ +#ifdef GL_HP_occlusion_test + CONST_CAST(GLEW_HP_occlusion_test) = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); +#endif /* GL_HP_occlusion_test */ +#ifdef GL_HP_texture_lighting + CONST_CAST(GLEW_HP_texture_lighting) = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); +#endif /* GL_HP_texture_lighting */ +#ifdef GL_IBM_cull_vertex + CONST_CAST(GLEW_IBM_cull_vertex) = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); +#endif /* GL_IBM_cull_vertex */ +#ifdef GL_IBM_multimode_draw_arrays + CONST_CAST(GLEW_IBM_multimode_draw_arrays) = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_rasterpos_clip + CONST_CAST(GLEW_IBM_rasterpos_clip) = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); +#endif /* GL_IBM_rasterpos_clip */ +#ifdef GL_IBM_static_data + CONST_CAST(GLEW_IBM_static_data) = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); +#endif /* GL_IBM_static_data */ +#ifdef GL_IBM_texture_mirrored_repeat + CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_IBM_texture_mirrored_repeat */ +#ifdef GL_IBM_vertex_array_lists + CONST_CAST(GLEW_IBM_vertex_array_lists) = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); + if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INGR_color_clamp + CONST_CAST(GLEW_INGR_color_clamp) = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); +#endif /* GL_INGR_color_clamp */ +#ifdef GL_INGR_interlace_read + CONST_CAST(GLEW_INGR_interlace_read) = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); +#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_parallel_arrays + CONST_CAST(GLEW_INTEL_parallel_arrays) = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_texture_scissor + CONST_CAST(GLEW_INTEL_texture_scissor) = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KHR_debug + CONST_CAST(GLEW_KHR_debug) = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); + if (glewExperimental || GLEW_KHR_debug) CONST_CAST(GLEW_KHR_debug) = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KHR_debug */ +#ifdef GL_KHR_texture_compression_astc_ldr + CONST_CAST(GLEW_KHR_texture_compression_astc_ldr) = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); +#endif /* GL_KHR_texture_compression_astc_ldr */ +#ifdef GL_KTX_buffer_region + CONST_CAST(GLEW_KTX_buffer_region) = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); + if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESAX_texture_stack + CONST_CAST(GLEW_MESAX_texture_stack) = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); +#endif /* GL_MESAX_texture_stack */ +#ifdef GL_MESA_pack_invert + CONST_CAST(GLEW_MESA_pack_invert) = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); +#endif /* GL_MESA_pack_invert */ +#ifdef GL_MESA_resize_buffers + CONST_CAST(GLEW_MESA_resize_buffers) = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); + if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + CONST_CAST(GLEW_MESA_window_pos) = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_window_pos */ +#ifdef GL_MESA_ycbcr_texture + CONST_CAST(GLEW_MESA_ycbcr_texture) = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); +#endif /* GL_MESA_ycbcr_texture */ +#ifdef GL_NVX_gpu_memory_info + CONST_CAST(GLEW_NVX_gpu_memory_info) = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); +#endif /* GL_NVX_gpu_memory_info */ +#ifdef GL_NV_bindless_texture + CONST_CAST(GLEW_NV_bindless_texture) = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); + if (glewExperimental || GLEW_NV_bindless_texture) CONST_CAST(GLEW_NV_bindless_texture) = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_bindless_texture */ +#ifdef GL_NV_blend_square + CONST_CAST(GLEW_NV_blend_square) = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); +#endif /* GL_NV_blend_square */ +#ifdef GL_NV_conditional_render + CONST_CAST(GLEW_NV_conditional_render) = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); + if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_copy_depth_to_color + CONST_CAST(GLEW_NV_copy_depth_to_color) = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); +#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NV_copy_image + CONST_CAST(GLEW_NV_copy_image) = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_copy_image */ +#ifdef GL_NV_depth_buffer_float + CONST_CAST(GLEW_NV_depth_buffer_float) = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_depth_buffer_float */ +#ifdef GL_NV_depth_clamp + CONST_CAST(GLEW_NV_depth_clamp) = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); +#endif /* GL_NV_depth_clamp */ +#ifdef GL_NV_depth_range_unclamped + CONST_CAST(GLEW_NV_depth_range_unclamped) = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); +#endif /* GL_NV_depth_range_unclamped */ +#ifdef GL_NV_evaluators + CONST_CAST(GLEW_NV_evaluators) = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + CONST_CAST(GLEW_NV_explicit_multisample) = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_explicit_multisample */ +#ifdef GL_NV_fence + CONST_CAST(GLEW_NV_fence) = _glewSearchExtension("GL_NV_fence", extStart, extEnd); + if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fence */ +#ifdef GL_NV_float_buffer + CONST_CAST(GLEW_NV_float_buffer) = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); +#endif /* GL_NV_float_buffer */ +#ifdef GL_NV_fog_distance + CONST_CAST(GLEW_NV_fog_distance) = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); +#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_program + CONST_CAST(GLEW_NV_fragment_program) = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_fragment_program2 + CONST_CAST(GLEW_NV_fragment_program2) = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); +#endif /* GL_NV_fragment_program2 */ +#ifdef GL_NV_fragment_program4 + CONST_CAST(GLEW_NV_fragment_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_fragment_program_option + CONST_CAST(GLEW_NV_fragment_program_option) = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); +#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_multisample_coverage + CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_framebuffer_multisample_coverage */ +#ifdef GL_NV_geometry_program4 + CONST_CAST(GLEW_NV_geometry_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_geometry_shader4 + CONST_CAST(GLEW_NV_geometry_shader4) = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); +#endif /* GL_NV_geometry_shader4 */ +#ifdef GL_NV_gpu_program4 + CONST_CAST(GLEW_NV_gpu_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_program5 + CONST_CAST(GLEW_NV_gpu_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_gpu_program5 */ +#ifdef GL_NV_gpu_program_fp64 + CONST_CAST(GLEW_NV_gpu_program_fp64) = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); +#endif /* GL_NV_gpu_program_fp64 */ +#ifdef GL_NV_gpu_shader5 + CONST_CAST(GLEW_NV_gpu_shader5) = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_shader5 */ +#ifdef GL_NV_half_float + CONST_CAST(GLEW_NV_half_float) = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_light_max_exponent + CONST_CAST(GLEW_NV_light_max_exponent) = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); +#endif /* GL_NV_light_max_exponent */ +#ifdef GL_NV_multisample_coverage + CONST_CAST(GLEW_NV_multisample_coverage) = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); +#endif /* GL_NV_multisample_coverage */ +#ifdef GL_NV_multisample_filter_hint + CONST_CAST(GLEW_NV_multisample_filter_hint) = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); +#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_occlusion_query + CONST_CAST(GLEW_NV_occlusion_query) = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_packed_depth_stencil + CONST_CAST(GLEW_NV_packed_depth_stencil) = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); +#endif /* GL_NV_packed_depth_stencil */ +#ifdef GL_NV_parameter_buffer_object + CONST_CAST(GLEW_NV_parameter_buffer_object) = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_parameter_buffer_object2 + CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); +#endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_path_rendering + CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); + if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_path_rendering */ +#ifdef GL_NV_pixel_data_range + CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + CONST_CAST(GLEW_NV_point_sprite) = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); + if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_present_video + CONST_CAST(GLEW_NV_present_video) = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); + if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_present_video */ +#ifdef GL_NV_primitive_restart + CONST_CAST(GLEW_NV_primitive_restart) = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); + if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + CONST_CAST(GLEW_NV_register_combiners) = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + CONST_CAST(GLEW_NV_register_combiners2) = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_shader_atomic_float + CONST_CAST(GLEW_NV_shader_atomic_float) = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); +#endif /* GL_NV_shader_atomic_float */ +#ifdef GL_NV_shader_buffer_load + CONST_CAST(GLEW_NV_shader_buffer_load) = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); + if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_tessellation_program5 + CONST_CAST(GLEW_NV_tessellation_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_texgen_emboss + CONST_CAST(GLEW_NV_texgen_emboss) = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); +#endif /* GL_NV_texgen_emboss */ +#ifdef GL_NV_texgen_reflection + CONST_CAST(GLEW_NV_texgen_reflection) = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); +#endif /* GL_NV_texgen_reflection */ +#ifdef GL_NV_texture_barrier + CONST_CAST(GLEW_NV_texture_barrier) = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_compression_vtc + CONST_CAST(GLEW_NV_texture_compression_vtc) = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); +#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_texture_env_combine4 + CONST_CAST(GLEW_NV_texture_env_combine4) = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); +#endif /* GL_NV_texture_env_combine4 */ +#ifdef GL_NV_texture_expand_normal + CONST_CAST(GLEW_NV_texture_expand_normal) = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); +#endif /* GL_NV_texture_expand_normal */ +#ifdef GL_NV_texture_multisample + CONST_CAST(GLEW_NV_texture_multisample) = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_multisample) CONST_CAST(GLEW_NV_texture_multisample) = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_multisample */ +#ifdef GL_NV_texture_rectangle + CONST_CAST(GLEW_NV_texture_rectangle) = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); +#endif /* GL_NV_texture_rectangle */ +#ifdef GL_NV_texture_shader + CONST_CAST(GLEW_NV_texture_shader) = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); +#endif /* GL_NV_texture_shader */ +#ifdef GL_NV_texture_shader2 + CONST_CAST(GLEW_NV_texture_shader2) = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); +#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_shader3 + CONST_CAST(GLEW_NV_texture_shader3) = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); +#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_transform_feedback + CONST_CAST(GLEW_NV_transform_feedback) = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + CONST_CAST(GLEW_NV_transform_feedback2) = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + CONST_CAST(GLEW_NV_vdpau_interop) = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); + if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vdpau_interop */ +#ifdef GL_NV_vertex_array_range + CONST_CAST(GLEW_NV_vertex_array_range) = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_array_range2 + CONST_CAST(GLEW_NV_vertex_array_range2) = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); +#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_attrib_integer_64bit + CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_buffer_unified_memory */ +#ifdef GL_NV_vertex_program + CONST_CAST(GLEW_NV_vertex_program) = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_vertex_program1_1 + CONST_CAST(GLEW_NV_vertex_program1_1) = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); +#endif /* GL_NV_vertex_program1_1 */ +#ifdef GL_NV_vertex_program2 + CONST_CAST(GLEW_NV_vertex_program2) = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); +#endif /* GL_NV_vertex_program2 */ +#ifdef GL_NV_vertex_program2_option + CONST_CAST(GLEW_NV_vertex_program2_option) = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); +#endif /* GL_NV_vertex_program2_option */ +#ifdef GL_NV_vertex_program3 + CONST_CAST(GLEW_NV_vertex_program3) = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); +#endif /* GL_NV_vertex_program3 */ +#ifdef GL_NV_vertex_program4 + CONST_CAST(GLEW_NV_vertex_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_vertex_program4 */ +#ifdef GL_NV_video_capture + CONST_CAST(GLEW_NV_video_capture) = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLEW_NV_video_capture) CONST_CAST(GLEW_NV_video_capture) = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_video_capture */ +#ifdef GL_OES_byte_coordinates + CONST_CAST(GLEW_OES_byte_coordinates) = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); +#endif /* GL_OES_byte_coordinates */ +#ifdef GL_OES_compressed_paletted_texture + CONST_CAST(GLEW_OES_compressed_paletted_texture) = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); +#endif /* GL_OES_compressed_paletted_texture */ +#ifdef GL_OES_read_format + CONST_CAST(GLEW_OES_read_format) = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); +#endif /* GL_OES_read_format */ +#ifdef GL_OES_single_precision + CONST_CAST(GLEW_OES_single_precision) = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); + if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_OES_single_precision */ +#ifdef GL_OML_interlace + CONST_CAST(GLEW_OML_interlace) = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); +#endif /* GL_OML_interlace */ +#ifdef GL_OML_resample + CONST_CAST(GLEW_OML_resample) = _glewSearchExtension("GL_OML_resample", extStart, extEnd); +#endif /* GL_OML_resample */ +#ifdef GL_OML_subsample + CONST_CAST(GLEW_OML_subsample) = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); +#endif /* GL_OML_subsample */ +#ifdef GL_PGI_misc_hints + CONST_CAST(GLEW_PGI_misc_hints) = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); +#endif /* GL_PGI_misc_hints */ +#ifdef GL_PGI_vertex_hints + CONST_CAST(GLEW_PGI_vertex_hints) = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); +#endif /* GL_PGI_vertex_hints */ +#ifdef GL_REGAL_error_string + CONST_CAST(GLEW_REGAL_error_string) = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_error_string) CONST_CAST(GLEW_REGAL_error_string) = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_error_string */ +#ifdef GL_REGAL_extension_query + CONST_CAST(GLEW_REGAL_extension_query) = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_extension_query) CONST_CAST(GLEW_REGAL_extension_query) = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_extension_query */ +#ifdef GL_REGAL_log + CONST_CAST(GLEW_REGAL_log) = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); +#endif /* GL_REGAL_log */ +#ifdef GL_REND_screen_coordinates + CONST_CAST(GLEW_REND_screen_coordinates) = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); +#endif /* GL_REND_screen_coordinates */ +#ifdef GL_S3_s3tc + CONST_CAST(GLEW_S3_s3tc) = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); +#endif /* GL_S3_s3tc */ +#ifdef GL_SGIS_color_range + CONST_CAST(GLEW_SGIS_color_range) = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); +#endif /* GL_SGIS_color_range */ +#ifdef GL_SGIS_detail_texture + CONST_CAST(GLEW_SGIS_detail_texture) = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + CONST_CAST(GLEW_SGIS_fog_function) = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_generate_mipmap + CONST_CAST(GLEW_SGIS_generate_mipmap) = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); +#endif /* GL_SGIS_generate_mipmap */ +#ifdef GL_SGIS_multisample + CONST_CAST(GLEW_SGIS_multisample) = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_pixel_texture + CONST_CAST(GLEW_SGIS_pixel_texture) = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); +#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_point_line_texgen + CONST_CAST(GLEW_SGIS_point_line_texgen) = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); +#endif /* GL_SGIS_point_line_texgen */ +#ifdef GL_SGIS_sharpen_texture + CONST_CAST(GLEW_SGIS_sharpen_texture) = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + CONST_CAST(GLEW_SGIS_texture4D) = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_border_clamp + CONST_CAST(GLEW_SGIS_texture_border_clamp) = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_border_clamp */ +#ifdef GL_SGIS_texture_edge_clamp + CONST_CAST(GLEW_SGIS_texture_edge_clamp) = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_edge_clamp */ +#ifdef GL_SGIS_texture_filter4 + CONST_CAST(GLEW_SGIS_texture_filter4) = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIS_texture_lod + CONST_CAST(GLEW_SGIS_texture_lod) = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); +#endif /* GL_SGIS_texture_lod */ +#ifdef GL_SGIS_texture_select + CONST_CAST(GLEW_SGIS_texture_select) = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); +#endif /* GL_SGIS_texture_select */ +#ifdef GL_SGIX_async + CONST_CAST(GLEW_SGIX_async) = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_async_histogram + CONST_CAST(GLEW_SGIX_async_histogram) = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); +#endif /* GL_SGIX_async_histogram */ +#ifdef GL_SGIX_async_pixel + CONST_CAST(GLEW_SGIX_async_pixel) = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); +#endif /* GL_SGIX_async_pixel */ +#ifdef GL_SGIX_blend_alpha_minmax + CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); +#endif /* GL_SGIX_blend_alpha_minmax */ +#ifdef GL_SGIX_clipmap + CONST_CAST(GLEW_SGIX_clipmap) = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); +#endif /* GL_SGIX_clipmap */ +#ifdef GL_SGIX_convolution_accuracy + CONST_CAST(GLEW_SGIX_convolution_accuracy) = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); +#endif /* GL_SGIX_convolution_accuracy */ +#ifdef GL_SGIX_depth_texture + CONST_CAST(GLEW_SGIX_depth_texture) = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); +#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_flush_raster + CONST_CAST(GLEW_SGIX_flush_raster) = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_offset + CONST_CAST(GLEW_SGIX_fog_offset) = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); +#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_texture + CONST_CAST(GLEW_SGIX_fog_texture) = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + CONST_CAST(GLEW_SGIX_framezoom) = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_interlace + CONST_CAST(GLEW_SGIX_interlace) = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); +#endif /* GL_SGIX_interlace */ +#ifdef GL_SGIX_ir_instrument1 + CONST_CAST(GLEW_SGIX_ir_instrument1) = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); +#endif /* GL_SGIX_ir_instrument1 */ +#ifdef GL_SGIX_list_priority + CONST_CAST(GLEW_SGIX_list_priority) = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); +#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_pixel_texture + CONST_CAST(GLEW_SGIX_pixel_texture) = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_pixel_texture_bits + CONST_CAST(GLEW_SGIX_pixel_texture_bits) = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); +#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_reference_plane + CONST_CAST(GLEW_SGIX_reference_plane) = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_resample + CONST_CAST(GLEW_SGIX_resample) = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); +#endif /* GL_SGIX_resample */ +#ifdef GL_SGIX_shadow + CONST_CAST(GLEW_SGIX_shadow) = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); +#endif /* GL_SGIX_shadow */ +#ifdef GL_SGIX_shadow_ambient + CONST_CAST(GLEW_SGIX_shadow_ambient) = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); +#endif /* GL_SGIX_shadow_ambient */ +#ifdef GL_SGIX_sprite + CONST_CAST(GLEW_SGIX_sprite) = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + CONST_CAST(GLEW_SGIX_tag_sample_buffer) = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_texture_add_env + CONST_CAST(GLEW_SGIX_texture_add_env) = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); +#endif /* GL_SGIX_texture_add_env */ +#ifdef GL_SGIX_texture_coordinate_clamp + CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); +#endif /* GL_SGIX_texture_coordinate_clamp */ +#ifdef GL_SGIX_texture_lod_bias + CONST_CAST(GLEW_SGIX_texture_lod_bias) = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_texture_multi_buffer + CONST_CAST(GLEW_SGIX_texture_multi_buffer) = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); +#endif /* GL_SGIX_texture_multi_buffer */ +#ifdef GL_SGIX_texture_range + CONST_CAST(GLEW_SGIX_texture_range) = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); +#endif /* GL_SGIX_texture_range */ +#ifdef GL_SGIX_texture_scale_bias + CONST_CAST(GLEW_SGIX_texture_scale_bias) = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_scale_bias */ +#ifdef GL_SGIX_vertex_preclip + CONST_CAST(GLEW_SGIX_vertex_preclip) = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip */ +#ifdef GL_SGIX_vertex_preclip_hint + CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip_hint */ +#ifdef GL_SGIX_ycrcb + CONST_CAST(GLEW_SGIX_ycrcb) = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); +#endif /* GL_SGIX_ycrcb */ +#ifdef GL_SGI_color_matrix + CONST_CAST(GLEW_SGI_color_matrix) = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); +#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGI_color_table + CONST_CAST(GLEW_SGI_color_table) = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); + if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_texture_color_table + CONST_CAST(GLEW_SGI_texture_color_table) = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); +#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SUNX_constant_data + CONST_CAST(GLEW_SUNX_constant_data) = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); + if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_convolution_border_modes + CONST_CAST(GLEW_SUN_convolution_border_modes) = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); +#endif /* GL_SUN_convolution_border_modes */ +#ifdef GL_SUN_global_alpha + CONST_CAST(GLEW_SUN_global_alpha) = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); + if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_mesh_array + CONST_CAST(GLEW_SUN_mesh_array) = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); +#endif /* GL_SUN_mesh_array */ +#ifdef GL_SUN_read_video_pixels + CONST_CAST(GLEW_SUN_read_video_pixels) = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); + if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_slice_accum + CONST_CAST(GLEW_SUN_slice_accum) = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); +#endif /* GL_SUN_slice_accum */ +#ifdef GL_SUN_triangle_list + CONST_CAST(GLEW_SUN_triangle_list) = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); + if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + CONST_CAST(GLEW_SUN_vertex) = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); + if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_phong_shading + CONST_CAST(GLEW_WIN_phong_shading) = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); +#endif /* GL_WIN_phong_shading */ +#ifdef GL_WIN_specular_fog + CONST_CAST(GLEW_WIN_specular_fog) = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); +#endif /* GL_WIN_specular_fog */ +#ifdef GL_WIN_swap_hint + CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); + if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_WIN_swap_hint */ + + return GLEW_OK; +} + + +#if defined(_WIN32) + +#if !defined(GLEW_MX) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; +PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; +PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; +PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; +PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; +PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; +PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; +PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; +PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; +PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; +PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; +PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; + +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; +PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; +PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; +PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; +PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_capture = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef WGL_3DFX_multisample + +#endif /* WGL_3DFX_multisample */ + +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + +#ifdef WGL_ARB_create_context_profile + +#endif /* WGL_ARB_create_context_profile */ + +#ifdef WGL_ARB_create_context_robustness + +#endif /* WGL_ARB_create_context_robustness */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_framebuffer_sRGB + +#endif /* WGL_ARB_framebuffer_sRGB */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_multisample + +#endif /* WGL_ARB_multisample */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_pixel_format_float + +#endif /* WGL_ARB_pixel_format_float */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_ATI_pixel_format_float + +#endif /* WGL_ATI_pixel_format_float */ + +#ifdef WGL_ATI_render_texture_rectangle + +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifdef WGL_EXT_create_context_es2_profile + +#endif /* WGL_EXT_create_context_es2_profile */ + +#ifdef WGL_EXT_create_context_es_profile + +#endif /* WGL_EXT_create_context_es_profile */ + +#ifdef WGL_EXT_depth_float + +#endif /* WGL_EXT_depth_float */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_framebuffer_sRGB + +#endif /* WGL_EXT_framebuffer_sRGB */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_multisample + +#endif /* WGL_EXT_multisample */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_pixel_format_packed_float + +#endif /* WGL_EXT_pixel_format_packed_float */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_EXT_swap_control_tear + +#endif /* WGL_EXT_swap_control_tear */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_DX_interop + +static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; + r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; + r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; + r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; + r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; + r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; + r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; + r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_DX_interop */ + +#ifdef WGL_NV_DX_interop2 + +#endif /* WGL_NV_DX_interop2 */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_float_buffer + +#endif /* WGL_NV_float_buffer */ + +#ifdef WGL_NV_gpu_affinity + +static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; + r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; + r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; + r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; + r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_gpu_affinity */ + +#ifdef WGL_NV_multisample_coverage + +#endif /* WGL_NV_multisample_coverage */ + +#ifdef WGL_NV_present_video + +static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_render_depth_texture + +#endif /* WGL_NV_render_depth_texture */ + +#ifdef WGL_NV_render_texture_rectangle + +#endif /* WGL_NV_render_texture_rectangle */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_NV_video_capture + +static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_capture */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + CONST_CAST(WGLEW_3DFX_multisample) = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + CONST_CAST(WGLEW_3DL_stereo_control) = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + CONST_CAST(WGLEW_AMD_gpu_association) = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_AMD_gpu_association */ +#ifdef WGL_ARB_buffer_region + CONST_CAST(WGLEW_ARB_buffer_region) = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_create_context + CONST_CAST(WGLEW_ARB_create_context) = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_profile + CONST_CAST(WGLEW_ARB_create_context_profile) = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + CONST_CAST(WGLEW_ARB_create_context_robustness) = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); +#endif /* WGL_ARB_create_context_robustness */ +#ifdef WGL_ARB_extensions_string + CONST_CAST(WGLEW_ARB_extensions_string) = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_ARB_framebuffer_sRGB */ +#ifdef WGL_ARB_make_current_read + CONST_CAST(WGLEW_ARB_make_current_read) = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + CONST_CAST(WGLEW_ARB_multisample) = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + CONST_CAST(WGLEW_ARB_pbuffer) = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + CONST_CAST(WGLEW_ARB_pixel_format) = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + CONST_CAST(WGLEW_ARB_pixel_format_float) = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + CONST_CAST(WGLEW_ARB_render_texture) = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ATI_pixel_format_float + CONST_CAST(WGLEW_ATI_pixel_format_float) = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + CONST_CAST(WGLEW_ATI_render_texture_rectangle) = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_create_context_es2_profile + CONST_CAST(WGLEW_EXT_create_context_es2_profile) = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_create_context_es_profile + CONST_CAST(WGLEW_EXT_create_context_es_profile) = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es_profile */ +#ifdef WGL_EXT_depth_float + CONST_CAST(WGLEW_EXT_depth_float) = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + CONST_CAST(WGLEW_EXT_display_color_table) = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + CONST_CAST(WGLEW_EXT_extensions_string) = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_framebuffer_sRGB + CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_EXT_framebuffer_sRGB */ +#ifdef WGL_EXT_make_current_read + CONST_CAST(WGLEW_EXT_make_current_read) = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + CONST_CAST(WGLEW_EXT_multisample) = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + CONST_CAST(WGLEW_EXT_pbuffer) = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + CONST_CAST(WGLEW_EXT_pixel_format) = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_pixel_format_packed_float + CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); +#endif /* WGL_EXT_pixel_format_packed_float */ +#ifdef WGL_EXT_swap_control + CONST_CAST(WGLEW_EXT_swap_control) = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_EXT_swap_control_tear + CONST_CAST(WGLEW_EXT_swap_control_tear) = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); +#endif /* WGL_EXT_swap_control_tear */ +#ifdef WGL_I3D_digital_video_control + CONST_CAST(WGLEW_I3D_digital_video_control) = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + CONST_CAST(WGLEW_I3D_gamma) = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + CONST_CAST(WGLEW_I3D_genlock) = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + CONST_CAST(WGLEW_I3D_image_buffer) = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + CONST_CAST(WGLEW_I3D_swap_frame_lock) = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + CONST_CAST(WGLEW_I3D_swap_frame_usage) = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_DX_interop + CONST_CAST(WGLEW_NV_DX_interop) = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); + if (glewExperimental || WGLEW_NV_DX_interop|| crippled) CONST_CAST(WGLEW_NV_DX_interop)= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_DX_interop */ +#ifdef WGL_NV_DX_interop2 + CONST_CAST(WGLEW_NV_DX_interop2) = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); +#endif /* WGL_NV_DX_interop2 */ +#ifdef WGL_NV_copy_image + CONST_CAST(WGLEW_NV_copy_image) = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_float_buffer + CONST_CAST(WGLEW_NV_float_buffer) = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_gpu_affinity + CONST_CAST(WGLEW_NV_gpu_affinity) = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + CONST_CAST(WGLEW_NV_multisample_coverage) = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + CONST_CAST(WGLEW_NV_present_video) = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); + if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_present_video */ +#ifdef WGL_NV_render_depth_texture + CONST_CAST(WGLEW_NV_render_depth_texture) = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + CONST_CAST(WGLEW_NV_render_texture_rectangle) = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + CONST_CAST(WGLEW_NV_swap_group) = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_swap_group */ +#ifdef WGL_NV_vertex_array_range + CONST_CAST(WGLEW_NV_vertex_array_range) = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + CONST_CAST(WGLEW_NV_video_capture) = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_capture|| crippled) CONST_CAST(WGLEW_NV_video_capture)= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_capture */ +#ifdef WGL_NV_video_output + CONST_CAST(WGLEW_NV_video_output) = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_output */ +#ifdef WGL_OML_sync_control + CONST_CAST(WGLEW_OML_sync_control) = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + +PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; +PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; +PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; +PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; +PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; +PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; +PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; +PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_capture = GL_FALSE; +GLboolean __GLXEW_NV_video_out = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_VERSION_1_4 + +#endif /* GLX_VERSION_1_4 */ + +#ifdef GLX_3DFX_multisample + +#endif /* GLX_3DFX_multisample */ + +#ifdef GLX_AMD_gpu_association + +#endif /* GLX_AMD_gpu_association */ + +#ifdef GLX_ARB_create_context + +static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* GLX_ARB_create_context */ + +#ifdef GLX_ARB_create_context_profile + +#endif /* GLX_ARB_create_context_profile */ + +#ifdef GLX_ARB_create_context_robustness + +#endif /* GLX_ARB_create_context_robustness */ + +#ifdef GLX_ARB_fbconfig_float + +#endif /* GLX_ARB_fbconfig_float */ + +#ifdef GLX_ARB_framebuffer_sRGB + +#endif /* GLX_ARB_framebuffer_sRGB */ + +#ifdef GLX_ARB_get_proc_address + +#endif /* GLX_ARB_get_proc_address */ + +#ifdef GLX_ARB_multisample + +#endif /* GLX_ARB_multisample */ + +#ifdef GLX_ARB_robustness_application_isolation + +#endif /* GLX_ARB_robustness_application_isolation */ + +#ifdef GLX_ARB_robustness_share_group_isolation + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +#ifdef GLX_ARB_vertex_buffer_object + +#endif /* GLX_ARB_vertex_buffer_object */ + +#ifdef GLX_ATI_pixel_format_float + +#endif /* GLX_ATI_pixel_format_float */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_create_context_es2_profile + +#endif /* GLX_EXT_create_context_es2_profile */ + +#ifdef GLX_EXT_create_context_es_profile + +#endif /* GLX_EXT_create_context_es_profile */ + +#ifdef GLX_EXT_fbconfig_packed_float + +#endif /* GLX_EXT_fbconfig_packed_float */ + +#ifdef GLX_EXT_framebuffer_sRGB + +#endif /* GLX_EXT_framebuffer_sRGB */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_scene_marker + +#endif /* GLX_EXT_scene_marker */ + +#ifdef GLX_EXT_swap_control + +static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ + +#ifdef GLX_EXT_swap_control_tear + +#endif /* GLX_EXT_swap_control_tear */ + +#ifdef GLX_EXT_texture_from_pixmap + +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; + r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_texture_from_pixmap */ + +#ifdef GLX_EXT_visual_info + +#endif /* GLX_EXT_visual_info */ + +#ifdef GLX_EXT_visual_rating + +#endif /* GLX_EXT_visual_rating */ + +#ifdef GLX_INTEL_swap_event + +#endif /* GLX_INTEL_swap_event */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_MESA_swap_control + +static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_float_buffer + +#endif /* GLX_NV_float_buffer */ + +#ifdef GLX_NV_multisample_coverage + +#endif /* GLX_NV_multisample_coverage */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_NV_video_capture + +static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_capture */ + +#ifdef GLX_NV_video_out + +static GLboolean _glewInit_GLX_NV_video_out (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_out */ + +#ifdef GLX_OML_swap_method + +#endif /* GLX_OML_swap_method */ + +#ifdef GLX_OML_sync_control + +static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIS_blended_overlay + +#endif /* GLX_SGIS_blended_overlay */ + +#ifdef GLX_SGIS_color_range + +#endif /* GLX_SGIS_color_range */ + +#ifdef GLX_SGIS_multisample + +#endif /* GLX_SGIS_multisample */ + +#ifdef GLX_SGIS_shared_multisample + +#endif /* GLX_SGIS_shared_multisample */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_hyperpipe + +static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; + r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_hyperpipe */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGIX_visual_select_group + +#endif /* GLX_SGIX_visual_select_group */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + break; + case 2: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + CONST_CAST(GLXEW_3DFX_multisample) = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + CONST_CAST(GLXEW_AMD_gpu_association) = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_create_context + CONST_CAST(GLXEW_ARB_create_context) = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); + if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_profile + CONST_CAST(GLXEW_ARB_create_context_profile) = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + CONST_CAST(GLXEW_ARB_create_context_robustness) = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); +#endif /* GLX_ARB_create_context_robustness */ +#ifdef GLX_ARB_fbconfig_float + CONST_CAST(GLXEW_ARB_fbconfig_float) = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_ARB_framebuffer_sRGB */ +#ifdef GLX_ARB_get_proc_address + CONST_CAST(GLXEW_ARB_get_proc_address) = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + CONST_CAST(GLXEW_ARB_multisample) = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_robustness_application_isolation + CONST_CAST(GLXEW_ARB_robustness_application_isolation) = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_application_isolation */ +#ifdef GLX_ARB_robustness_share_group_isolation + CONST_CAST(GLXEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_share_group_isolation */ +#ifdef GLX_ARB_vertex_buffer_object + CONST_CAST(GLXEW_ARB_vertex_buffer_object) = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); +#endif /* GLX_ARB_vertex_buffer_object */ +#ifdef GLX_ATI_pixel_format_float + CONST_CAST(GLXEW_ATI_pixel_format_float) = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + CONST_CAST(GLXEW_ATI_render_texture) = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); + if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_create_context_es2_profile + CONST_CAST(GLXEW_EXT_create_context_es2_profile) = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_create_context_es_profile + CONST_CAST(GLXEW_EXT_create_context_es_profile) = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es_profile */ +#ifdef GLX_EXT_fbconfig_packed_float + CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); +#endif /* GLX_EXT_fbconfig_packed_float */ +#ifdef GLX_EXT_framebuffer_sRGB + CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_EXT_framebuffer_sRGB */ +#ifdef GLX_EXT_import_context + CONST_CAST(GLXEW_EXT_import_context) = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_scene_marker + CONST_CAST(GLXEW_EXT_scene_marker) = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_swap_control + CONST_CAST(GLXEW_EXT_swap_control) = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_swap_control_tear + CONST_CAST(GLXEW_EXT_swap_control_tear) = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); +#endif /* GLX_EXT_swap_control_tear */ +#ifdef GLX_EXT_texture_from_pixmap + CONST_CAST(GLXEW_EXT_texture_from_pixmap) = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_texture_from_pixmap */ +#ifdef GLX_EXT_visual_info + CONST_CAST(GLXEW_EXT_visual_info) = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + CONST_CAST(GLXEW_EXT_visual_rating) = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + CONST_CAST(GLXEW_INTEL_swap_event) = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); +#endif /* GLX_INTEL_swap_event */ +#ifdef GLX_MESA_agp_offset + CONST_CAST(GLXEW_MESA_agp_offset) = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + CONST_CAST(GLXEW_MESA_copy_sub_buffer) = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + CONST_CAST(GLXEW_MESA_pixmap_colormap) = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_release_buffers + CONST_CAST(GLXEW_MESA_release_buffers) = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_swap_control */ +#ifdef GLX_NV_copy_image + CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_float_buffer + CONST_CAST(GLXEW_NV_float_buffer) = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + CONST_CAST(GLXEW_NV_multisample_coverage) = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + CONST_CAST(GLXEW_NV_present_video) = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); + if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_swap_group + CONST_CAST(GLXEW_NV_swap_group) = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_swap_group */ +#ifdef GLX_NV_vertex_array_range + CONST_CAST(GLXEW_NV_vertex_array_range) = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_capture + CONST_CAST(GLXEW_NV_video_capture) = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_capture) CONST_CAST(GLXEW_NV_video_capture) = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_capture */ +#ifdef GLX_NV_video_out + CONST_CAST(GLXEW_NV_video_out) = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_out) CONST_CAST(GLXEW_NV_video_out) = !_glewInit_GLX_NV_video_out(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_out */ +#ifdef GLX_OML_swap_method + CONST_CAST(GLXEW_OML_swap_method) = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); +#endif /* GLX_OML_swap_method */ +#ifdef GLX_OML_sync_control + CONST_CAST(GLXEW_OML_sync_control) = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); + if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + CONST_CAST(GLXEW_SGIS_blended_overlay) = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + CONST_CAST(GLXEW_SGIS_color_range) = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + CONST_CAST(GLXEW_SGIS_multisample) = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + CONST_CAST(GLXEW_SGIS_shared_multisample) = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + CONST_CAST(GLXEW_SGIX_fbconfig) = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_hyperpipe + CONST_CAST(GLXEW_SGIX_hyperpipe) = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_hyperpipe */ +#ifdef GLX_SGIX_pbuffer + CONST_CAST(GLXEW_SGIX_pbuffer) = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + CONST_CAST(GLXEW_SGIX_swap_barrier) = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + CONST_CAST(GLXEW_SGIX_swap_group) = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + CONST_CAST(GLXEW_SGIX_video_resize) = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + CONST_CAST(GLXEW_SGIX_visual_select_group) = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + CONST_CAST(GLXEW_SGI_cushion) = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + CONST_CAST(GLXEW_SGI_make_current_read) = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + CONST_CAST(GLXEW_SGI_swap_control) = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + CONST_CAST(GLXEW_SGI_video_sync) = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + CONST_CAST(GLXEW_SUN_get_transparent_index) = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + CONST_CAST(GLXEW_SUN_video_resize) = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"1.9.0", + (const GLubyte*)"1", + (const GLubyte*)"9", + (const GLubyte*)"0" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum GLEWAPIENTRY wglewContextInit (void); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +extern GLenum GLEWAPIENTRY glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ +#ifdef GLEW_MX +GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif +#ifdef GL_VERSION_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) + { + ret = GLEW_VERSION_2_1; + continue; + } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif +#ifdef GL_VERSION_4_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) + { + ret = GLEW_VERSION_4_3; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_AMD_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_pinned_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) + { + ret = GLEW_AMD_pinned_memory; + continue; + } +#endif +#ifdef GL_AMD_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_AMD_query_buffer_object; + continue; + } +#endif +#ifdef GL_AMD_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) + { + ret = GLEW_AMD_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_stencil_operation_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) + { + ret = GLEW_AMD_stencil_operation_extended; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_layer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) + { + ret = GLEW_AMD_vertex_shader_layer; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) + { + ret = GLEW_AMD_vertex_shader_viewport_index; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_flush_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) + { + ret = GLEW_APPLE_flush_buffer_range; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) + { + ret = GLEW_ARB_ES3_compatibility; + continue; + } +#endif +#ifdef GL_ARB_arrays_of_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) + { + ret = GLEW_ARB_arrays_of_arrays; + continue; + } +#endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_clear_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) + { + ret = GLEW_ARB_clear_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_compute_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) + { + ret = GLEW_ARB_compute_shader; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_ARB_copy_image; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_explicit_uniform_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) + { + ret = GLEW_ARB_explicit_uniform_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_layer_viewport + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) + { + ret = GLEW_ARB_fragment_layer_viewport; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_no_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) + { + ret = GLEW_ARB_framebuffer_no_attachments; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) + { + ret = GLEW_ARB_internalformat_query2; + continue; + } +#endif +#ifdef GL_ARB_invalidate_subdata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) + { + ret = GLEW_ARB_invalidate_subdata; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_ARB_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_program_interface_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) + { + ret = GLEW_ARB_program_interface_query; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_ARB_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif +#ifdef GL_ARB_shader_image_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) + { + ret = GLEW_ARB_shader_image_size; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_ARB_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_stencil_texturing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) + { + ret = GLEW_ARB_stencil_texturing; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) + { + ret = GLEW_ARB_texture_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_query_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) + { + ret = GLEW_ARB_texture_query_levels; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif +#ifdef GL_ARB_texture_storage_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) + { + ret = GLEW_ARB_texture_storage_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_ARB_texture_view; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_binding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) + { + ret = GLEW_ARB_vertex_attrib_binding; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ATI_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_bindable_uniform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) + { + ret = GLEW_EXT_bindable_uniform; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_debug_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) + { + ret = GLEW_EXT_debug_marker; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) + { + ret = GLEW_EXT_draw_buffers2; + continue; + } +#endif +#ifdef GL_EXT_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_EXT_draw_instanced; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_EXT_geometry_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_program_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) + { + ret = GLEW_EXT_gpu_program_parameters; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) + { + ret = GLEW_EXT_gpu_shader4; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_EXT_packed_float; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_EXT_texture_array; + continue; + } +#endif +#ifdef GL_EXT_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_EXT_texture_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_EXT_texture_compression_latc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_EXT_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_integer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) + { + ret = GLEW_EXT_texture_integer; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif +#ifdef GL_EXT_texture_shared_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) + { + ret = GLEW_EXT_texture_shared_exponent; + continue; + } +#endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_EXT_timer_query; + continue; + } +#endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif +#ifdef GL_EXT_x11_sync_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) + { + ret = GLEW_EXT_x11_sync_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_frame_terminator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) + { + ret = GLEW_GREMEDY_frame_terminator; + continue; + } +#endif +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef GL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = GLEW_KHR_debug; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_ldr; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_NV_bindless_texture; + continue; + } +#endif +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_NV_depth_buffer_float; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_depth_range_unclamped + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) + { + ret = GLEW_NV_depth_range_unclamped; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) + { + ret = GLEW_NV_fragment_program4; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) + { + ret = GLEW_NV_framebuffer_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_geometry_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) + { + ret = GLEW_NV_geometry_program4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_NV_geometry_shader4; + continue; + } +#endif +#ifdef GL_NV_gpu_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) + { + ret = GLEW_NV_gpu_program4; + continue; + } +#endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) + { + ret = GLEW_NV_parameter_buffer_object; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) + { + ret = GLEW_NV_shader_atomic_float; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_NV_texture_multisample; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_NV_transform_feedback; + continue; + } +#endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif +#ifdef GL_NV_vertex_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) + { + ret = GLEW_NV_vertex_program4; + continue; + } +#endif +#ifdef GL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLEW_NV_video_capture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) + { +#ifdef GL_OES_byte_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) + { + ret = GLEW_OES_byte_coordinates; + continue; + } +#endif +#ifdef GL_OES_compressed_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) + { + ret = GLEW_OES_compressed_paletted_texture; + continue; + } +#endif +#ifdef GL_OES_read_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) + { + ret = GLEW_OES_read_format; + continue; + } +#endif +#ifdef GL_OES_single_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) + { + ret = GLEW_OES_single_precision; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) + { +#ifdef GL_REGAL_error_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) + { + ret = GLEW_REGAL_error_string; + continue; + } +#endif +#ifdef GL_REGAL_extension_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) + { + ret = GLEW_REGAL_extension_query; + continue; + } +#endif +#ifdef GL_REGAL_log + if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) + { + ret = GLEW_REGAL_log; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = WGLEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) + { + ret = WGLEW_EXT_pixel_format_packed_float; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif +#ifdef WGL_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = WGLEW_EXT_swap_control_tear; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_DX_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) + { + ret = WGLEW_NV_DX_interop; + continue; + } +#endif +#ifdef WGL_NV_DX_interop2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) + { + ret = WGLEW_NV_DX_interop2; + continue; + } +#endif +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_gpu_affinity + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) + { + ret = WGLEW_NV_gpu_affinity; + continue; + } +#endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef WGL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = WGLEW_NV_video_capture; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__ANDROID__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif +#ifdef GLX_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLXEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GLX_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLXEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = GLXEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef GLX_EXT_fbconfig_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) + { + ret = GLXEW_EXT_fbconfig_packed_float; + continue; + } +#endif +#ifdef GLX_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = GLXEW_EXT_swap_control_tear; + continue; + } +#endif +#ifdef GLX_EXT_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = GLXEW_EXT_texture_from_pixmap; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GLX_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLXEW_NV_video_capture; + continue; + } +#endif +#ifdef GLX_NV_video_out + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) + { + ret = GLXEW_NV_video_out; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#ifdef GLX_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_hyperpipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) + { + ret = GLXEW_SGIX_hyperpipe; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/examples/common/glew/glew.h b/examples/common/glew/glew.h index 8dec85bf..3962f7c9 100644 --- a/examples/common/glew/glew.h +++ b/examples/common/glew/glew.h @@ -1,17132 +1,17132 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __glew_h__ -#define __glew_h__ -#define __GLEW_H__ - -#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) -#error gl.h included before glew.h -#endif -#if defined(__REGAL_H__) -#error Regal.h included before glew.h -#endif -#if defined(__glext_h_) || defined(__GLEXT_H_) -#error glext.h included before glew.h -#endif -#if defined(__gl_ATI_h_) -#error glATI.h included before glew.h -#endif - -#define __gl_h_ -#define __GL_H__ -#define __REGAL_H__ -#define __X_GL_H -#define __glext_h_ -#define __GLEXT_H_ -#define __gl_ATI_h_ - -#if defined(_WIN32) - -/* - * GLEW does not include to avoid name space pollution. - * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t - * defined properly. - */ -/* */ -#ifndef APIENTRY -#define GLEW_APIENTRY_DEFINED -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define APIENTRY __stdcall -# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) -# define APIENTRY __stdcall -# else -# define APIENTRY -# endif -#endif -#ifndef GLAPI -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define GLAPI extern -# endif -#endif -/* */ -#ifndef CALLBACK -#define GLEW_CALLBACK_DEFINED -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define CALLBACK __attribute__ ((__stdcall__)) -# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) -# define CALLBACK __stdcall -# else -# define CALLBACK -# endif -#endif -/* and */ -#ifndef WINGDIAPI -#define GLEW_WINGDIAPI_DEFINED -#define WINGDIAPI __declspec(dllimport) -#endif -/* */ -#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) -typedef unsigned short wchar_t; -# define _WCHAR_T_DEFINED -#endif -/* */ -#if !defined(_W64) -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif -#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) -# ifdef _WIN64 -typedef __int64 ptrdiff_t; -# else -typedef _W64 int ptrdiff_t; -# endif -# define _PTRDIFF_T_DEFINED -# define _PTRDIFF_T_ -#endif - -#ifndef GLAPI -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define GLAPI extern -# else -# define GLAPI WINGDIAPI -# endif -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY APIENTRY -#endif - -#ifndef GLEWAPIENTRY -#define GLEWAPIENTRY APIENTRY -#endif - -/* - * GLEW_STATIC is defined for static library. - * GLEW_BUILD is defined for building the DLL library. - */ - -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# ifdef GLEW_BUILD -# define GLEWAPI extern __declspec(dllexport) -# else -# define GLEWAPI extern __declspec(dllimport) -# endif -#endif - -#else /* _UNIX */ - -/* - * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO - * C. On my system, this amounts to _3 lines_ of included code, all of - * them pretty much harmless. If you know of a way of detecting 32 vs - * 64 _targets_ at compile time you are free to replace this with - * something that's portable. For now, _this_ is the portable solution. - * (mem, 2004-01-04) - */ - -#include - -/* SGI MIPSPro doesn't like stdint.h in C++ mode */ -/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ - -#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) -#include -#else -#include -#endif - -#define GLEW_APIENTRY_DEFINED -#define APIENTRY - -/* - * GLEW_STATIC is defined for static library. - */ - -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# if defined(__GNUC__) && __GNUC__>=4 -# define GLEWAPI extern __attribute__ ((visibility("default"))) -# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define GLEWAPI extern __global -# else -# define GLEWAPI extern -# endif -#endif - -/* */ -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef GLEWAPIENTRY -#define GLEWAPIENTRY -#endif - -#endif /* _WIN32 */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ - -#ifndef GL_VERSION_1_1 -#define GL_VERSION_1_1 1 - -typedef unsigned int GLenum; -typedef unsigned int GLbitfield; -typedef unsigned int GLuint; -typedef int GLint; -typedef int GLsizei; -typedef unsigned char GLboolean; -typedef signed char GLbyte; -typedef short GLshort; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned long GLulong; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void GLvoid; -#if defined(_MSC_VER) && _MSC_VER < 1400 -typedef __int64 GLint64EXT; -typedef unsigned __int64 GLuint64EXT; -#elif defined(_MSC_VER) || defined(__BORLANDC__) -typedef signed long long GLint64EXT; -typedef unsigned long long GLuint64EXT; -#else -# if defined(__MINGW32__) || defined(__CYGWIN__) -#include -# endif -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -#endif -typedef GLint64EXT GLint64; -typedef GLuint64EXT GLuint64; -typedef struct __GLsync *GLsync; - -typedef char GLchar; - -#define GL_ZERO 0 -#define GL_FALSE 0 -#define GL_LOGIC_OP 0x0BF1 -#define GL_NONE 0 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_NO_ERROR 0 -#define GL_POINTS 0x0000 -#define GL_CURRENT_BIT 0x00000001 -#define GL_TRUE 1 -#define GL_ONE 1 -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_POINT_BIT 0x00000002 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_LINE_STRIP 0x0003 -#define GL_LINE_BIT 0x00000004 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON 0x0009 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM 0x0100 -#define GL_LOAD 0x0101 -#define GL_RETURN 0x0102 -#define GL_MULT 0x0103 -#define GL_ADD 0x0104 -#define GL_NEVER 0x0200 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_EXP 0x0800 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_EXP2 0x0801 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LIST_MODE 0x0B30 -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_SHADE_MODEL 0x0B54 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_FOG 0x0B60 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_COLOR 0x0B66 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_MATRIX_MODE 0x0BA0 -#define GL_NORMALIZE 0x0BA1 -#define GL_VIEWPORT 0x0BA2 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_FUNC 0x0BC1 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_INDEX_MODE 0x0C30 -#define GL_RGBA_MODE 0x0C31 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_RENDER_MODE 0x0C40 -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_INDEX_BITS 0x0D51 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_EMISSION 0x1600 -#define GL_SHININESS 0x1601 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_COLOR_INDEX 0x1900 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_BITMAP 0x1A00 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_RENDER 0x1C00 -#define GL_FEEDBACK 0x1C01 -#define GL_SELECT 0x1C02 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_S 0x2000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 -#define GL_MODULATE 0x2100 -#define GL_DECAL 0x2101 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_ENV 0x2300 -#define GL_EYE_LINEAR 0x2400 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_SPHERE_MAP 0x2402 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_PLANE 0x2502 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_CLAMP 0x2900 -#define GL_REPEAT 0x2901 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_R3_G3_B2 0x2A10 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 -#define GL_LIGHT0 0x4000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_HINT_BIT 0x00008000 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000fffff -#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff - -GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); -GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); -GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void GLAPIENTRY glArrayElement (GLint i); -GLAPI void GLAPIENTRY glBegin (GLenum mode); -GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); -GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); -GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GLAPI void GLAPIENTRY glCallList (GLuint list); -GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); -GLAPI void GLAPIENTRY glClear (GLbitfield mask); -GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); -GLAPI void GLAPIENTRY glClearIndex (GLfloat c); -GLAPI void GLAPIENTRY glClearStencil (GLint s); -GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); -GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); -GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); -GLAPI void GLAPIENTRY glColor3iv (const GLint *v); -GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); -GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); -GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); -GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); -GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); -GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void GLAPIENTRY glColor4iv (const GLint *v); -GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); -GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); -GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); -GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); -GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); -GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); -GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); -GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void GLAPIENTRY glCullFace (GLenum mode); -GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); -GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); -GLAPI void GLAPIENTRY glDepthFunc (GLenum func); -GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); -GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); -GLAPI void GLAPIENTRY glDisable (GLenum cap); -GLAPI void GLAPIENTRY glDisableClientState (GLenum array); -GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); -GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); -GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); -GLAPI void GLAPIENTRY glEnable (GLenum cap); -GLAPI void GLAPIENTRY glEnableClientState (GLenum array); -GLAPI void GLAPIENTRY glEnd (void); -GLAPI void GLAPIENTRY glEndList (void); -GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); -GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); -GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); -GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); -GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); -GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); -GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); -GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); -GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); -GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); -GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); -GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); -GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); -GLAPI void GLAPIENTRY glFinish (void); -GLAPI void GLAPIENTRY glFlush (void); -GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glFrontFace (GLenum mode); -GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); -GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); -GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); -GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); -GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); -GLAPI GLenum GLAPIENTRY glGetError (void); -GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); -GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); -GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); -GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); -GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); -GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); -GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); -GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); -GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); -GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); -GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); -GLAPI void GLAPIENTRY glIndexMask (GLuint mask); -GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glIndexd (GLdouble c); -GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); -GLAPI void GLAPIENTRY glIndexf (GLfloat c); -GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); -GLAPI void GLAPIENTRY glIndexi (GLint c); -GLAPI void GLAPIENTRY glIndexiv (const GLint *c); -GLAPI void GLAPIENTRY glIndexs (GLshort c); -GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); -GLAPI void GLAPIENTRY glIndexub (GLubyte c); -GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); -GLAPI void GLAPIENTRY glInitNames (void); -GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); -GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); -GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); -GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); -GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); -GLAPI void GLAPIENTRY glLineWidth (GLfloat width); -GLAPI void GLAPIENTRY glListBase (GLuint base); -GLAPI void GLAPIENTRY glLoadIdentity (void); -GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); -GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); -GLAPI void GLAPIENTRY glLoadName (GLuint name); -GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); -GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); -GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); -GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); -GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); -GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); -GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); -GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); -GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); -GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); -GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); -GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); -GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); -GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); -GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void GLAPIENTRY glPassThrough (GLfloat token); -GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); -GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); -GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); -GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); -GLAPI void GLAPIENTRY glPointSize (GLfloat size); -GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); -GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); -GLAPI void GLAPIENTRY glPopAttrib (void); -GLAPI void GLAPIENTRY glPopClientAttrib (void); -GLAPI void GLAPIENTRY glPopMatrix (void); -GLAPI void GLAPIENTRY glPopName (void); -GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); -GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); -GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); -GLAPI void GLAPIENTRY glPushMatrix (void); -GLAPI void GLAPIENTRY glPushName (GLuint name); -GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); -GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); -GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); -GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); -GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); -GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); -GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); -GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); -GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); -GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); -GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); -GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); -GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); -GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); -GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); -GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); -GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); -GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); -GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); -GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); -GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); -GLAPI void GLAPIENTRY glShadeModel (GLenum mode); -GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GLAPI void GLAPIENTRY glStencilMask (GLuint mask); -GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); -GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); -GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord1i (GLint s); -GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); -GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); -GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); -GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); -GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); -GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); -GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); -GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); -GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); -GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); -GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); -GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) - -#endif /* GL_VERSION_1_1 */ - -/* ---------------------------------- GLU ---------------------------------- */ - -#ifndef GLEW_NO_GLU -/* this is where we can safely include GLU */ -# if defined(__APPLE__) && defined(__MACH__) -# include -# else -# include -# endif -#endif - -/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 - -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E - -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - -#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) -#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) -#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) -#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) - -#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) - -#endif /* GL_VERSION_1_2 */ - -/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ - -#ifndef GL_VERSION_1_2_1 -#define GL_VERSION_1_2_1 1 - -#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) - -#endif /* GL_VERSION_1_2_1 */ - -/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 - -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_SUBTRACT 0x84E7 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#define GL_MULTISAMPLE_BIT 0x20000000 - -typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); - -#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) -#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) -#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) -#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) -#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) -#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) -#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) -#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) -#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) -#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) -#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) -#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) -#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) -#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) -#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) -#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) -#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) -#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) -#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) -#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) -#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) -#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) -#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) -#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) -#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) -#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) -#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) -#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) -#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) -#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) -#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) -#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) -#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) -#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) -#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) -#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) -#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) -#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) -#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) -#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) -#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) -#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) -#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) -#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) -#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) -#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) - -#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) - -#endif /* GL_VERSION_1_3 */ - -/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 - -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E - -typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); - -#define glBlendColor GLEW_GET_FUN(__glewBlendColor) -#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) -#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) -#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) -#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) -#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) -#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) -#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) -#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) -#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) -#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) -#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) -#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) -#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) -#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) -#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) -#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) -#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) -#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) -#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) -#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) -#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) -#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) -#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) -#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) -#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) -#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) -#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) -#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) -#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) -#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) -#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) -#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) -#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) -#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) -#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) -#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) -#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) -#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) -#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) -#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) -#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) -#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) -#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) -#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) -#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) -#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) - -#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) - -#endif /* GL_VERSION_1_4 */ - -/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 - -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 - -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); -typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); -typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); - -#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) -#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) -#define glBufferData GLEW_GET_FUN(__glewBufferData) -#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) -#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) -#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) -#define glEndQuery GLEW_GET_FUN(__glewEndQuery) -#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) -#define glGenQueries GLEW_GET_FUN(__glewGenQueries) -#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) -#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) -#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) -#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) -#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) -#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) -#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) -#define glIsQuery GLEW_GET_FUN(__glewIsQuery) -#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) -#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) - -#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) - -#endif /* GL_VERSION_1_5 */ - -/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 - -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 - -typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); -typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); -typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); -typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); -typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); -typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); - -#define glAttachShader GLEW_GET_FUN(__glewAttachShader) -#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) -#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) -#define glCompileShader GLEW_GET_FUN(__glewCompileShader) -#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) -#define glCreateShader GLEW_GET_FUN(__glewCreateShader) -#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) -#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) -#define glDetachShader GLEW_GET_FUN(__glewDetachShader) -#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) -#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) -#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) -#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) -#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) -#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) -#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) -#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) -#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) -#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) -#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) -#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) -#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) -#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) -#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) -#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) -#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) -#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) -#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) -#define glIsProgram GLEW_GET_FUN(__glewIsProgram) -#define glIsShader GLEW_GET_FUN(__glewIsShader) -#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) -#define glShaderSource GLEW_GET_FUN(__glewShaderSource) -#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) -#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) -#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) -#define glUniform1f GLEW_GET_FUN(__glewUniform1f) -#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) -#define glUniform1i GLEW_GET_FUN(__glewUniform1i) -#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) -#define glUniform2f GLEW_GET_FUN(__glewUniform2f) -#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) -#define glUniform2i GLEW_GET_FUN(__glewUniform2i) -#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) -#define glUniform3f GLEW_GET_FUN(__glewUniform3f) -#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) -#define glUniform3i GLEW_GET_FUN(__glewUniform3i) -#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) -#define glUniform4f GLEW_GET_FUN(__glewUniform4f) -#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) -#define glUniform4i GLEW_GET_FUN(__glewUniform4i) -#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) -#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) -#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) -#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) -#define glUseProgram GLEW_GET_FUN(__glewUseProgram) -#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) -#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) -#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) -#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) -#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) -#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) -#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) -#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) -#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) -#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) -#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) -#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) -#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) -#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) -#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) -#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) -#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) -#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) -#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) -#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) -#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) -#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) -#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) -#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) -#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) -#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) -#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) -#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) -#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) -#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) -#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) -#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) -#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) -#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) -#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) -#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) -#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) -#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) - -#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) - -#endif /* GL_VERSION_2_0 */ - -/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 - -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B - -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - -#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) -#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) -#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) -#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) -#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) -#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) - -#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) - -#endif /* GL_VERSION_2_1 */ - -/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 - -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB -#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 -#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 -#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 - -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); -typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); -typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); -typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); - -#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) -#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) -#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) -#define glClampColor GLEW_GET_FUN(__glewClampColor) -#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) -#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) -#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) -#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) -#define glColorMaski GLEW_GET_FUN(__glewColorMaski) -#define glDisablei GLEW_GET_FUN(__glewDisablei) -#define glEnablei GLEW_GET_FUN(__glewEnablei) -#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) -#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) -#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) -#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) -#define glGetStringi GLEW_GET_FUN(__glewGetStringi) -#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) -#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) -#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) -#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) -#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) -#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) -#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) -#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) -#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) -#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) -#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) -#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) -#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) -#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) -#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) -#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) -#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) -#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) -#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) -#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) -#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) -#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) -#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) -#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) -#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) -#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) -#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) -#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) -#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) -#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) -#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) -#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) -#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) -#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) -#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) -#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) -#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) -#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) -#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) - -#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) - -#endif /* GL_VERSION_3_0 */ - -/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 - -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); -typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); - -#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) -#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) -#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) -#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) - -#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) - -#endif /* GL_VERSION_3_1 */ - -/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 - -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); -typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); - -#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) -#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) -#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) - -#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) - -#endif /* GL_VERSION_3_2 */ - -/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 - -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_RGB10_A2UI 0x906F - -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); - -#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) - -#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) - -#endif /* GL_VERSION_3_3 */ - -/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 - -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); - -#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) -#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) -#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) -#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) -#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) - -#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) - -#endif /* GL_VERSION_4_0 */ - -/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 - -#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) - -#endif /* GL_VERSION_4_1 */ - -/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 - -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F - -#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) - -#endif /* GL_VERSION_4_2 */ - -/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 - -#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 -#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E - -#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) - -#endif /* GL_VERSION_4_3 */ - -/* -------------------------- GL_3DFX_multisample -------------------------- */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 - -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 - -#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) - -#endif /* GL_3DFX_multisample */ - -/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 - -typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); - -#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) - -#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) - -#endif /* GL_3DFX_tbuffer */ - -/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 - -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 - -#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) - -#endif /* GL_3DFX_texture_compression_FXT1 */ - -/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 - -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D - -#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) - -#endif /* GL_AMD_blend_minmax_factor */ - -/* ----------------------- GL_AMD_conservative_depth ----------------------- */ - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 - -#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) - -#endif /* GL_AMD_conservative_depth */ - -/* -------------------------- GL_AMD_debug_output -------------------------- */ - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 - -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 - -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); - -#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) -#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) -#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) -#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) - -#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) - -#endif /* GL_AMD_debug_output */ - -/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 - -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F - -#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) - -#endif /* GL_AMD_depth_clamp_separate */ - -/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); - -#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) -#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) -#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) -#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) - -#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) - -#endif /* GL_AMD_draw_buffers_blend */ - -/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); - -#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) -#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) - -#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) - -#endif /* GL_AMD_multi_draw_indirect */ - -/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 - -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 - -typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); -typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); - -#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) -#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) -#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) - -#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) - -#endif /* GL_AMD_name_gen_delete */ - -/* ----------------------- GL_AMD_performance_monitor ---------------------- */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 - -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 - -typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); -typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); - -#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) -#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) -#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) -#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) -#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) -#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) -#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) -#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) -#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) -#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) -#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) - -#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) - -#endif /* GL_AMD_performance_monitor */ - -/* -------------------------- GL_AMD_pinned_memory ------------------------- */ - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 - -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 - -#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) - -#endif /* GL_AMD_pinned_memory */ - -/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ - -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 - -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 - -#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) - -#endif /* GL_AMD_query_buffer_object */ - -/* ------------------------ GL_AMD_sample_positions ------------------------ */ - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 - -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F - -typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); - -#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) - -#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) - -#endif /* GL_AMD_sample_positions */ - -/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 - -#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F - -#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) - -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 - -#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) - -#endif /* GL_AMD_shader_stencil_export */ - -/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 - -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D - -typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); - -#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) - -#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) - -#endif /* GL_AMD_stencil_operation_extended */ - -/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 - -#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) - -#endif /* GL_AMD_texture_texture4 */ - -/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 - -#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) - -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 - -#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) - -#endif /* GL_AMD_vertex_shader_layer */ - -/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ - -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 - -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 - -typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); - -#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) -#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) - -#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) - -#endif /* GL_AMD_vertex_shader_tessellator */ - -/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 - -#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) - -#endif /* GL_AMD_vertex_shader_viewport_index */ - -/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 - -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 - -#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) - -#endif /* GL_APPLE_aux_depth_stencil */ - -/* ------------------------ GL_APPLE_client_storage ------------------------ */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 - -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 - -#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) - -#endif /* GL_APPLE_client_storage */ - -/* ------------------------- GL_APPLE_element_array ------------------------ */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 - -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); - -#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) -#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) -#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) -#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) -#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) - -#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) - -#endif /* GL_APPLE_element_array */ - -/* ----------------------------- GL_APPLE_fence ---------------------------- */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 - -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B - -typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); -typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); -typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); - -#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) -#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) -#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) -#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) -#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) -#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) -#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) -#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) - -#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) - -#endif /* GL_APPLE_fence */ - -/* ------------------------- GL_APPLE_float_pixels ------------------------- */ - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 - -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F - -#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) - -#endif /* GL_APPLE_float_pixels */ - -/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 - -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 - -typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); - -#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) -#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) - -#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) - -#endif /* GL_APPLE_flush_buffer_range */ - -/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 - -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D - -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); -typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); - -#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) -#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) -#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) - -#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) - -#endif /* GL_APPLE_object_purgeable */ - -/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ - -#ifndef GL_APPLE_pixel_buffer -#define GL_APPLE_pixel_buffer 1 - -#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 - -#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) - -#endif /* GL_APPLE_pixel_buffer */ - -/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 - -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_422_APPLE 0x8A1F - -#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) - -#endif /* GL_APPLE_rgb_422 */ - -/* --------------------------- GL_APPLE_row_bytes -------------------------- */ - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 - -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 - -#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) - -#endif /* GL_APPLE_row_bytes */ - -/* ------------------------ GL_APPLE_specular_vector ----------------------- */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 - -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 - -#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) - -#endif /* GL_APPLE_specular_vector */ - -/* ------------------------- GL_APPLE_texture_range ------------------------ */ - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 - -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF - -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); -typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); - -#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) -#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) - -#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) - -#endif /* GL_APPLE_texture_range */ - -/* ------------------------ GL_APPLE_transform_hint ------------------------ */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 - -#define GL_TRANSFORM_HINT_APPLE 0x85B1 - -#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) - -#endif /* GL_APPLE_transform_hint */ - -/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 - -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); -typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); - -#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) -#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) -#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) -#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) - -#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) - -#endif /* GL_APPLE_vertex_array_object */ - -/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 - -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF - -typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); - -#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) -#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) -#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) - -#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) - -#endif /* GL_APPLE_vertex_array_range */ - -/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 - -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 - -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); - -#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) -#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) -#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) -#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) -#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) -#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) -#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) - -#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) - -#endif /* GL_APPLE_vertex_program_evaluators */ - -/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 - -#define GL_YCBCR_422_APPLE 0x85B9 - -#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) - -#endif /* GL_APPLE_ycbcr_422 */ - -/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 - -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_RGB565 0x8D62 -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); -typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); -typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); - -#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) -#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) -#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) -#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) -#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) - -#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) - -#endif /* GL_ARB_ES2_compatibility */ - -/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ - -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 - -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 - -#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) - -#endif /* GL_ARB_ES3_compatibility */ - -/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ - -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 - -#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) - -#endif /* GL_ARB_arrays_of_arrays */ - -/* -------------------------- GL_ARB_base_instance ------------------------- */ - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); - -#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) -#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) -#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) - -#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) - -#endif /* GL_ARB_base_instance */ - -/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 - -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC - -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); - -#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) -#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) - -#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) - -#endif /* GL_ARB_blend_func_extended */ - -/* ---------------------------- GL_ARB_cl_event ---------------------------- */ - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 - -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 - -typedef struct _cl_context *cl_context; -typedef struct _cl_event *cl_event; - -typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); - -#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) - -#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) - -#endif /* GL_ARB_cl_event */ - -/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ - -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 - -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); - -#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) -#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) -#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) -#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) - -#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) - -#endif /* GL_ARB_clear_buffer_object */ - -/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 - -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D - -typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); - -#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) - -#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) - -#endif /* GL_ARB_color_buffer_float */ - -/* -------------------------- GL_ARB_compatibility ------------------------- */ - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 - -#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) - -#endif /* GL_ARB_compatibility */ - -/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 - -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E - -#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) - -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -/* ------------------------- GL_ARB_compute_shader ------------------------- */ - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 - -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF - -typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); - -#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) -#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) - -#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) - -#endif /* GL_ARB_compute_shader */ - -/* ----------------------- GL_ARB_conservative_depth ----------------------- */ - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 - -#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) - -#endif /* GL_ARB_conservative_depth */ - -/* --------------------------- GL_ARB_copy_buffer -------------------------- */ - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 - -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 - -typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); - -#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) - -#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) - -#endif /* GL_ARB_copy_buffer */ - -/* --------------------------- GL_ARB_copy_image --------------------------- */ - -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 - -typedef void (GLAPIENTRY * 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); - -#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) - -#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) - -#endif /* GL_ARB_copy_image */ - -/* -------------------------- GL_ARB_debug_output -------------------------- */ - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 - -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 - -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); - -#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) -#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) -#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) -#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) - -#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) - -#endif /* GL_ARB_debug_output */ - -/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 - -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD - -#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) - -#endif /* GL_ARB_depth_buffer_float */ - -/* --------------------------- GL_ARB_depth_clamp -------------------------- */ - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 - -#define GL_DEPTH_CLAMP 0x864F - -#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) - -#endif /* GL_ARB_depth_clamp */ - -/* -------------------------- GL_ARB_depth_texture ------------------------- */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 - -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B - -#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) - -#endif /* GL_ARB_depth_texture */ - -/* -------------------------- GL_ARB_draw_buffers -------------------------- */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 - -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 - -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); - -#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) - -#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) - -#endif /* GL_ARB_draw_buffers */ - -/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); - -#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) -#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) -#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) -#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) - -#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) - -#endif /* GL_ARB_draw_buffers_blend */ - -/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex); - -#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) -#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) -#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) -#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) - -#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) - -#endif /* GL_ARB_draw_elements_base_vertex */ - -/* -------------------------- GL_ARB_draw_indirect ------------------------- */ - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 - -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect); - -#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) -#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) - -#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) - -#endif /* GL_ARB_draw_indirect */ - -/* ------------------------- GL_ARB_draw_instanced ------------------------- */ - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 - -#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) - -#endif /* GL_ARB_draw_instanced */ - -/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 - -#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) - -#endif /* GL_ARB_explicit_attrib_location */ - -/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ - -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 - -#define GL_MAX_UNIFORM_LOCATIONS 0x826E - -#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) - -#endif /* GL_ARB_explicit_uniform_location */ - -/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 - -#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) - -#endif /* GL_ARB_fragment_coord_conventions */ - -/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ - -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 - -#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) - -#endif /* GL_ARB_fragment_layer_viewport */ - -/* ------------------------ GL_ARB_fragment_program ------------------------ */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 - -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 - -#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) - -#endif /* GL_ARB_fragment_program */ - -/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 - -#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) - -#endif /* GL_ARB_fragment_program_shadow */ - -/* ------------------------- GL_ARB_fragment_shader ------------------------ */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 - -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B - -#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) - -#endif /* GL_ARB_fragment_shader */ - -/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ - -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 - -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); - -#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) -#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) -#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) -#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) - -#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) - -#endif /* GL_ARB_framebuffer_no_attachments */ - -/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 - -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_INDEX 0x8222 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_SRGB 0x8C40 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 - -typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); -typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) -#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) -#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) -#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) -#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) -#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) -#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) -#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) -#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) -#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) -#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) -#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) -#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) -#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) -#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) -#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) -#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) -#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) -#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) -#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) - -#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) - -#endif /* GL_ARB_framebuffer_object */ - -/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 - -#define GL_FRAMEBUFFER_SRGB 0x8DB9 - -#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) - -#endif /* GL_ARB_framebuffer_sRGB */ - -/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 - -#define GL_LINES_ADJACENCY_ARB 0xA -#define GL_LINE_STRIP_ADJACENCY_ARB 0xB -#define GL_TRIANGLES_ADJACENCY_ARB 0xC -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); - -#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) -#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) -#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) -#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) - -#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) - -#endif /* GL_ARB_geometry_shader4 */ - -/* ----------------------- GL_ARB_get_program_binary ----------------------- */ - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 - -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); -typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); - -#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) -#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) -#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) - -#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) - -#endif /* GL_ARB_get_program_binary */ - -/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 - -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MAX_VERTEX_STREAMS 0x8E71 - -#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) - -#endif /* GL_ARB_gpu_shader5 */ - -/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 - -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE - -typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); - -#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) -#define glUniform1d GLEW_GET_FUN(__glewUniform1d) -#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) -#define glUniform2d GLEW_GET_FUN(__glewUniform2d) -#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) -#define glUniform3d GLEW_GET_FUN(__glewUniform3d) -#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) -#define glUniform4d GLEW_GET_FUN(__glewUniform4d) -#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) -#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) -#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) -#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) -#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) -#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) -#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) -#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) -#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) -#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) - -#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) - -#endif /* GL_ARB_gpu_shader_fp64 */ - -/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 - -#define GL_HALF_FLOAT_ARB 0x140B - -#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) - -#endif /* GL_ARB_half_float_pixel */ - -/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 - -#define GL_HALF_FLOAT 0x140B - -#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) - -#endif /* GL_ARB_half_float_vertex */ - -/* ----------------------------- GL_ARB_imaging ---------------------------- */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_IGNORE_BORDER 0x8150 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_WRAP_BORDER 0x8152 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 - -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); - -#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) -#define glColorTable GLEW_GET_FUN(__glewColorTable) -#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) -#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) -#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) -#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) -#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) -#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) -#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) -#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) -#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) -#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) -#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) -#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) -#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) -#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) -#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) -#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) -#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) -#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) -#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) -#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) -#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) -#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) -#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) -#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) -#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) -#define glHistogram GLEW_GET_FUN(__glewHistogram) -#define glMinmax GLEW_GET_FUN(__glewMinmax) -#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) -#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) -#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) - -#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) - -#endif /* GL_ARB_imaging */ - -/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 - -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); - -#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) -#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) -#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) - -#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) - -#endif /* GL_ARB_instanced_arrays */ - -/* ---------------------- GL_ARB_internalformat_query ---------------------- */ - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 - -#define GL_NUM_SAMPLE_COUNTS 0x9380 - -typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); - -#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) - -#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) - -#endif /* GL_ARB_internalformat_query */ - -/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ - -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 - -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_3D 0x806F -#define GL_SAMPLES 0x80A9 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_SRGB_DECODE_ARB 0x8299 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_RENDERBUFFER 0x8D41 -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_NUM_SAMPLE_COUNTS 0x9380 - -typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); - -#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) - -#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) - -#endif /* GL_ARB_internalformat_query2 */ - -/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ - -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 - -typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); -typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); - -#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) -#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) -#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) -#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) -#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) -#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) - -#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) - -#endif /* GL_ARB_invalidate_subdata */ - -/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 - -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC - -#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) - -#endif /* GL_ARB_map_buffer_alignment */ - -/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 - -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 - -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); - -#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) -#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) - -#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) - -#endif /* GL_ARB_map_buffer_range */ - -/* ------------------------- GL_ARB_matrix_palette ------------------------- */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 - -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 - -typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); - -#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) -#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) -#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) -#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) -#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) - -#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) - -#endif /* GL_ARB_matrix_palette */ - -/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ - -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); - -#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) -#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) - -#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) - -#endif /* GL_ARB_multi_draw_indirect */ - -/* --------------------------- GL_ARB_multisample -------------------------- */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 - -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 - -typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); - -#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) - -#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) - -#endif /* GL_ARB_multisample */ - -/* -------------------------- GL_ARB_multitexture -------------------------- */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) -#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) -#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) -#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) -#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) -#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) -#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) -#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) -#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) -#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) -#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) -#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) -#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) -#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) -#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) -#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) -#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) -#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) -#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) -#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) -#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) -#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) -#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) -#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) -#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) -#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) -#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) -#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) -#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) -#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) -#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) -#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) -#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) -#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) - -#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) - -#endif /* GL_ARB_multitexture */ - -/* ------------------------- GL_ARB_occlusion_query ------------------------ */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 - -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); - -#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) -#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) -#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) -#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) -#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) -#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) -#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) -#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) - -#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) - -#endif /* GL_ARB_occlusion_query */ - -/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 - -#define GL_ANY_SAMPLES_PASSED 0x8C2F - -#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) - -#endif /* GL_ARB_occlusion_query2 */ - -/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 - -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF - -#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) - -#endif /* GL_ARB_pixel_buffer_object */ - -/* ------------------------ GL_ARB_point_parameters ------------------------ */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 - -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); - -#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) -#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) - -#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) - -#endif /* GL_ARB_point_parameters */ - -/* -------------------------- GL_ARB_point_sprite -------------------------- */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 - -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 - -#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) - -#endif /* GL_ARB_point_sprite */ - -/* --------------------- GL_ARB_program_interface_query -------------------- */ - -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 - -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_IS_PER_PATCH 0x92E7 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); -typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); - -#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) -#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) -#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) -#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) -#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) -#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) - -#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) - -#endif /* GL_ARB_program_interface_query */ - -/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 - -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F - -typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); - -#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) - -#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) - -#endif /* GL_ARB_provoking_vertex */ - -/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ - -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 - -#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) - -#endif /* GL_ARB_robust_buffer_access_behavior */ - -/* --------------------------- GL_ARB_robustness --------------------------- */ - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 - -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 - -typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); -typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); -typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); -typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); -typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); -typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); -typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); -typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); -typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); -typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); -typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); - -#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) -#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) -#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) -#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) -#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) -#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) -#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) -#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) -#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) -#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) -#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) -#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) -#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) -#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) -#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) -#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) -#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) -#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) -#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) -#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) - -#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) - -#endif /* GL_ARB_robustness */ - -/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ - -#ifndef GL_ARB_robustness_application_isolation -#define GL_ARB_robustness_application_isolation 1 - -#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) - -#endif /* GL_ARB_robustness_application_isolation */ - -/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ - -#ifndef GL_ARB_robustness_share_group_isolation -#define GL_ARB_robustness_share_group_isolation 1 - -#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) - -#endif /* GL_ARB_robustness_share_group_isolation */ - -/* ------------------------- GL_ARB_sample_shading ------------------------- */ - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 - -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 - -typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); - -#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) - -#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) - -#endif /* GL_ARB_sample_shading */ - -/* ------------------------- GL_ARB_sampler_objects ------------------------ */ - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 - -#define GL_SAMPLER_BINDING 0x8919 - -typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); -typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); - -#define glBindSampler GLEW_GET_FUN(__glewBindSampler) -#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) -#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) -#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) -#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) -#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) -#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) -#define glIsSampler GLEW_GET_FUN(__glewIsSampler) -#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) -#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) -#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) -#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) -#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) -#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) - -#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) - -#endif /* GL_ARB_sampler_objects */ - -/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 - -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F - -#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) - -#endif /* GL_ARB_seamless_cube_map */ - -/* --------------------- GL_ARB_separate_shader_objects -------------------- */ - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 - -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_ALL_SHADER_BITS 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); - -#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) -#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) -#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) -#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) -#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) -#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) -#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) -#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) -#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) -#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) -#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) -#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) -#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) -#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) -#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) -#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) -#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) -#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) -#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) -#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) -#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) -#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) -#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) -#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) -#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) -#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) -#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) -#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) -#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) -#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) -#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) -#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) -#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) -#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) -#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) -#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) -#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) -#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) -#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) -#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) -#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) -#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) -#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) -#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) -#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) -#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) -#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) -#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) -#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) -#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) -#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) -#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) -#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) -#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) -#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) -#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) -#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) -#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) -#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) -#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) - -#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) - -#endif /* GL_ARB_separate_shader_objects */ - -/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 - -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC - -typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); - -#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) - -#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) - -#endif /* GL_ARB_shader_atomic_counters */ - -/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 - -#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) - -#endif /* GL_ARB_shader_bit_encoding */ - -/* --------------------- GL_ARB_shader_image_load_store -------------------- */ - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 - -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); - -#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) -#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) - -#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) - -#endif /* GL_ARB_shader_image_load_store */ - -/* ------------------------ GL_ARB_shader_image_size ----------------------- */ - -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 - -#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) - -#endif /* GL_ARB_shader_image_size */ - -/* ------------------------- GL_ARB_shader_objects ------------------------- */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 - -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 - -typedef char GLcharARB; -typedef unsigned int GLhandleARB; - -typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); -typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); -typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); - -#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) -#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) -#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) -#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) -#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) -#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) -#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) -#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) -#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) -#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) -#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) -#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) -#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) -#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) -#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) -#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) -#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) -#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) -#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) -#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) -#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) -#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) -#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) -#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) -#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) -#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) -#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) -#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) -#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) -#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) -#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) -#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) -#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) -#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) -#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) -#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) -#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) -#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) -#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) - -#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) - -#endif /* GL_ARB_shader_objects */ - -/* ------------------------ GL_ARB_shader_precision ------------------------ */ - -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 - -#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) - -#endif /* GL_ARB_shader_precision */ - -/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 - -#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) - -#endif /* GL_ARB_shader_stencil_export */ - -/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ - -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 - -#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF - -typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); - -#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) - -#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) - -#endif /* GL_ARB_shader_storage_buffer_object */ - -/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 - -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B - -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); -typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); -typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); - -#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) -#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) -#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) -#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) -#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) -#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) -#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) -#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) - -#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) - -#endif /* GL_ARB_shader_subroutine */ - -/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 - -#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) - -#endif /* GL_ARB_shader_texture_lod */ - -/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 - -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C - -#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) - -#endif /* GL_ARB_shading_language_100 */ - -/* -------------------- GL_ARB_shading_language_420pack -------------------- */ - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 - -#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) - -#endif /* GL_ARB_shading_language_420pack */ - -/* -------------------- GL_ARB_shading_language_include -------------------- */ - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 - -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA - -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar ** path, const GLint *length); -typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); - -#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) -#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) -#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) -#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) -#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) -#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) - -#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) - -#endif /* GL_ARB_shading_language_include */ - -/* -------------------- GL_ARB_shading_language_packing -------------------- */ - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 - -#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) - -#endif /* GL_ARB_shading_language_packing */ - -/* ----------------------------- GL_ARB_shadow ----------------------------- */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 - -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E - -#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) - -#endif /* GL_ARB_shadow */ - -/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 - -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF - -#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) - -#endif /* GL_ARB_shadow_ambient */ - -/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ - -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 - -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA - -#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) - -#endif /* GL_ARB_stencil_texturing */ - -/* ------------------------------ GL_ARB_sync ------------------------------ */ - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 - -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF - -typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); -typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); -typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); -typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); -typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); -typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); - -#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) -#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) -#define glFenceSync GLEW_GET_FUN(__glewFenceSync) -#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) -#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) -#define glIsSync GLEW_GET_FUN(__glewIsSync) -#define glWaitSync GLEW_GET_FUN(__glewWaitSync) - -#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) - -#endif /* GL_ARB_sync */ - -/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 - -#define GL_PATCHES 0xE -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A - -typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); -typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); - -#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) -#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) - -#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) - -#endif /* GL_ARB_tessellation_shader */ - -/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 - -#define GL_CLAMP_TO_BORDER_ARB 0x812D - -#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) - -#endif /* GL_ARB_texture_border_clamp */ - -/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 - -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E - -typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); - -#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) - -#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) - -#endif /* GL_ARB_texture_buffer_object */ - -/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 - -#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) - -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ - -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 - -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F - -typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); - -#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) -#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) - -#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) - -#endif /* GL_ARB_texture_buffer_range */ - -/* ----------------------- GL_ARB_texture_compression ---------------------- */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 - -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 - -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); - -#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) -#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) -#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) -#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) -#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) -#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) -#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) - -#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) - -#endif /* GL_ARB_texture_compression */ - -/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 - -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F - -#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) - -#endif /* GL_ARB_texture_compression_bptc */ - -/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 - -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE - -#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) - -#endif /* GL_ARB_texture_compression_rgtc */ - -/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 - -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C - -#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) - -#endif /* GL_ARB_texture_cube_map */ - -/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 - -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F - -#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) - -#endif /* GL_ARB_texture_cube_map_array */ - -/* ------------------------- GL_ARB_texture_env_add ------------------------ */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 - -#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) - -#endif /* GL_ARB_texture_env_add */ - -/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 - -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A - -#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) - -#endif /* GL_ARB_texture_env_combine */ - -/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 - -#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) - -#endif /* GL_ARB_texture_env_crossbar */ - -/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 - -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF - -#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) - -#endif /* GL_ARB_texture_env_dot3 */ - -/* -------------------------- GL_ARB_texture_float ------------------------- */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 - -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 - -#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) - -#endif /* GL_ARB_texture_float */ - -/* ------------------------- GL_ARB_texture_gather ------------------------- */ - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 - -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F - -#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) - -#endif /* GL_ARB_texture_gather */ - -/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 - -#define GL_MIRRORED_REPEAT_ARB 0x8370 - -#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) - -#endif /* GL_ARB_texture_mirrored_repeat */ - -/* ----------------------- GL_ARB_texture_multisample ---------------------- */ - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 - -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 - -typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); - -#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) -#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) -#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) -#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) - -#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) - -#endif /* GL_ARB_texture_multisample */ - -/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 - -#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) - -#endif /* GL_ARB_texture_non_power_of_two */ - -/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ - -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 - -#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) - -#endif /* GL_ARB_texture_query_levels */ - -/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 - -#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) - -#endif /* GL_ARB_texture_query_lod */ - -/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 - -#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) - -#endif /* GL_ARB_texture_rectangle */ - -/* --------------------------- GL_ARB_texture_rg --------------------------- */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 - -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C - -#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) - -#endif /* GL_ARB_texture_rg */ - -/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 - -#define GL_RGB10_A2UI 0x906F - -#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) - -#endif /* GL_ARB_texture_rgb10_a2ui */ - -/* ------------------------- GL_ARB_texture_storage ------------------------ */ - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 - -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F - -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); - -#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) -#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) -#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) -#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) -#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) -#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) - -#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) - -#endif /* GL_ARB_texture_storage */ - -/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ - -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 - -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); - -#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) -#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) -#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) -#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) - -#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) - -#endif /* GL_ARB_texture_storage_multisample */ - -/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 - -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 - -#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) - -#endif /* GL_ARB_texture_swizzle */ - -/* -------------------------- GL_ARB_texture_view -------------------------- */ - -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 - -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF - -typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); - -#define glTextureView GLEW_GET_FUN(__glewTextureView) - -#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) - -#endif /* GL_ARB_texture_view */ - -/* --------------------------- GL_ARB_timer_query -------------------------- */ - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 - -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 - -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); -typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); - -#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) -#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) -#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) - -#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) - -#endif /* GL_ARB_timer_query */ - -/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 - -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 - -typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); -typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); - -#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) -#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) -#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) -#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) -#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) -#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) -#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) - -#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) - -#endif /* GL_ARB_transform_feedback2 */ - -/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 - -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -#define GL_MAX_VERTEX_STREAMS 0x8E71 - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); - -#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) -#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) -#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) -#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) - -#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) - -#endif /* GL_ARB_transform_feedback3 */ - -/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 - -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); - -#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) -#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) - -#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) - -#endif /* GL_ARB_transform_feedback_instanced */ - -/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 - -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 - -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); - -#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) -#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) -#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) -#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) - -#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) - -#endif /* GL_ARB_transpose_matrix */ - -/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 - -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); -typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); -typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); - -#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) -#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) -#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) -#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) -#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) -#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) -#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) -#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) -#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) -#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) - -#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) - -#endif /* GL_ARB_uniform_buffer_object */ - -/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 - -#define GL_BGRA 0x80E1 - -#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) - -#endif /* GL_ARB_vertex_array_bgra */ - -/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 - -#define GL_VERTEX_ARRAY_BINDING 0x85B5 - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); -typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); - -#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) -#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) -#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) -#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) - -#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) - -#endif /* GL_ARB_vertex_array_object */ - -/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 - -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); - -#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) -#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) -#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) -#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) -#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) -#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) -#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) -#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) -#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) -#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) - -#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) - -#endif /* GL_ARB_vertex_attrib_64bit */ - -/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ - -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 - -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); - -#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) -#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) -#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) -#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) -#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) -#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) - -#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) - -#endif /* GL_ARB_vertex_attrib_binding */ - -/* -------------------------- GL_ARB_vertex_blend -------------------------- */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 - -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F - -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); -typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); -typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); - -#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) -#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) -#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) -#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) -#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) -#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) -#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) -#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) -#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) -#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) - -#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) - -#endif /* GL_ARB_vertex_blend */ - -/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 - -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA - -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; - -typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); - -#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) -#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) -#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) -#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) -#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) -#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) -#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) -#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) -#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) -#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) -#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) - -#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) - -#endif /* GL_ARB_vertex_buffer_object */ - -/* ------------------------- GL_ARB_vertex_program ------------------------- */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 - -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF - -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); - -#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) -#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) -#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) -#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) -#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) -#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) -#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) -#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) -#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) -#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) -#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) -#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) -#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) -#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) -#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) -#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) -#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) -#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) -#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) -#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) -#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) -#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) -#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) -#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) -#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) -#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) -#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) -#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) -#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) -#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) -#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) -#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) -#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) -#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) -#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) -#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) -#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) -#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) -#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) -#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) -#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) -#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) -#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) -#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) -#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) -#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) -#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) -#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) -#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) -#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) -#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) -#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) -#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) -#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) -#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) -#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) -#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) -#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) -#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) -#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) -#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) -#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) - -#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) - -#endif /* GL_ARB_vertex_program */ - -/* -------------------------- GL_ARB_vertex_shader ------------------------- */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 - -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A - -typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); -typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); - -#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) -#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) -#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) - -#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) - -#endif /* GL_ARB_vertex_shader */ - -/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 - -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_INT_2_10_10_10_REV 0x8D9F - -typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); - -#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) -#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) -#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) -#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) -#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) -#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) -#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) -#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) -#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) -#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) -#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) -#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) -#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) -#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) -#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) -#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) -#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) -#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) -#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) -#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) -#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) -#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) -#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) -#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) -#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) -#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) -#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) -#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) -#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) -#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) -#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) -#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) -#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) -#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) -#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) -#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) -#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) -#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) - -#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) - -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -/* ------------------------- GL_ARB_viewport_array ------------------------- */ - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 - -#define GL_DEPTH_RANGE 0x0B70 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F - -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); -typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); -typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); -typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); -typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); -typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); - -#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) -#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) -#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) -#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) -#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) -#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) -#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) -#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) -#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) -#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) - -#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) - -#endif /* GL_ARB_viewport_array */ - -/* --------------------------- GL_ARB_window_pos --------------------------- */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 - -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); - -#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) -#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) -#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) -#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) -#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) -#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) -#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) -#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) -#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) -#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) -#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) -#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) -#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) -#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) -#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) -#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) - -#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) - -#endif /* GL_ARB_window_pos */ - -/* ------------------------- GL_ATIX_point_sprites ------------------------- */ - -#ifndef GL_ATIX_point_sprites -#define GL_ATIX_point_sprites 1 - -#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 -#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 -#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 -#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 -#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 -#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 - -#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) - -#endif /* GL_ATIX_point_sprites */ - -/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ - -#ifndef GL_ATIX_texture_env_combine3 -#define GL_ATIX_texture_env_combine3 1 - -#define GL_MODULATE_ADD_ATIX 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 -#define GL_MODULATE_SUBTRACT_ATIX 0x8746 - -#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) - -#endif /* GL_ATIX_texture_env_combine3 */ - -/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ - -#ifndef GL_ATIX_texture_env_route -#define GL_ATIX_texture_env_route 1 - -#define GL_SECONDARY_COLOR_ATIX 0x8747 -#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 -#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 - -#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) - -#endif /* GL_ATIX_texture_env_route */ - -/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ - -#ifndef GL_ATIX_vertex_shader_output_point_size -#define GL_ATIX_vertex_shader_output_point_size 1 - -#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E - -#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) - -#endif /* GL_ATIX_vertex_shader_output_point_size */ - -/* -------------------------- GL_ATI_draw_buffers -------------------------- */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 - -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 - -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); - -#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) - -#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) - -#endif /* GL_ATI_draw_buffers */ - -/* -------------------------- GL_ATI_element_array ------------------------- */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 - -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); - -#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) -#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) -#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) - -#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) - -#endif /* GL_ATI_element_array */ - -/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 - -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C - -typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); - -#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) -#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) -#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) -#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) - -#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) - -#endif /* GL_ATI_envmap_bumpmap */ - -/* ------------------------- GL_ATI_fragment_shader ------------------------ */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 - -#define GL_RED_BIT_ATI 0x00000001 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B - -typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); - -#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) -#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) -#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) -#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) -#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) -#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) -#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) -#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) -#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) -#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) -#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) -#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) -#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) -#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) - -#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) - -#endif /* GL_ATI_fragment_shader */ - -/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 - -typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); - -#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) -#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) - -#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) - -#endif /* GL_ATI_map_object_buffer */ - -/* ----------------------------- GL_ATI_meminfo ---------------------------- */ - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 - -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD - -#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) - -#endif /* GL_ATI_meminfo */ - -/* -------------------------- GL_ATI_pn_triangles -------------------------- */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 - -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 - -typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); - -#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) -#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) - -#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) - -#endif /* GL_ATI_pn_triangles */ - -/* ------------------------ GL_ATI_separate_stencil ------------------------ */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 - -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 - -typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); - -#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) -#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) - -#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) - -#endif /* GL_ATI_separate_stencil */ - -/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ - -#ifndef GL_ATI_shader_texture_lod -#define GL_ATI_shader_texture_lod 1 - -#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) - -#endif /* GL_ATI_shader_texture_lod */ - -/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 - -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 - -#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) - -#endif /* GL_ATI_text_fragment_shader */ - -/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ - -#ifndef GL_ATI_texture_compression_3dc -#define GL_ATI_texture_compression_3dc 1 - -#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 - -#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) - -#endif /* GL_ATI_texture_compression_3dc */ - -/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 - -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 - -#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) - -#endif /* GL_ATI_texture_env_combine3 */ - -/* -------------------------- GL_ATI_texture_float ------------------------- */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 - -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F - -#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) - -#endif /* GL_ATI_texture_float */ - -/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 - -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 - -#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) - -#endif /* GL_ATI_texture_mirror_once */ - -/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 - -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 - -typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); -typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); -typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); - -#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) -#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) -#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) -#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) -#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) -#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) -#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) -#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) -#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) -#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) -#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) -#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) - -#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) - -#endif /* GL_ATI_vertex_array_object */ - -/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); - -#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) -#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) -#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) - -#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) - -#endif /* GL_ATI_vertex_attrib_array_object */ - -/* ------------------------- GL_ATI_vertex_streams ------------------------- */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 - -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_SOURCE_ATI 0x876C -#define GL_VERTEX_STREAM0_ATI 0x876D -#define GL_VERTEX_STREAM1_ATI 0x876E -#define GL_VERTEX_STREAM2_ATI 0x876F -#define GL_VERTEX_STREAM3_ATI 0x8770 -#define GL_VERTEX_STREAM4_ATI 0x8771 -#define GL_VERTEX_STREAM5_ATI 0x8772 -#define GL_VERTEX_STREAM6_ATI 0x8773 -#define GL_VERTEX_STREAM7_ATI 0x8774 - -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); - -#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) -#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) -#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) -#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) -#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) -#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) -#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) -#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) -#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) -#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) -#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) -#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) -#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) -#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) -#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) -#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) -#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) -#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) -#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) -#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) -#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) -#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) -#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) -#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) -#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) -#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) -#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) -#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) -#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) -#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) -#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) -#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) -#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) -#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) -#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) -#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) -#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) -#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) -#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) -#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) -#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) -#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) -#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) -#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) -#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) - -#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) - -#endif /* GL_ATI_vertex_streams */ - -/* --------------------------- GL_EXT_422_pixels --------------------------- */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 - -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF - -#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) - -#endif /* GL_EXT_422_pixels */ - -/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ - -#ifndef GL_EXT_Cg_shader -#define GL_EXT_Cg_shader 1 - -#define GL_CG_VERTEX_SHADER_EXT 0x890E -#define GL_CG_FRAGMENT_SHADER_EXT 0x890F - -#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) - -#endif /* GL_EXT_Cg_shader */ - -/* ------------------------------ GL_EXT_abgr ------------------------------ */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 - -#define GL_ABGR_EXT 0x8000 - -#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) - -#endif /* GL_EXT_abgr */ - -/* ------------------------------ GL_EXT_bgra ------------------------------ */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 - -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 - -#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) - -#endif /* GL_EXT_bgra */ - -/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 - -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF - -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); - -#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) -#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) -#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) - -#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) - -#endif /* GL_EXT_bindable_uniform */ - -/* --------------------------- GL_EXT_blend_color -------------------------- */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 - -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 - -typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - -#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) - -#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) - -#endif /* GL_EXT_blend_color */ - -/* --------------------- GL_EXT_blend_equation_separate -------------------- */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 - -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); - -#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) - -#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) - -#endif /* GL_EXT_blend_equation_separate */ - -/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 - -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB - -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) - -#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) - -#endif /* GL_EXT_blend_func_separate */ - -/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 - -#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) - -#endif /* GL_EXT_blend_logic_op */ - -/* -------------------------- GL_EXT_blend_minmax -------------------------- */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 - -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); - -#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) - -#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) - -#endif /* GL_EXT_blend_minmax */ - -/* ------------------------- GL_EXT_blend_subtract ------------------------- */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 - -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B - -#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) - -#endif /* GL_EXT_blend_subtract */ - -/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 - -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 - -#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) - -#endif /* GL_EXT_clip_volume_hint */ - -/* ------------------------------ GL_EXT_cmyka ----------------------------- */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 - -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F - -#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) - -#endif /* GL_EXT_cmyka */ - -/* ------------------------- GL_EXT_color_subtable ------------------------- */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 - -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) -#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) - -#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) - -#endif /* GL_EXT_color_subtable */ - -/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 - -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 - -typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); - -#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) -#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) - -#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) - -#endif /* GL_EXT_compiled_vertex_array */ - -/* --------------------------- GL_EXT_convolution -------------------------- */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 - -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 - -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); - -#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) -#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) -#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) -#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) -#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) -#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) -#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) -#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) -#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) -#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) -#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) -#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) -#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) - -#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) - -#endif /* GL_EXT_convolution */ - -/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 - -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 - -typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); -typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); - -#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) -#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) - -#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) - -#endif /* GL_EXT_coordinate_frame */ - -/* -------------------------- GL_EXT_copy_texture -------------------------- */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 - -typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - -#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) -#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) -#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) -#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) -#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) - -#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) - -#endif /* GL_EXT_copy_texture */ - -/* --------------------------- GL_EXT_cull_vertex -------------------------- */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 - -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC - -typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); - -#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) -#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) - -#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) - -#endif /* GL_EXT_cull_vertex */ - -/* -------------------------- GL_EXT_debug_marker -------------------------- */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 - -typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); -typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); - -#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) -#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) -#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) - -#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) - -#endif /* GL_EXT_debug_marker */ - -/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 - -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 - -typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); - -#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) - -#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) - -#endif /* GL_EXT_depth_bounds_test */ - -/* ----------------------- GL_EXT_direct_state_access ---------------------- */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 - -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F - -typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); -typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); -typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); -typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); -typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); - -#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) -#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) -#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) -#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) -#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) -#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) -#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) -#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) -#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) -#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) -#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) -#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) -#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) -#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) -#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) -#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) -#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) -#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) -#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) -#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) -#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) -#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) -#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) -#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) -#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) -#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) -#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) -#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) -#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) -#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) -#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) -#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) -#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) -#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) -#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) -#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) -#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) -#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) -#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) -#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) -#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) -#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) -#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) -#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) -#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) -#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) -#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) -#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) -#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) -#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) -#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) -#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) -#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) -#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) -#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) -#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) -#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) -#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) -#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) -#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) -#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) -#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) -#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) -#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) -#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) -#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) -#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) -#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) -#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) -#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) -#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) -#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) -#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) -#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) -#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) -#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) -#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) -#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) -#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) -#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) -#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) -#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) -#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) -#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) -#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) -#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) -#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) -#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) -#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) -#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) -#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) -#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) -#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) -#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) -#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) -#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) -#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) -#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) -#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) -#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) -#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) -#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) -#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) -#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) -#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) -#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) -#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) -#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) -#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) -#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) -#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) -#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) -#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) -#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) -#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) -#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) -#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) -#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) -#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) -#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) -#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) -#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) -#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) -#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) -#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) -#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) -#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) -#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) -#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) -#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) -#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) -#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) -#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) -#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) -#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) -#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) -#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) -#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) -#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) -#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) -#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) -#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) -#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) -#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) -#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) -#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) -#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) -#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) -#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) -#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) -#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) -#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) -#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) -#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT) -#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT) -#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) -#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) -#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) -#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) -#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) -#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) -#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT) -#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT) -#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) -#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) -#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) -#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) -#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) -#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) -#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT) -#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT) -#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) -#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) -#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) -#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) -#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) -#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) -#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT) -#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT) -#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) -#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) -#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) -#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) -#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) -#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) -#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT) -#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) -#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT) -#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) -#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT) -#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) -#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT) -#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) -#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT) -#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) -#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT) -#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) -#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT) -#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) -#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT) -#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) -#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT) -#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) -#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) -#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) -#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) -#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) -#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) -#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) -#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) -#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) -#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) -#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) -#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) -#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) -#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) -#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) -#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) -#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) -#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) -#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) -#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) -#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) -#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) -#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) -#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) -#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) -#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) -#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) -#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) - -#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) - -#endif /* GL_EXT_direct_state_access */ - -/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 - -typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); -typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); -typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); - -#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) -#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) -#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) -#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) -#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) -#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) - -#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) - -#endif /* GL_EXT_draw_buffers2 */ - -/* ------------------------- GL_EXT_draw_instanced ------------------------- */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); - -#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) -#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) - -#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) - -#endif /* GL_EXT_draw_instanced */ - -/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 - -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 - -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); - -#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) - -#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) - -#endif /* GL_EXT_draw_range_elements */ - -/* ---------------------------- GL_EXT_fog_coord --------------------------- */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 - -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 - -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); - -#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) -#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) -#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) -#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) -#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) - -#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) - -#endif /* GL_EXT_fog_coord */ - -/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ - -#ifndef GL_EXT_fragment_lighting -#define GL_EXT_fragment_lighting 1 - -#define GL_FRAGMENT_LIGHTING_EXT 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 -#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 -#define GL_LIGHT_ENV_MODE_EXT 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B -#define GL_FRAGMENT_LIGHT0_EXT 0x840C -#define GL_FRAGMENT_LIGHT7_EXT 0x8413 - -typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); - -#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) -#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) -#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) -#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) -#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) -#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) -#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) -#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) -#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) -#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) -#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) -#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) -#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) -#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) -#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) -#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) -#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) -#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) - -#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) - -#endif /* GL_EXT_fragment_lighting */ - -/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 - -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA - -typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) - -#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) - -#endif /* GL_EXT_framebuffer_blit */ - -/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 - -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 - -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) - -#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) - -#endif /* GL_EXT_framebuffer_multisample */ - -/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 - -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB - -#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) - -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 - -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 - -typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); - -#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) -#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) -#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) -#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) -#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) -#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) -#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) -#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) -#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) -#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) -#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) -#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) -#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) -#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) -#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) -#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) -#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) - -#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) - -#endif /* GL_EXT_framebuffer_object */ - -/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 - -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA - -#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) - -#endif /* GL_EXT_framebuffer_sRGB */ - -/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 - -#define GL_LINES_ADJACENCY_EXT 0xA -#define GL_LINE_STRIP_ADJACENCY_EXT 0xB -#define GL_TRIANGLES_ADJACENCY_EXT 0xC -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); - -#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) -#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) -#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) - -#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) - -#endif /* GL_EXT_geometry_shader4 */ - -/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 - -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); - -#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) -#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) - -#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) - -#endif /* GL_EXT_gpu_program_parameters */ - -/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 - -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 - -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - -#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) -#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) -#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) -#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) -#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) -#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) -#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) -#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) -#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) -#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) -#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) -#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) -#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) -#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) -#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) -#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) -#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) -#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) -#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) -#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) -#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) -#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) -#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) -#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) -#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) -#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) -#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) -#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) -#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) -#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) -#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) -#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) -#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) -#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) - -#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) - -#endif /* GL_EXT_gpu_shader4 */ - -/* ---------------------------- GL_EXT_histogram --------------------------- */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 - -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 - -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); - -#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) -#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) -#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) -#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) -#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) -#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) -#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) -#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) -#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) -#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) - -#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) - -#endif /* GL_EXT_histogram */ - -/* ----------------------- GL_EXT_index_array_formats ---------------------- */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 - -#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) - -#endif /* GL_EXT_index_array_formats */ - -/* --------------------------- GL_EXT_index_func --------------------------- */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 - -typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); - -#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) - -#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) - -#endif /* GL_EXT_index_func */ - -/* ------------------------- GL_EXT_index_material ------------------------- */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 - -typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); - -#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) - -#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) - -#endif /* GL_EXT_index_material */ - -/* -------------------------- GL_EXT_index_texture ------------------------- */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 - -#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) - -#endif /* GL_EXT_index_texture */ - -/* -------------------------- GL_EXT_light_texture ------------------------- */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 - -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 - -typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); - -#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) -#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) -#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) - -#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) - -#endif /* GL_EXT_light_texture */ - -/* ------------------------- GL_EXT_misc_attribute ------------------------- */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 - -#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) - -#endif /* GL_EXT_misc_attribute */ - -/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); - -#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) -#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) - -#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) - -#endif /* GL_EXT_multi_draw_arrays */ - -/* --------------------------- GL_EXT_multisample -------------------------- */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 - -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 - -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); - -#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) -#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) - -#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) - -#endif /* GL_EXT_multisample */ - -/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 - -#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) - -#endif /* GL_EXT_packed_depth_stencil */ - -/* -------------------------- GL_EXT_packed_float -------------------------- */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 - -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C - -#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) - -#endif /* GL_EXT_packed_float */ - -/* -------------------------- GL_EXT_packed_pixels ------------------------- */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 - -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 - -#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) - -#endif /* GL_EXT_packed_pixels */ - -/* ------------------------ GL_EXT_paletted_texture ------------------------ */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 - -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B - -typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); - -#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) -#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) -#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) -#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) - -#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) - -#endif /* GL_EXT_paletted_texture */ - -/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 - -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF - -#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) - -#endif /* GL_EXT_pixel_buffer_object */ - -/* ------------------------- GL_EXT_pixel_transform ------------------------ */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 - -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 - -typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) -#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) -#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) -#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) -#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) -#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) - -#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) - -#endif /* GL_EXT_pixel_transform */ - -/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 - -#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) - -#endif /* GL_EXT_pixel_transform_color_table */ - -/* ------------------------ GL_EXT_point_parameters ------------------------ */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 - -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); - -#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) -#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) - -#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) - -#endif /* GL_EXT_point_parameters */ - -/* ------------------------- GL_EXT_polygon_offset ------------------------- */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 - -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 - -typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); - -#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) - -#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) - -#endif /* GL_EXT_polygon_offset */ - -/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 - -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F - -typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); - -#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) - -#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) - -#endif /* GL_EXT_provoking_vertex */ - -/* ------------------------- GL_EXT_rescale_normal ------------------------- */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 - -#define GL_RESCALE_NORMAL_EXT 0x803A - -#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) - -#endif /* GL_EXT_rescale_normal */ - -/* -------------------------- GL_EXT_scene_marker -------------------------- */ - -#ifndef GL_EXT_scene_marker -#define GL_EXT_scene_marker 1 - -typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); - -#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) -#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) - -#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) - -#endif /* GL_EXT_scene_marker */ - -/* ------------------------- GL_EXT_secondary_color ------------------------ */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 - -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E - -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - -#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) -#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) -#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) -#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) -#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) -#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) -#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) -#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) -#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) -#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) -#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) -#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) -#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) -#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) -#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) -#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) -#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) - -#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) - -#endif /* GL_EXT_secondary_color */ - -/* --------------------- GL_EXT_separate_shader_objects -------------------- */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 - -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D - -typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); -typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); - -#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) -#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) -#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) - -#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) - -#endif /* GL_EXT_separate_shader_objects */ - -/* --------------------- GL_EXT_separate_specular_color -------------------- */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 - -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA - -#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) - -#endif /* GL_EXT_separate_specular_color */ - -/* --------------------- GL_EXT_shader_image_load_store -------------------- */ - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 - -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); - -#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) -#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) - -#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) - -#endif /* GL_EXT_shader_image_load_store */ - -/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 - -#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) - -#endif /* GL_EXT_shadow_funcs */ - -/* --------------------- GL_EXT_shared_texture_palette --------------------- */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 - -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB - -#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) - -#endif /* GL_EXT_shared_texture_palette */ - -/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 - -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 - -#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) - -#endif /* GL_EXT_stencil_clear_tag */ - -/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 - -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 - -typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); - -#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) - -#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) - -#endif /* GL_EXT_stencil_two_side */ - -/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 - -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) - -#endif /* GL_EXT_stencil_wrap */ - -/* --------------------------- GL_EXT_subtexture --------------------------- */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 - -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); - -#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) -#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) -#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) - -#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) - -#endif /* GL_EXT_subtexture */ - -/* ----------------------------- GL_EXT_texture ---------------------------- */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 - -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 - -#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) - -#endif /* GL_EXT_texture */ - -/* ---------------------------- GL_EXT_texture3D --------------------------- */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 - -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); - -#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) - -#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) - -#endif /* GL_EXT_texture3D */ - -/* -------------------------- GL_EXT_texture_array ------------------------- */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 - -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); - -#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) - -#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) - -#endif /* GL_EXT_texture_array */ - -/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 - -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E - -typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); - -#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) - -#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) - -#endif /* GL_EXT_texture_buffer_object */ - -/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ - -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 - -#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) - -#endif /* GL_EXT_texture_compression_dxt1 */ - -/* -------------------- GL_EXT_texture_compression_latc -------------------- */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 - -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 - -#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) - -#endif /* GL_EXT_texture_compression_latc */ - -/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 - -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE - -#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) - -#endif /* GL_EXT_texture_compression_rgtc */ - -/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 - -#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) - -#endif /* GL_EXT_texture_compression_s3tc */ - -/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 - -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C - -#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) - -#endif /* GL_EXT_texture_cube_map */ - -/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ - -#ifndef GL_EXT_texture_edge_clamp -#define GL_EXT_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_EXT 0x812F - -#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) - -#endif /* GL_EXT_texture_edge_clamp */ - -/* --------------------------- GL_EXT_texture_env -------------------------- */ - -#ifndef GL_EXT_texture_env -#define GL_EXT_texture_env 1 - -#define GL_TEXTURE_ENV0_EXT 0 -#define GL_ENV_BLEND_EXT 0 -#define GL_TEXTURE_ENV_SHIFT_EXT 0 -#define GL_ENV_REPLACE_EXT 0 -#define GL_ENV_ADD_EXT 0 -#define GL_ENV_SUBTRACT_EXT 0 -#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 -#define GL_ENV_REVERSE_SUBTRACT_EXT 0 -#define GL_ENV_REVERSE_BLEND_EXT 0 -#define GL_ENV_COPY_EXT 0 -#define GL_ENV_MODULATE_EXT 0 - -#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) - -#endif /* GL_EXT_texture_env */ - -/* ------------------------- GL_EXT_texture_env_add ------------------------ */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 - -#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) - -#endif /* GL_EXT_texture_env_add */ - -/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 - -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A - -#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) - -#endif /* GL_EXT_texture_env_combine */ - -/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 - -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 - -#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) - -#endif /* GL_EXT_texture_env_dot3 */ - -/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 - -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF - -#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) - -#endif /* GL_EXT_texture_filter_anisotropic */ - -/* ------------------------- GL_EXT_texture_integer ------------------------ */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 - -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E - -typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); - -#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) -#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) -#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) -#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) -#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) -#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) - -#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) - -#endif /* GL_EXT_texture_integer */ - -/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 - -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 - -#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) - -#endif /* GL_EXT_texture_lod_bias */ - -/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 - -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 - -#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) - -#endif /* GL_EXT_texture_mirror_clamp */ - -/* ------------------------- GL_EXT_texture_object ------------------------- */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 - -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A - -typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); -typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); -typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); -typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); - -#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) -#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) -#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) -#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) -#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) -#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) - -#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) - -#endif /* GL_EXT_texture_object */ - -/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 - -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF - -typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); - -#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) - -#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) - -#endif /* GL_EXT_texture_perturb_normal */ - -/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ - -#ifndef GL_EXT_texture_rectangle -#define GL_EXT_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 - -#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) - -#endif /* GL_EXT_texture_rectangle */ - -/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 - -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F - -#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) - -#endif /* GL_EXT_texture_sRGB */ - -/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 - -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A - -#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) - -#endif /* GL_EXT_texture_sRGB_decode */ - -/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 - -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F - -#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) - -#endif /* GL_EXT_texture_shared_exponent */ - -/* -------------------------- GL_EXT_texture_snorm ------------------------- */ - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 - -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B - -#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) - -#endif /* GL_EXT_texture_snorm */ - -/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 - -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 - -#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) - -#endif /* GL_EXT_texture_swizzle */ - -/* --------------------------- GL_EXT_timer_query -------------------------- */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 - -#define GL_TIME_ELAPSED_EXT 0x88BF - -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); - -#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) -#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) - -#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) - -#endif /* GL_EXT_timer_query */ - -/* ----------------------- GL_EXT_transform_feedback ----------------------- */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 - -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F - -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar ** varyings, GLenum bufferMode); - -#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) -#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) -#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) -#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) -#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) -#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) -#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) - -#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) - -#endif /* GL_EXT_transform_feedback */ - -/* -------------------------- GL_EXT_vertex_array -------------------------- */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 - -#define GL_DOUBLE_EXT 0x140A -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 - -typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); - -#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) -#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) -#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) -#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) -#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) -#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) -#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) -#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) - -#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) - -#endif /* GL_EXT_vertex_array */ - -/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 - -#define GL_BGRA 0x80E1 - -#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) - -#endif /* GL_EXT_vertex_array_bgra */ - -/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 - -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); - -#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) -#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) -#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) -#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) -#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) -#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) -#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) -#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) -#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) -#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) -#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) - -#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) - -#endif /* GL_EXT_vertex_attrib_64bit */ - -/* -------------------------- GL_EXT_vertex_shader ------------------------- */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 - -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED - -typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); -typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); -typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); -typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); -typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); -typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); - -#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) -#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) -#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) -#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) -#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) -#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) -#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) -#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) -#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) -#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) -#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) -#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) -#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) -#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) -#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) -#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) -#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) -#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) -#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) -#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) -#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) -#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) -#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) -#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) -#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) -#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) -#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) -#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) -#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) -#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) -#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) -#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) -#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) -#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) -#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) -#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) -#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) -#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) -#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) -#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) -#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) -#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) - -#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) - -#endif /* GL_EXT_vertex_shader */ - -/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 - -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 - -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); - -#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) -#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) -#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) - -#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) - -#endif /* GL_EXT_vertex_weighting */ - -/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 - -#define GL_SYNC_X11_FENCE_EXT 0x90E1 - -typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); - -#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) - -#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) - -#endif /* GL_EXT_x11_sync_object */ - -/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 - -typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); - -#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) - -#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) - -#endif /* GL_GREMEDY_frame_terminator */ - -/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 - -typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); - -#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) - -#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) - -#endif /* GL_GREMEDY_string_marker */ - -/* --------------------- GL_HP_convolution_border_modes -------------------- */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 - -#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) - -#endif /* GL_HP_convolution_border_modes */ - -/* ------------------------- GL_HP_image_transform ------------------------- */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 - -typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) -#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) -#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) -#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) -#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) -#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) - -#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) - -#endif /* GL_HP_image_transform */ - -/* -------------------------- GL_HP_occlusion_test ------------------------- */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 - -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 - -#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) - -#endif /* GL_HP_occlusion_test */ - -/* ------------------------- GL_HP_texture_lighting ------------------------ */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 - -#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) - -#endif /* GL_HP_texture_lighting */ - -/* --------------------------- GL_IBM_cull_vertex -------------------------- */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 - -#define GL_CULL_VERTEX_IBM 103050 - -#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) - -#endif /* GL_IBM_cull_vertex */ - -/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 - -typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); - -#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) -#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) - -#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) - -#endif /* GL_IBM_multimode_draw_arrays */ - -/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 - -#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 - -#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) - -#endif /* GL_IBM_rasterpos_clip */ - -/* --------------------------- GL_IBM_static_data -------------------------- */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 - -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 - -#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) - -#endif /* GL_IBM_static_data */ - -/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 - -#define GL_MIRRORED_REPEAT_IBM 0x8370 - -#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) - -#endif /* GL_IBM_texture_mirrored_repeat */ - -/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 - -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 - -typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); - -#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) -#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) -#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) -#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) -#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) -#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) -#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) -#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) - -#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) - -#endif /* GL_IBM_vertex_array_lists */ - -/* -------------------------- GL_INGR_color_clamp -------------------------- */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 - -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 - -#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) - -#endif /* GL_INGR_color_clamp */ - -/* ------------------------- GL_INGR_interlace_read ------------------------ */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 - -#define GL_INTERLACE_READ_INGR 0x8568 - -#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) - -#endif /* GL_INGR_interlace_read */ - -/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 - -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 - -typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); - -#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) -#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) -#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) -#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) - -#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) - -#endif /* GL_INTEL_parallel_arrays */ - -/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ - -#ifndef GL_INTEL_texture_scissor -#define GL_INTEL_texture_scissor 1 - -typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); -typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); - -#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) -#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) - -#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) - -#endif /* GL_INTEL_texture_scissor */ - -/* ------------------------------ GL_KHR_debug ----------------------------- */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 - -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_DISPLAY_LIST 0x82E7 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_OUTPUT 0x92E0 - -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, void* userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); -typedef void (GLAPIENTRY * PFNGLGETPOINTERVPROC) (GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); -typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); - -#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) -#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) -#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) -#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) -#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) -#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) -#define glGetPointerv GLEW_GET_FUN(__glewGetPointerv) -#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) -#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) -#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) - -#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) - -#endif /* GL_KHR_debug */ - -/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 - -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD - -#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) - -#endif /* GL_KHR_texture_compression_astc_ldr */ - -/* -------------------------- GL_KTX_buffer_region ------------------------- */ - -#ifndef GL_KTX_buffer_region -#define GL_KTX_buffer_region 1 - -#define GL_KTX_FRONT_REGION 0x0 -#define GL_KTX_BACK_REGION 0x1 -#define GL_KTX_Z_REGION 0x2 -#define GL_KTX_STENCIL_REGION 0x3 - -typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); -typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); - -#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) -#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) -#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) -#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) -#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) - -#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) - -#endif /* GL_KTX_buffer_region */ - -/* ------------------------- GL_MESAX_texture_stack ------------------------ */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 - -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E - -#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) - -#endif /* GL_MESAX_texture_stack */ - -/* -------------------------- GL_MESA_pack_invert -------------------------- */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 - -#define GL_PACK_INVERT_MESA 0x8758 - -#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) - -#endif /* GL_MESA_pack_invert */ - -/* ------------------------- GL_MESA_resize_buffers ------------------------ */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 - -typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); - -#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) - -#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) - -#endif /* GL_MESA_resize_buffers */ - -/* --------------------------- GL_MESA_window_pos -------------------------- */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 - -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); - -#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) -#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) -#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) -#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) -#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) -#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) -#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) -#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) -#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) -#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) -#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) -#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) -#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) -#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) -#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) -#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) -#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) -#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) -#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) -#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) -#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) -#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) -#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) -#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) - -#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) - -#endif /* GL_MESA_window_pos */ - -/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 - -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 - -#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) - -#endif /* GL_MESA_ycbcr_texture */ - -/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ - -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 - -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B - -#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) - -#endif /* GL_NVX_gpu_memory_info */ - -/* ------------------------- GL_NV_bindless_texture ------------------------ */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 - -typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); - -#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) -#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) -#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) -#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) -#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) -#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) -#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) -#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) -#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) -#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) -#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) -#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) -#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) - -#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) - -#endif /* GL_NV_bindless_texture */ - -/* --------------------------- GL_NV_blend_square -------------------------- */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 - -#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) - -#endif /* GL_NV_blend_square */ - -/* ------------------------ GL_NV_conditional_render ----------------------- */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 - -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 - -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); - -#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) -#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) - -#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) - -#endif /* GL_NV_conditional_render */ - -/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 - -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F - -#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) - -#endif /* GL_NV_copy_depth_to_color */ - -/* ---------------------------- GL_NV_copy_image --------------------------- */ - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 - -typedef void (GLAPIENTRY * 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); - -#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) - -#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) - -#endif /* GL_NV_copy_image */ - -/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 - -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); - -#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) -#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) -#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) - -#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) - -#endif /* GL_NV_depth_buffer_float */ - -/* --------------------------- GL_NV_depth_clamp --------------------------- */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 - -#define GL_DEPTH_CLAMP_NV 0x864F - -#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) - -#endif /* GL_NV_depth_clamp */ - -/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ - -#ifndef GL_NV_depth_range_unclamped -#define GL_NV_depth_range_unclamped 1 - -#define GL_SAMPLE_COUNT_BITS_NV 0x8864 -#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 -#define GL_QUERY_RESULT_NV 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 -#define GL_SAMPLE_COUNT_NV 0x8914 - -#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) - -#endif /* GL_NV_depth_range_unclamped */ - -/* ---------------------------- GL_NV_evaluators --------------------------- */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 - -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 - -typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); -typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); -typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) -#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) -#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) -#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) -#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) -#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) -#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) -#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) -#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) - -#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) - -#endif /* GL_NV_evaluators */ - -/* ----------------------- GL_NV_explicit_multisample ---------------------- */ - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 - -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 - -typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); - -#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) -#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) -#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) - -#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) - -#endif /* GL_NV_explicit_multisample */ - -/* ------------------------------ GL_NV_fence ------------------------------ */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 - -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 - -typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); -typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); -typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); - -#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) -#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) -#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) -#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) -#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) -#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) -#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) - -#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) - -#endif /* GL_NV_fence */ - -/* --------------------------- GL_NV_float_buffer -------------------------- */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 - -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E - -#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) - -#endif /* GL_NV_float_buffer */ - -/* --------------------------- GL_NV_fog_distance -------------------------- */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 - -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C - -#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) - -#endif /* GL_NV_fog_distance */ - -/* ------------------------- GL_NV_fragment_program ------------------------ */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 - -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); - -#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) -#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) -#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) -#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) -#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) -#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) - -#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) - -#endif /* GL_NV_fragment_program */ - -/* ------------------------ GL_NV_fragment_program2 ------------------------ */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 - -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 - -#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) - -#endif /* GL_NV_fragment_program2 */ - -/* ------------------------ GL_NV_fragment_program4 ------------------------ */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 - -#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) - -#endif /* GL_NV_fragment_program4 */ - -/* --------------------- GL_NV_fragment_program_option --------------------- */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 - -#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) - -#endif /* GL_NV_fragment_program_option */ - -/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 - -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 - -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) - -#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) - -#endif /* GL_NV_framebuffer_multisample_coverage */ - -/* ------------------------ GL_NV_geometry_program4 ------------------------ */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 - -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 - -typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); - -#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) - -#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) - -#endif /* GL_NV_geometry_program4 */ - -/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 - -#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) - -#endif /* GL_NV_geometry_shader4 */ - -/* --------------------------- GL_NV_gpu_program4 -------------------------- */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 - -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 - -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); - -#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) -#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) -#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) -#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) -#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) -#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) -#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) -#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) -#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) -#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) -#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) -#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) - -#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) - -#endif /* GL_NV_gpu_program4 */ - -/* --------------------------- GL_NV_gpu_program5 -------------------------- */ - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 - -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F - -#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) - -#endif /* GL_NV_gpu_program5 */ - -/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ - -#ifndef GL_NV_gpu_program_fp64 -#define GL_NV_gpu_program_fp64 1 - -#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) - -#endif /* GL_NV_gpu_program_fp64 */ - -/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 - -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB - -typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); - -#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) -#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) -#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) -#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) -#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) -#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) -#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) -#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) -#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) -#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) -#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) -#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) -#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) -#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) -#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) -#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) -#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) -#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) -#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) -#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) -#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) -#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) -#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) -#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) -#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) -#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) -#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) -#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) -#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) -#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) -#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) -#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) -#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) -#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) - -#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) - -#endif /* GL_NV_gpu_shader5 */ - -/* ---------------------------- GL_NV_half_float --------------------------- */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 - -#define GL_HALF_FLOAT_NV 0x140B - -typedef unsigned short GLhalf; - -typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); -typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); -typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); -typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); -typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); -typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); -typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); -typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); -typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); -typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); - -#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) -#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) -#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) -#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) -#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) -#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) -#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) -#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) -#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) -#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) -#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) -#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) -#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) -#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) -#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) -#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) -#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) -#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) -#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) -#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) -#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) -#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) -#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) -#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) -#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) -#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) -#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) -#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) -#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) -#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) -#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) -#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) -#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) -#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) -#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) -#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) -#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) -#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) -#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) -#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) -#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) -#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) -#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) -#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) -#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) -#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) - -#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) - -#endif /* GL_NV_half_float */ - -/* ------------------------ GL_NV_light_max_exponent ----------------------- */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 - -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 - -#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) - -#endif /* GL_NV_light_max_exponent */ - -/* ----------------------- GL_NV_multisample_coverage ---------------------- */ - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 - -#define GL_COVERAGE_SAMPLES_NV 0x80A9 -#define GL_COLOR_SAMPLES_NV 0x8E20 - -#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) - -#endif /* GL_NV_multisample_coverage */ - -/* --------------------- GL_NV_multisample_filter_hint --------------------- */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 - -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 - -#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) - -#endif /* GL_NV_multisample_filter_hint */ - -/* ------------------------- GL_NV_occlusion_query ------------------------- */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 - -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 - -typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); - -#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) -#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) -#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) -#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) -#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) -#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) -#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) - -#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) - -#endif /* GL_NV_occlusion_query */ - -/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA - -#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) - -#endif /* GL_NV_packed_depth_stencil */ - -/* --------------------- GL_NV_parameter_buffer_object --------------------- */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 - -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 - -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); - -#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) -#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) -#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) - -#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) - -#endif /* GL_NV_parameter_buffer_object */ - -/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 - -#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) - -#endif /* GL_NV_parameter_buffer_object2 */ - -/* -------------------------- GL_NV_path_rendering ------------------------- */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 - -#define GL_CLOSE_PATH_NV 0x00 -#define GL_BOLD_BIT_NV 0x01 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 - -typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); -typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); -typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); -typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); -typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); -typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); -typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); -typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); -typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); -typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); -typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); -typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); -typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); -typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); -typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); -typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); -typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); -typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); -typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); - -#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) -#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) -#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) -#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) -#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) -#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) -#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) -#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) -#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) -#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) -#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) -#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) -#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) -#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) -#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) -#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) -#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) -#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) -#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) -#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) -#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) -#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) -#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) -#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) -#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) -#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) -#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) -#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) -#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) -#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) -#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) -#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) -#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) -#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) -#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) -#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) -#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) -#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) -#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) -#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) -#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) -#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) -#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) -#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) -#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) -#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) -#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) -#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) -#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) - -#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) - -#endif /* GL_NV_path_rendering */ - -/* ------------------------- GL_NV_pixel_data_range ------------------------ */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 - -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D - -typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); - -#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) -#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) - -#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) - -#endif /* GL_NV_pixel_data_range */ - -/* --------------------------- GL_NV_point_sprite -------------------------- */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 - -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); - -#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) -#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) - -#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) - -#endif /* GL_NV_point_sprite */ - -/* -------------------------- GL_NV_present_video -------------------------- */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 - -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B - -typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); - -#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) -#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) -#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) -#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) -#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) -#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) - -#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) - -#endif /* GL_NV_present_video */ - -/* ------------------------ GL_NV_primitive_restart ------------------------ */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 - -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 - -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); - -#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) -#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) - -#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) - -#endif /* GL_NV_primitive_restart */ - -/* ------------------------ GL_NV_register_combiners ----------------------- */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 - -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 - -typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); - -#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) -#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) -#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) -#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) -#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) -#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) -#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) -#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) -#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) -#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) -#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) -#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) -#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) - -#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) - -#endif /* GL_NV_register_combiners */ - -/* ----------------------- GL_NV_register_combiners2 ----------------------- */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 - -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 - -typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); - -#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) -#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) - -#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) - -#endif /* GL_NV_register_combiners2 */ - -/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 - -#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) - -#endif /* GL_NV_shader_atomic_float */ - -/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 - -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 - -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); - -#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) -#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) -#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) -#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) -#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) -#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) -#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) -#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) -#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) -#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) -#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) -#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) -#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) - -#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) - -#endif /* GL_NV_shader_buffer_load */ - -/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 - -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 - -#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) - -#endif /* GL_NV_tessellation_program5 */ - -/* -------------------------- GL_NV_texgen_emboss -------------------------- */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 - -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F - -#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) - -#endif /* GL_NV_texgen_emboss */ - -/* ------------------------ GL_NV_texgen_reflection ------------------------ */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 - -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 - -#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) - -#endif /* GL_NV_texgen_reflection */ - -/* ------------------------- GL_NV_texture_barrier ------------------------- */ - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 - -typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); - -#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) - -#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) - -#endif /* GL_NV_texture_barrier */ - -/* --------------------- GL_NV_texture_compression_vtc --------------------- */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 - -#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) - -#endif /* GL_NV_texture_compression_vtc */ - -/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 - -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B - -#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) - -#endif /* GL_NV_texture_env_combine4 */ - -/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 - -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F - -#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) - -#endif /* GL_NV_texture_expand_normal */ - -/* ----------------------- GL_NV_texture_multisample ----------------------- */ - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 - -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); - -#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) -#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) -#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) -#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) -#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) -#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) - -#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) - -#endif /* GL_NV_texture_multisample */ - -/* ------------------------ GL_NV_texture_rectangle ------------------------ */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 - -#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) - -#endif /* GL_NV_texture_rectangle */ - -/* -------------------------- GL_NV_texture_shader ------------------------- */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 - -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F - -#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) - -#endif /* GL_NV_texture_shader */ - -/* ------------------------- GL_NV_texture_shader2 ------------------------- */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 - -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D - -#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) - -#endif /* GL_NV_texture_shader2 */ - -/* ------------------------- GL_NV_texture_shader3 ------------------------- */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 - -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 - -#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) - -#endif /* GL_NV_texture_shader3 */ - -/* ------------------------ GL_NV_transform_feedback ----------------------- */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 - -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F - -typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); - -#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) -#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) -#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) -#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) -#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) -#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) -#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) -#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) -#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) -#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) -#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) - -#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) - -#endif /* GL_NV_transform_feedback */ - -/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 - -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 - -typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); -typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); - -#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) -#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) -#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) -#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) -#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) -#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) -#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) - -#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) - -#endif /* GL_NV_transform_feedback2 */ - -/* -------------------------- GL_NV_vdpau_interop -------------------------- */ - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 - -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE - -typedef GLintptr GLvdpauSurfaceNV; - -typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); -typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); -typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); -typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); -typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); -typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); - -#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) -#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) -#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) -#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) -#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) -#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) -#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) -#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) -#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) -#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) - -#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) - -#endif /* GL_NV_vdpau_interop */ - -/* ------------------------ GL_NV_vertex_array_range ----------------------- */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 - -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 - -typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); - -#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) -#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) - -#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) - -#endif /* GL_NV_vertex_array_range */ - -/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 - -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 - -#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) - -#endif /* GL_NV_vertex_array_range2 */ - -/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 - -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); - -#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) -#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) -#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) -#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) -#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) -#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) -#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) -#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) -#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) -#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) -#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) -#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) -#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) -#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) -#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) -#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) -#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) -#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) -#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) - -#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) - -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 - -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 - -typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); -typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); - -#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) -#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) -#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) -#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) -#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) -#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) -#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) -#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) -#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) -#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) -#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) -#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) - -#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) - -#endif /* GL_NV_vertex_buffer_unified_memory */ - -/* -------------------------- GL_NV_vertex_program ------------------------- */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 - -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F - -typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); - -#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) -#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) -#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) -#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) -#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) -#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) -#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) -#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) -#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) -#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) -#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) -#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) -#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) -#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) -#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) -#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) -#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) -#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) -#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) -#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) -#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) -#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) -#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) -#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) -#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) -#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) -#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) -#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) -#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) -#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) -#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) -#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) -#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) -#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) -#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) -#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) -#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) -#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) -#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) -#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) -#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) -#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) -#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) -#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) -#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) -#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) -#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) -#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) -#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) -#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) -#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) -#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) -#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) -#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) -#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) -#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) -#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) -#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) -#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) -#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) -#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) -#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) -#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) -#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) - -#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) - -#endif /* GL_NV_vertex_program */ - -/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 - -#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) - -#endif /* GL_NV_vertex_program1_1 */ - -/* ------------------------- GL_NV_vertex_program2 ------------------------- */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 - -#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) - -#endif /* GL_NV_vertex_program2 */ - -/* ---------------------- GL_NV_vertex_program2_option --------------------- */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 - -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 - -#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) - -#endif /* GL_NV_vertex_program2_option */ - -/* ------------------------- GL_NV_vertex_program3 ------------------------- */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 - -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C - -#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) - -#endif /* GL_NV_vertex_program3 */ - -/* ------------------------- GL_NV_vertex_program4 ------------------------- */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 - -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD - -#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) - -#endif /* GL_NV_vertex_program4 */ - -/* -------------------------- GL_NV_video_capture -------------------------- */ - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 - -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C - -typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); -typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); - -#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) -#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) -#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) -#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) -#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) -#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) -#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) -#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) -#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) -#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) -#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) -#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) - -#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) - -#endif /* GL_NV_video_capture */ - -/* ------------------------ GL_OES_byte_coordinates ------------------------ */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 - -#define GL_BYTE 0x1400 - -#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) - -#endif /* GL_OES_byte_coordinates */ - -/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 - -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 - -#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) - -#endif /* GL_OES_compressed_paletted_texture */ - -/* --------------------------- GL_OES_read_format -------------------------- */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 - -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B - -#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) - -#endif /* GL_OES_read_format */ - -/* ------------------------ GL_OES_single_precision ------------------------ */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); -typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); - -#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) -#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) -#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) -#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) -#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) -#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) - -#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) - -#endif /* GL_OES_single_precision */ - -/* ---------------------------- GL_OML_interlace --------------------------- */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 - -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 - -#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) - -#endif /* GL_OML_interlace */ - -/* ---------------------------- GL_OML_resample ---------------------------- */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 - -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 - -#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) - -#endif /* GL_OML_resample */ - -/* ---------------------------- GL_OML_subsample --------------------------- */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 - -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 - -#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) - -#endif /* GL_OML_subsample */ - -/* --------------------------- GL_PGI_misc_hints --------------------------- */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 - -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 - -#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) - -#endif /* GL_PGI_misc_hints */ - -/* -------------------------- GL_PGI_vertex_hints -------------------------- */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 - -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_VERTEX_DATA_HINT_PGI 107050 -#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 -#define GL_MATERIAL_SIDE_HINT_PGI 107052 -#define GL_MAX_VERTEX_HINT_PGI 107053 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 - -#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) - -#endif /* GL_PGI_vertex_hints */ - -/* ------------------------- GL_REGAL_error_string ------------------------- */ - -#ifndef GL_REGAL_error_string -#define GL_REGAL_error_string 1 - -typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); - -#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) - -#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) - -#endif /* GL_REGAL_error_string */ - -/* ------------------------ GL_REGAL_extension_query ----------------------- */ - -#ifndef GL_REGAL_extension_query -#define GL_REGAL_extension_query 1 - -typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); -typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); - -#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) -#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) - -#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) - -#endif /* GL_REGAL_extension_query */ - -/* ------------------------------ GL_REGAL_log ----------------------------- */ - -#ifndef GL_REGAL_log -#define GL_REGAL_log 1 - -#define GL_LOG_ERROR_REGAL 0x9319 -#define GL_LOG_WARNING_REGAL 0x931A -#define GL_LOG_INFO_REGAL 0x931B -#define GL_LOG_APP_REGAL 0x931C -#define GL_LOG_DRIVER_REGAL 0x931D -#define GL_LOG_INTERNAL_REGAL 0x931E -#define GL_LOG_DEBUG_REGAL 0x931F -#define GL_LOG_STATUS_REGAL 0x9320 -#define GL_LOG_HTTP_REGAL 0x9321 - -#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) - -#endif /* GL_REGAL_log */ - -/* ----------------------- GL_REND_screen_coordinates ---------------------- */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 - -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 - -#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) - -#endif /* GL_REND_screen_coordinates */ - -/* ------------------------------- GL_S3_s3tc ------------------------------ */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 - -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 - -#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) - -#endif /* GL_S3_s3tc */ - -/* -------------------------- GL_SGIS_color_range -------------------------- */ - -#ifndef GL_SGIS_color_range -#define GL_SGIS_color_range 1 - -#define GL_EXTENDED_RANGE_SGIS 0x85A5 -#define GL_MIN_RED_SGIS 0x85A6 -#define GL_MAX_RED_SGIS 0x85A7 -#define GL_MIN_GREEN_SGIS 0x85A8 -#define GL_MAX_GREEN_SGIS 0x85A9 -#define GL_MIN_BLUE_SGIS 0x85AA -#define GL_MAX_BLUE_SGIS 0x85AB -#define GL_MIN_ALPHA_SGIS 0x85AC -#define GL_MAX_ALPHA_SGIS 0x85AD - -#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) - -#endif /* GL_SGIS_color_range */ - -/* ------------------------- GL_SGIS_detail_texture ------------------------ */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 - -typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); - -#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) -#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) - -#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) - -#endif /* GL_SGIS_detail_texture */ - -/* -------------------------- GL_SGIS_fog_function ------------------------- */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 - -typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); - -#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) -#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) - -#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) - -#endif /* GL_SGIS_fog_function */ - -/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 - -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 - -#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) - -#endif /* GL_SGIS_generate_mipmap */ - -/* -------------------------- GL_SGIS_multisample -------------------------- */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 - -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC - -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); - -#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) -#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) - -#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) - -#endif /* GL_SGIS_multisample */ - -/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 - -#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) - -#endif /* GL_SGIS_pixel_texture */ - -/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 - -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 - -#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) - -#endif /* GL_SGIS_point_line_texgen */ - -/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 - -typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); -typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); - -#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) -#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) - -#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) - -#endif /* GL_SGIS_sharpen_texture */ - -/* --------------------------- GL_SGIS_texture4D --------------------------- */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); - -#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) -#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) - -#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) - -#endif /* GL_SGIS_texture4D */ - -/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 - -#define GL_CLAMP_TO_BORDER_SGIS 0x812D - -#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) - -#endif /* GL_SGIS_texture_border_clamp */ - -/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) - -#endif /* GL_SGIS_texture_edge_clamp */ - -/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 - -typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); -typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); - -#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) -#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) - -#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) - -#endif /* GL_SGIS_texture_filter4 */ - -/* -------------------------- GL_SGIS_texture_lod -------------------------- */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 - -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D - -#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) - -#endif /* GL_SGIS_texture_lod */ - -/* ------------------------- GL_SGIS_texture_select ------------------------ */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 - -#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) - -#endif /* GL_SGIS_texture_select */ - -/* ----------------------------- GL_SGIX_async ----------------------------- */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 - -#define GL_ASYNC_MARKER_SGIX 0x8329 - -typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); -typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); - -#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) -#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) -#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) -#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) -#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) -#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) - -#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) - -#endif /* GL_SGIX_async */ - -/* ------------------------ GL_SGIX_async_histogram ------------------------ */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 - -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D - -#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) - -#endif /* GL_SGIX_async_histogram */ - -/* -------------------------- GL_SGIX_async_pixel -------------------------- */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 - -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 - -#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) - -#endif /* GL_SGIX_async_pixel */ - -/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 - -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 - -#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) - -#endif /* GL_SGIX_blend_alpha_minmax */ - -/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 - -#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) - -#endif /* GL_SGIX_clipmap */ - -/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 - -#define GL_CONVOLUTION_HINT_SGIX 0x8316 - -#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) - -#endif /* GL_SGIX_convolution_accuracy */ - -/* ------------------------- GL_SGIX_depth_texture ------------------------- */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 - -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 - -#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) - -#endif /* GL_SGIX_depth_texture */ - -/* -------------------------- GL_SGIX_flush_raster ------------------------- */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 - -typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); - -#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) - -#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) - -#endif /* GL_SGIX_flush_raster */ - -/* --------------------------- GL_SGIX_fog_offset -------------------------- */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 - -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 - -#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) - -#endif /* GL_SGIX_fog_offset */ - -/* -------------------------- GL_SGIX_fog_texture -------------------------- */ - -#ifndef GL_SGIX_fog_texture -#define GL_SGIX_fog_texture 1 - -#define GL_TEXTURE_FOG_SGIX 0 -#define GL_FOG_PATCHY_FACTOR_SGIX 0 -#define GL_FRAGMENT_FOG_SGIX 0 - -typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); - -#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) - -#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) - -#endif /* GL_SGIX_fog_texture */ - -/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ - -#ifndef GL_SGIX_fragment_specular_lighting -#define GL_SGIX_fragment_specular_lighting 1 - -typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); - -#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) -#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) -#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) -#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) -#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) -#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) -#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) -#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) -#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) -#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) -#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) -#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) -#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) -#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) -#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) -#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) -#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) - -#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) - -#endif /* GL_SGIX_fragment_specular_lighting */ - -/* --------------------------- GL_SGIX_framezoom --------------------------- */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 - -typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); - -#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) - -#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) - -#endif /* GL_SGIX_framezoom */ - -/* --------------------------- GL_SGIX_interlace --------------------------- */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 - -#define GL_INTERLACE_SGIX 0x8094 - -#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) - -#endif /* GL_SGIX_interlace */ - -/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 - -#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) - -#endif /* GL_SGIX_ir_instrument1 */ - -/* ------------------------- GL_SGIX_list_priority ------------------------- */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 - -#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) - -#endif /* GL_SGIX_list_priority */ - -/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 - -typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); - -#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) - -#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) - -#endif /* GL_SGIX_pixel_texture */ - -/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ - -#ifndef GL_SGIX_pixel_texture_bits -#define GL_SGIX_pixel_texture_bits 1 - -#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) - -#endif /* GL_SGIX_pixel_texture_bits */ - -/* ------------------------ GL_SGIX_reference_plane ------------------------ */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 - -typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); - -#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) - -#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) - -#endif /* GL_SGIX_reference_plane */ - -/* ---------------------------- GL_SGIX_resample --------------------------- */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 - -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 - -#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) - -#endif /* GL_SGIX_resample */ - -/* ----------------------------- GL_SGIX_shadow ---------------------------- */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 - -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D - -#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) - -#endif /* GL_SGIX_shadow */ - -/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 - -#define GL_SHADOW_AMBIENT_SGIX 0x80BF - -#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) - -#endif /* GL_SGIX_shadow_ambient */ - -/* ----------------------------- GL_SGIX_sprite ---------------------------- */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 - -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); - -#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) -#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) -#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) -#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) - -#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) - -#endif /* GL_SGIX_sprite */ - -/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 - -typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); - -#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) - -#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) - -#endif /* GL_SGIX_tag_sample_buffer */ - -/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 - -#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) - -#endif /* GL_SGIX_texture_add_env */ - -/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 - -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B - -#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) - -#endif /* GL_SGIX_texture_coordinate_clamp */ - -/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 - -#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) - -#endif /* GL_SGIX_texture_lod_bias */ - -/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 - -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E - -#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) - -#endif /* GL_SGIX_texture_multi_buffer */ - -/* ------------------------- GL_SGIX_texture_range ------------------------- */ - -#ifndef GL_SGIX_texture_range -#define GL_SGIX_texture_range 1 - -#define GL_RGB_SIGNED_SGIX 0x85E0 -#define GL_RGBA_SIGNED_SGIX 0x85E1 -#define GL_ALPHA_SIGNED_SGIX 0x85E2 -#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 -#define GL_INTENSITY_SIGNED_SGIX 0x85E4 -#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 -#define GL_RGB16_SIGNED_SGIX 0x85E6 -#define GL_RGBA16_SIGNED_SGIX 0x85E7 -#define GL_ALPHA16_SIGNED_SGIX 0x85E8 -#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 -#define GL_INTENSITY16_SIGNED_SGIX 0x85EA -#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB -#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC -#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED -#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE -#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF -#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 -#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 -#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 -#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 -#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 -#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 -#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 -#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 -#define GL_MIN_LUMINANCE_SGIS 0x85F8 -#define GL_MAX_LUMINANCE_SGIS 0x85F9 -#define GL_MIN_INTENSITY_SGIS 0x85FA -#define GL_MAX_INTENSITY_SGIS 0x85FB - -#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) - -#endif /* GL_SGIX_texture_range */ - -/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 - -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C - -#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) - -#endif /* GL_SGIX_texture_scale_bias */ - -/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 - -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF - -#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) - -#endif /* GL_SGIX_vertex_preclip */ - -/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ - -#ifndef GL_SGIX_vertex_preclip_hint -#define GL_SGIX_vertex_preclip_hint 1 - -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF - -#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) - -#endif /* GL_SGIX_vertex_preclip_hint */ - -/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 - -#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) - -#endif /* GL_SGIX_ycrcb */ - -/* -------------------------- GL_SGI_color_matrix -------------------------- */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 - -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB - -#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) - -#endif /* GL_SGI_color_matrix */ - -/* --------------------------- GL_SGI_color_table -------------------------- */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 - -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF - -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); - -#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) -#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) -#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) -#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) -#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) -#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) -#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) - -#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) - -#endif /* GL_SGI_color_table */ - -/* ----------------------- GL_SGI_texture_color_table ---------------------- */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 - -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD - -#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) - -#endif /* GL_SGI_texture_color_table */ - -/* ------------------------- GL_SUNX_constant_data ------------------------- */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 - -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 - -typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); - -#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) - -#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) - -#endif /* GL_SUNX_constant_data */ - -/* -------------------- GL_SUN_convolution_border_modes -------------------- */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 - -#define GL_WRAP_BORDER_SUN 0x81D4 - -#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) - -#endif /* GL_SUN_convolution_border_modes */ - -/* -------------------------- GL_SUN_global_alpha -------------------------- */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 - -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA - -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); - -#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) -#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) -#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) -#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) -#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) -#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) -#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) -#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) - -#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) - -#endif /* GL_SUN_global_alpha */ - -/* --------------------------- GL_SUN_mesh_array --------------------------- */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 - -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 - -#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) - -#endif /* GL_SUN_mesh_array */ - -/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ - -#ifndef GL_SUN_read_video_pixels -#define GL_SUN_read_video_pixels 1 - -typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); - -#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) - -#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) - -#endif /* GL_SUN_read_video_pixels */ - -/* --------------------------- GL_SUN_slice_accum -------------------------- */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 - -#define GL_SLICE_ACCUM_SUN 0x85CC - -#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) - -#endif /* GL_SUN_slice_accum */ - -/* -------------------------- GL_SUN_triangle_list ------------------------- */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 - -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB - -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); - -#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) -#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) -#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) -#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) -#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) -#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) -#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) - -#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) - -#endif /* GL_SUN_triangle_list */ - -/* ----------------------------- GL_SUN_vertex ----------------------------- */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 - -typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); -typedef void (GLAPIENTRY * 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); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); - -#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) -#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) -#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) -#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) -#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) -#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) -#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) -#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) -#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) -#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) -#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) -#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) -#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) -#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) -#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) -#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) -#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) -#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) -#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) -#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) -#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) -#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) -#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) -#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) -#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) -#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) -#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) -#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) -#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) -#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) -#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) -#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) -#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) -#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) - -#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) - -#endif /* GL_SUN_vertex */ - -/* -------------------------- GL_WIN_phong_shading ------------------------- */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 - -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB - -#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) - -#endif /* GL_WIN_phong_shading */ - -/* -------------------------- GL_WIN_specular_fog -------------------------- */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 - -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC - -#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) - -#endif /* GL_WIN_specular_fog */ - -/* ---------------------------- GL_WIN_swap_hint --------------------------- */ - -#ifndef GL_WIN_swap_hint -#define GL_WIN_swap_hint 1 - -typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); - -#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) - -#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) - -#endif /* GL_WIN_swap_hint */ - -/* ------------------------------------------------------------------------- */ - -#if defined(GLEW_MX) && defined(_WIN32) -#define GLEW_FUN_EXPORT -#else -#define GLEW_FUN_EXPORT GLEWAPI -#endif /* GLEW_MX */ - -#if defined(GLEW_MX) -#define GLEW_VAR_EXPORT -#else -#define GLEW_VAR_EXPORT GLEWAPI -#endif /* GLEW_MX */ - -#if defined(GLEW_MX) && defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ - -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; - -GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; -GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; -GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; - -GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; -GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; -GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; -GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; -GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; -GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; -GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; -GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; -GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; -GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; -GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; -GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; -GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; -GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; -GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; -GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; -GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; -GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; - -GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; -GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; -GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; -GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; -GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; -GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; -GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; -GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; -GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; -GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; -GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; -GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; -GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; -GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; -GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; -GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; -GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; -GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; -GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; -GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; -GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; -GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; -GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; -GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; -GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; -GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; -GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; -GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; -GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; -GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; -GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; -GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; -GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; -GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; -GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; -GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; -GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; -GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; -GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; - -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; - -GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; -GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; -GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; -GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; -GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; -GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; -GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; -GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; -GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; -GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; -GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; -GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; - -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; -GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; -GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; - -GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; - -GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; -GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; -GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; - -GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; -GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; -GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; -GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; -GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; - -GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; - -GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; - -GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; -GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; - -GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; -GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; -GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; -GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; -GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; -GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; -GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; -GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; - -GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; -GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; -GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; - -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; -GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; -GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; -GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; - -GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; -GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; -GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; -GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; -GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; - -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; -GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; - -GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; - -GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; - -GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; - -GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; -GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; - -GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; - -GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; - -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; -GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; -GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; -GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; -GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; -GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; -GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; -GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; -GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; -GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; -GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; -GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; -GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; -GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; -GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; -GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; -GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; -GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; -GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; -GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; -GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; -GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; - -GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; -GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; -GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; -GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; -GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; -GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; -GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; -GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; -GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; -GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; - -GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; - -GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; - -GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; -GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; -GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; -GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; -GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; -GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; - -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; -GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; - -GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; - -GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; - -GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; -GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; -GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; -GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; -GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; -GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; -GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; - -GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; - -GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; -GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; -GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; -GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; -GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; -GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; -GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; -GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; -GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; -GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; -GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; -GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; -GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; - -GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; - -GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; -GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; -GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; -GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; - -GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; -GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; -GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; -GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; - -GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; - -GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; -GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; - -GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; -GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; -GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; -GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; -GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; -GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; -GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; -GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; -GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; -GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; -GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; -GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; - -GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; - -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; -GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; -GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; -GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; -GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; - -GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; -GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; -GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; -GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; -GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; -GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; - -GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; -GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; -GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; -GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; -GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; -GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; -GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; - -GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; -GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; - -GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; - -GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; - -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; - -GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; -GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; -GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; - -GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; - -GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; - -GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; - -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; -GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; - -GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; -GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; -GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; -GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; -GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; -GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; -GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; -GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; - -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; - -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; - -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; -GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; -GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; -GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; -GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; -GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; -GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; -GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; - -GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; -GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; -GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; -GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; - -GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; -GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; -GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; -GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; -GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; -GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; -GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; - -GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; -GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; -GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; - -GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; -GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; -GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; - -GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; -GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; -GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; -GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; -GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; -GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; -GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; -GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; -GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; - -GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; -GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; -GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; -GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; -GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; -GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; -GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; -GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; -GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; - -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; - -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; -GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; - -GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; -GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; -GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; -GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; - -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; -GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; -GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; -GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; -GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; -GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; - -GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; -GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; - -GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; -GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; - -GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; -GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; - -GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; -GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; -GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; -GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; -GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; -GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; -GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; -GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; - -GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; -GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; -GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; -GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; -GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; - -GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; - -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; - -GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; -GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; - -GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; -GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; - -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; -GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; - -GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; -GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; - -GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; - -GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; -GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; - -GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; -GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; -GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; - -GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; - -GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; -GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; -GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; -GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; -GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; -GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; -GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; -GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; -GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; -GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; -GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; -GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; -GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; -GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; -GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; -GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; -GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; - -GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; -GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; -GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; -GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; -GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; - -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; - -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; - -GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; -GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; - -GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; - -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; -GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; -GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; -GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; -GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; -GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; -GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; -GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; - -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; - -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; -GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; -GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; -GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; -GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; - -GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; - -GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; - -GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; -GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; - -GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; -GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; - -GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; - -GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; - -GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; - -GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; - -GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; -GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; - -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; - -GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; -GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; - -GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; -GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; - -GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; - -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; - -GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; - -GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; -GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; - -GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; -GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; -GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; -GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; -GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; - -GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; - -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; - -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; - -GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; -GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; -GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; -GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; -GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; -GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; - -GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; -GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; -GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; -GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; -GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; -GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; -GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; -GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; -GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; -GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; -GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; -GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; -GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; -GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; -GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; -GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; -GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; - -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; - -GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; - -GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; - -GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; - -GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; -GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; - -GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; -GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; - -GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; -GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; -GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; -GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; - -GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; -GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; - -GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; -GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; -GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; -GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; -GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv; -GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; -GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; -GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; - -GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; -GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; -GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; - -GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; - -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; - -GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; -GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; -GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; -GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; -GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; - -GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; -GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; - -GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; -GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; - -GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; -GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; -GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; -GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; -GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; -GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; -GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; - -GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; -GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; -GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; - -GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; -GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; -GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; -GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; -GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; -GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; -GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; - -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; - -GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; -GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; -GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; -GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; -GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; -GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; -GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; -GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; -GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; - -GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; -GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; -GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; -GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; -GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; -GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; -GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; - -GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; -GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; -GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; -GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; -GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; -GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; -GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; -GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; -GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; -GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; -GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; -GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; -GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; -GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; -GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; -GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; -GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; -GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; -GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; -GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; -GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; -GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; -GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; -GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; -GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; -GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; -GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; -GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; -GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; -GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; -GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; -GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; -GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; -GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; - -GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; -GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; - -GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; -GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; -GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; - -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; - -GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; -GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; -GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; -GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; - -GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; - -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; -GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; -GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; -GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; -GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; - -GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; - -GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; -GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; - -GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; -GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; - -GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; -GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; -GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; -GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; -GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; -GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; -GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; - -GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; - -GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; -GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; -GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; -GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; -GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; -GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; -GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; - -GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; -GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; -GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; -GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; -GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; -GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; -GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; -GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; -GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; - -GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; -GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; -GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; -GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; -GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; -GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; -GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; - -GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; - -GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; -GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; - -GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; -GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; - -GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; -GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; - -GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; -GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; - -GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; -GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; - -GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; -GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; - -GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; -GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; -GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; -GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; -GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; -GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; - -GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; - -GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; - -GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; - -GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; - -GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; - -GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; - -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; - -GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; - -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; -GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; -GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; - -GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; - -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; - -GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; - -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; - -GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; - -GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; - -#if defined(GLEW_MX) && !defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ - -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; -GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; -GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; -GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; -GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; -GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; -GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; -GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; -GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; -GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; - -#ifdef GLEW_MX -}; /* GLEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------- */ - -/* error codes */ -#define GLEW_OK 0 -#define GLEW_NO_ERROR 0 -#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ -#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ -#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ - -/* string codes */ -#define GLEW_VERSION 1 -#define GLEW_VERSION_MAJOR 2 -#define GLEW_VERSION_MINOR 3 -#define GLEW_VERSION_MICRO 4 - -/* API */ -#ifdef GLEW_MX - -typedef struct GLEWContextStruct GLEWContext; -GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); - -#define glewInit() glewContextInit(glewGetContext()) -#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) -#define glewIsExtensionSupported(x) glewIsSupported(x) - -#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) -#ifdef _WIN32 -# define GLEW_GET_FUN(x) glewGetContext()->x -#else -# define GLEW_GET_FUN(x) x -#endif - -#else /* GLEW_MX */ - -GLEWAPI GLenum GLEWAPIENTRY glewInit (void); -GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); -#define glewIsExtensionSupported(x) glewIsSupported(x) - -#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) -#define GLEW_GET_FUN(x) x - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean glewExperimental; -GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); -GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); -GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); - -#ifdef __cplusplus -} -#endif - -#ifdef GLEW_APIENTRY_DEFINED -#undef GLEW_APIENTRY_DEFINED -#undef APIENTRY -#undef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifdef GLEW_CALLBACK_DEFINED -#undef GLEW_CALLBACK_DEFINED -#undef CALLBACK -#endif - -#ifdef GLEW_WINGDIAPI_DEFINED -#undef GLEW_WINGDIAPI_DEFINED -#undef WINGDIAPI -#endif - -#undef GLAPI -/* #undef GLEWAPI */ - -#endif /* __glew_h__ */ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __GL_H__ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * 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); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_SAMPLES 0x80A9 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_RENDERBUFFER 0x8D41 +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar ** path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT) +#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT) +#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT) +#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT) +#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GL_TEXTURE_ENV0_EXT 0 +#define GL_ENV_BLEND_EXT 0 +#define GL_TEXTURE_ENV_SHIFT_EXT 0 +#define GL_ENV_REPLACE_EXT 0 +#define GL_ENV_ADD_EXT 0 +#define GL_ENV_SUBTRACT_EXT 0 +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 +#define GL_ENV_REVERSE_SUBTRACT_EXT 0 +#define GL_ENV_REVERSE_BLEND_EXT 0 +#define GL_ENV_COPY_EXT 0 +#define GL_ENV_MODULATE_EXT 0 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar ** varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETPOINTERVPROC) (GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glGetPointerv GLEW_GET_FUN(__glewGetPointerv) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * 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); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GL_BYTE 0x1400 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * 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); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/examples/common/glew/glxew.h b/examples/common/glew/glxew.h index 5cb2d222..3bc7958a 100644 --- a/examples/common/glew/glxew.h +++ b/examples/common/glew/glxew.h @@ -1,1637 +1,1637 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __glxew_h__ -#define __glxew_h__ -#define __GLXEW_H__ - -#ifdef __glxext_h_ -#error glxext.h included before glxew.h -#endif - -#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) -#error glx.h included before glxew.h -#endif - -#define __glxext_h_ - -#define GLX_H -#define __GLX_glx_h__ -#define __glx_h__ - -#include -#include -#include -#include "glew.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ - -#ifndef GLX_VERSION_1_0 -#define GLX_VERSION_1_0 1 - -#define GLX_USE_GL 1 -#define GLX_BUFFER_SIZE 2 -#define GLX_LEVEL 3 -#define GLX_RGBA 4 -#define GLX_DOUBLEBUFFER 5 -#define GLX_STEREO 6 -#define GLX_AUX_BUFFERS 7 -#define GLX_RED_SIZE 8 -#define GLX_GREEN_SIZE 9 -#define GLX_BLUE_SIZE 10 -#define GLX_ALPHA_SIZE 11 -#define GLX_DEPTH_SIZE 12 -#define GLX_STENCIL_SIZE 13 -#define GLX_ACCUM_RED_SIZE 14 -#define GLX_ACCUM_GREEN_SIZE 15 -#define GLX_ACCUM_BLUE_SIZE 16 -#define GLX_ACCUM_ALPHA_SIZE 17 -#define GLX_BAD_SCREEN 1 -#define GLX_BAD_ATTRIBUTE 2 -#define GLX_NO_EXTENSION 3 -#define GLX_BAD_VISUAL 4 -#define GLX_BAD_CONTEXT 5 -#define GLX_BAD_VALUE 6 -#define GLX_BAD_ENUM 7 - -typedef XID GLXDrawable; -typedef XID GLXPixmap; -#ifdef __sun -typedef struct __glXContextRec *GLXContext; -#else -typedef struct __GLXcontextRec *GLXContext; -#endif - -typedef unsigned int GLXVideoDeviceNV; - -extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); -extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); -extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); -extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); -extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); -extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); -extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); -extern void glXDestroyContext (Display *dpy, GLXContext ctx); -extern Bool glXIsDirect (Display *dpy, GLXContext ctx); -extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); -extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); -extern GLXContext glXGetCurrentContext (void); -extern GLXDrawable glXGetCurrentDrawable (void); -extern void glXWaitGL (void); -extern void glXWaitX (void); -extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); -extern void glXUseXFont (Font font, int first, int count, int listBase); - -#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) - -#endif /* GLX_VERSION_1_0 */ - -/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ - -#ifndef GLX_VERSION_1_1 -#define GLX_VERSION_1_1 - -#define GLX_VENDOR 0x1 -#define GLX_VERSION 0x2 -#define GLX_EXTENSIONS 0x3 - -extern const char* glXQueryExtensionsString (Display *dpy, int screen); -extern const char* glXGetClientString (Display *dpy, int name); -extern const char* glXQueryServerString (Display *dpy, int screen, int name); - -#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) - -#endif /* GLX_VERSION_1_1 */ - -/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ - -#ifndef GLX_VERSION_1_2 -#define GLX_VERSION_1_2 1 - -typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); - -#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) - -#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) - -#endif /* GLX_VERSION_1_2 */ - -/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ - -#ifndef GLX_VERSION_1_3 -#define GLX_VERSION_1_3 1 - -#define GLX_RGBA_BIT 0x00000001 -#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 -#define GLX_WINDOW_BIT 0x00000001 -#define GLX_COLOR_INDEX_BIT 0x00000002 -#define GLX_PIXMAP_BIT 0x00000002 -#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 -#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 -#define GLX_PBUFFER_BIT 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 -#define GLX_AUX_BUFFERS_BIT 0x00000010 -#define GLX_CONFIG_CAVEAT 0x20 -#define GLX_DEPTH_BUFFER_BIT 0x00000020 -#define GLX_X_VISUAL_TYPE 0x22 -#define GLX_TRANSPARENT_TYPE 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE 0x24 -#define GLX_TRANSPARENT_RED_VALUE 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 -#define GLX_STENCIL_BUFFER_BIT 0x00000040 -#define GLX_ACCUM_BUFFER_BIT 0x00000080 -#define GLX_NONE 0x8000 -#define GLX_SLOW_CONFIG 0x8001 -#define GLX_TRUE_COLOR 0x8002 -#define GLX_DIRECT_COLOR 0x8003 -#define GLX_PSEUDO_COLOR 0x8004 -#define GLX_STATIC_COLOR 0x8005 -#define GLX_GRAY_SCALE 0x8006 -#define GLX_STATIC_GRAY 0x8007 -#define GLX_TRANSPARENT_RGB 0x8008 -#define GLX_TRANSPARENT_INDEX 0x8009 -#define GLX_VISUAL_ID 0x800B -#define GLX_SCREEN 0x800C -#define GLX_NON_CONFORMANT_CONFIG 0x800D -#define GLX_DRAWABLE_TYPE 0x8010 -#define GLX_RENDER_TYPE 0x8011 -#define GLX_X_RENDERABLE 0x8012 -#define GLX_FBCONFIG_ID 0x8013 -#define GLX_RGBA_TYPE 0x8014 -#define GLX_COLOR_INDEX_TYPE 0x8015 -#define GLX_MAX_PBUFFER_WIDTH 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT 0x8017 -#define GLX_MAX_PBUFFER_PIXELS 0x8018 -#define GLX_PRESERVED_CONTENTS 0x801B -#define GLX_LARGEST_PBUFFER 0x801C -#define GLX_WIDTH 0x801D -#define GLX_HEIGHT 0x801E -#define GLX_EVENT_MASK 0x801F -#define GLX_DAMAGED 0x8020 -#define GLX_SAVED 0x8021 -#define GLX_WINDOW 0x8022 -#define GLX_PBUFFER 0x8023 -#define GLX_PBUFFER_HEIGHT 0x8040 -#define GLX_PBUFFER_WIDTH 0x8041 -#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 -#define GLX_DONT_CARE 0xFFFFFFFF - -typedef XID GLXFBConfigID; -typedef XID GLXPbuffer; -typedef XID GLXWindow; -typedef struct __GLXFBConfigRec *GLXFBConfig; - -typedef struct { - int event_type; - int draw_type; - unsigned long serial; - Bool send_event; - Display *display; - GLXDrawable drawable; - unsigned int buffer_mask; - unsigned int aux_buffer; - int x, y; - int width, height; - int count; -} GLXPbufferClobberEvent; -typedef union __GLXEvent { - GLXPbufferClobberEvent glxpbufferclobber; - long pad[24]; -} GLXEvent; - -typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); -typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); -typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); -typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); -typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); -typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); -typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); -typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); -typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); -typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); -typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); -typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); -typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); -typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); -typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); -typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); - -#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) -#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) -#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) -#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) -#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) -#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) -#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) -#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) -#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) -#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) -#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) -#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) -#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) -#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) -#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) -#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) -#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) - -#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) - -#endif /* GLX_VERSION_1_3 */ - -/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ - -#ifndef GLX_VERSION_1_4 -#define GLX_VERSION_1_4 1 - -#define GLX_SAMPLE_BUFFERS 100000 -#define GLX_SAMPLES 100001 - -extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); - -#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) - -#endif /* GLX_VERSION_1_4 */ - -/* -------------------------- GLX_3DFX_multisample ------------------------- */ - -#ifndef GLX_3DFX_multisample -#define GLX_3DFX_multisample 1 - -#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 -#define GLX_SAMPLES_3DFX 0x8051 - -#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) - -#endif /* GLX_3DFX_multisample */ - -/* ------------------------ GLX_AMD_gpu_association ------------------------ */ - -#ifndef GLX_AMD_gpu_association -#define GLX_AMD_gpu_association 1 - -#define GLX_GPU_VENDOR_AMD 0x1F00 -#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 -#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 -#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 -#define GLX_GPU_RAM_AMD 0x21A3 -#define GLX_GPU_CLOCK_AMD 0x21A4 -#define GLX_GPU_NUM_PIPES_AMD 0x21A5 -#define GLX_GPU_NUM_SIMD_AMD 0x21A6 -#define GLX_GPU_NUM_RB_AMD 0x21A7 -#define GLX_GPU_NUM_SPI_AMD 0x21A8 - -#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) - -#endif /* GLX_AMD_gpu_association */ - -/* ------------------------- GLX_ARB_create_context ------------------------ */ - -#ifndef GLX_ARB_create_context -#define GLX_ARB_create_context 1 - -#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define GLX_CONTEXT_FLAGS_ARB 0x2094 - -typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); - -#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) - -#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) - -#endif /* GLX_ARB_create_context */ - -/* --------------------- GLX_ARB_create_context_profile -------------------- */ - -#ifndef GLX_ARB_create_context_profile -#define GLX_ARB_create_context_profile 1 - -#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 -#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 -#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 - -#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) - -#endif /* GLX_ARB_create_context_profile */ - -/* ------------------- GLX_ARB_create_context_robustness ------------------- */ - -#ifndef GLX_ARB_create_context_robustness -#define GLX_ARB_create_context_robustness 1 - -#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 - -#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) - -#endif /* GLX_ARB_create_context_robustness */ - -/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ - -#ifndef GLX_ARB_fbconfig_float -#define GLX_ARB_fbconfig_float 1 - -#define GLX_RGBA_FLOAT_BIT 0x00000004 -#define GLX_RGBA_FLOAT_TYPE 0x20B9 - -#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) - -#endif /* GLX_ARB_fbconfig_float */ - -/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ - -#ifndef GLX_ARB_framebuffer_sRGB -#define GLX_ARB_framebuffer_sRGB 1 - -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 - -#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) - -#endif /* GLX_ARB_framebuffer_sRGB */ - -/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ - -#ifndef GLX_ARB_get_proc_address -#define GLX_ARB_get_proc_address 1 - -extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); - -#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) - -#endif /* GLX_ARB_get_proc_address */ - -/* -------------------------- GLX_ARB_multisample -------------------------- */ - -#ifndef GLX_ARB_multisample -#define GLX_ARB_multisample 1 - -#define GLX_SAMPLE_BUFFERS_ARB 100000 -#define GLX_SAMPLES_ARB 100001 - -#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) - -#endif /* GLX_ARB_multisample */ - -/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ - -#ifndef GLX_ARB_robustness_application_isolation -#define GLX_ARB_robustness_application_isolation 1 - -#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) - -#endif /* GLX_ARB_robustness_application_isolation */ - -/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ - -#ifndef GLX_ARB_robustness_share_group_isolation -#define GLX_ARB_robustness_share_group_isolation 1 - -#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) - -#endif /* GLX_ARB_robustness_share_group_isolation */ - -/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ - -#ifndef GLX_ARB_vertex_buffer_object -#define GLX_ARB_vertex_buffer_object 1 - -#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 - -#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) - -#endif /* GLX_ARB_vertex_buffer_object */ - -/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ - -#ifndef GLX_ATI_pixel_format_float -#define GLX_ATI_pixel_format_float 1 - -#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 - -#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) - -#endif /* GLX_ATI_pixel_format_float */ - -/* ------------------------- GLX_ATI_render_texture ------------------------ */ - -#ifndef GLX_ATI_render_texture -#define GLX_ATI_render_texture 1 - -#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 -#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 -#define GLX_TEXTURE_FORMAT_ATI 0x9802 -#define GLX_TEXTURE_TARGET_ATI 0x9803 -#define GLX_MIPMAP_TEXTURE_ATI 0x9804 -#define GLX_TEXTURE_RGB_ATI 0x9805 -#define GLX_TEXTURE_RGBA_ATI 0x9806 -#define GLX_NO_TEXTURE_ATI 0x9807 -#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 -#define GLX_TEXTURE_1D_ATI 0x9809 -#define GLX_TEXTURE_2D_ATI 0x980A -#define GLX_MIPMAP_LEVEL_ATI 0x980B -#define GLX_CUBE_MAP_FACE_ATI 0x980C -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 -#define GLX_FRONT_LEFT_ATI 0x9813 -#define GLX_FRONT_RIGHT_ATI 0x9814 -#define GLX_BACK_LEFT_ATI 0x9815 -#define GLX_BACK_RIGHT_ATI 0x9816 -#define GLX_AUX0_ATI 0x9817 -#define GLX_AUX1_ATI 0x9818 -#define GLX_AUX2_ATI 0x9819 -#define GLX_AUX3_ATI 0x981A -#define GLX_AUX4_ATI 0x981B -#define GLX_AUX5_ATI 0x981C -#define GLX_AUX6_ATI 0x981D -#define GLX_AUX7_ATI 0x981E -#define GLX_AUX8_ATI 0x981F -#define GLX_AUX9_ATI 0x9820 -#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 -#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 - -typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); -typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); -typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); - -#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) -#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) -#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) - -#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) - -#endif /* GLX_ATI_render_texture */ - -/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ - -#ifndef GLX_EXT_create_context_es2_profile -#define GLX_EXT_create_context_es2_profile 1 - -#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 - -#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) - -#endif /* GLX_EXT_create_context_es2_profile */ - -/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ - -#ifndef GLX_EXT_create_context_es_profile -#define GLX_EXT_create_context_es_profile 1 - -#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 - -#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) - -#endif /* GLX_EXT_create_context_es_profile */ - -/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ - -#ifndef GLX_EXT_fbconfig_packed_float -#define GLX_EXT_fbconfig_packed_float 1 - -#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 -#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 - -#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) - -#endif /* GLX_EXT_fbconfig_packed_float */ - -/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ - -#ifndef GLX_EXT_framebuffer_sRGB -#define GLX_EXT_framebuffer_sRGB 1 - -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 - -#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) - -#endif /* GLX_EXT_framebuffer_sRGB */ - -/* ------------------------- GLX_EXT_import_context ------------------------ */ - -#ifndef GLX_EXT_import_context -#define GLX_EXT_import_context 1 - -#define GLX_SHARE_CONTEXT_EXT 0x800A -#define GLX_VISUAL_ID_EXT 0x800B -#define GLX_SCREEN_EXT 0x800C - -typedef XID GLXContextID; - -typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); -typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); -typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); -typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); - -#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) -#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) -#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) -#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) - -#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) - -#endif /* GLX_EXT_import_context */ - -/* -------------------------- GLX_EXT_scene_marker ------------------------- */ - -#ifndef GLX_EXT_scene_marker -#define GLX_EXT_scene_marker 1 - -#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) - -#endif /* GLX_EXT_scene_marker */ - -/* -------------------------- GLX_EXT_swap_control ------------------------- */ - -#ifndef GLX_EXT_swap_control -#define GLX_EXT_swap_control 1 - -#define GLX_SWAP_INTERVAL_EXT 0x20F1 -#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 - -typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); - -#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) - -#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) - -#endif /* GLX_EXT_swap_control */ - -/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ - -#ifndef GLX_EXT_swap_control_tear -#define GLX_EXT_swap_control_tear 1 - -#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 - -#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) - -#endif /* GLX_EXT_swap_control_tear */ - -/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ - -#ifndef GLX_EXT_texture_from_pixmap -#define GLX_EXT_texture_from_pixmap 1 - -#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 -#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 -#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 -#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 -#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 -#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 -#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 -#define GLX_Y_INVERTED_EXT 0x20D4 -#define GLX_TEXTURE_FORMAT_EXT 0x20D5 -#define GLX_TEXTURE_TARGET_EXT 0x20D6 -#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 -#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 -#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 -#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA -#define GLX_TEXTURE_1D_EXT 0x20DB -#define GLX_TEXTURE_2D_EXT 0x20DC -#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD -#define GLX_FRONT_LEFT_EXT 0x20DE -#define GLX_FRONT_RIGHT_EXT 0x20DF -#define GLX_BACK_LEFT_EXT 0x20E0 -#define GLX_BACK_RIGHT_EXT 0x20E1 -#define GLX_AUX0_EXT 0x20E2 -#define GLX_AUX1_EXT 0x20E3 -#define GLX_AUX2_EXT 0x20E4 -#define GLX_AUX3_EXT 0x20E5 -#define GLX_AUX4_EXT 0x20E6 -#define GLX_AUX5_EXT 0x20E7 -#define GLX_AUX6_EXT 0x20E8 -#define GLX_AUX7_EXT 0x20E9 -#define GLX_AUX8_EXT 0x20EA -#define GLX_AUX9_EXT 0x20EB - -typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); -typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); - -#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) -#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) - -#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) - -#endif /* GLX_EXT_texture_from_pixmap */ - -/* -------------------------- GLX_EXT_visual_info -------------------------- */ - -#ifndef GLX_EXT_visual_info -#define GLX_EXT_visual_info 1 - -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 -#define GLX_NONE_EXT 0x8000 -#define GLX_TRUE_COLOR_EXT 0x8002 -#define GLX_DIRECT_COLOR_EXT 0x8003 -#define GLX_PSEUDO_COLOR_EXT 0x8004 -#define GLX_STATIC_COLOR_EXT 0x8005 -#define GLX_GRAY_SCALE_EXT 0x8006 -#define GLX_STATIC_GRAY_EXT 0x8007 -#define GLX_TRANSPARENT_RGB_EXT 0x8008 -#define GLX_TRANSPARENT_INDEX_EXT 0x8009 - -#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) - -#endif /* GLX_EXT_visual_info */ - -/* ------------------------- GLX_EXT_visual_rating ------------------------- */ - -#ifndef GLX_EXT_visual_rating -#define GLX_EXT_visual_rating 1 - -#define GLX_VISUAL_CAVEAT_EXT 0x20 -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D - -#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) - -#endif /* GLX_EXT_visual_rating */ - -/* -------------------------- GLX_INTEL_swap_event ------------------------- */ - -#ifndef GLX_INTEL_swap_event -#define GLX_INTEL_swap_event 1 - -#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 -#define GLX_COPY_COMPLETE_INTEL 0x8181 -#define GLX_FLIP_COMPLETE_INTEL 0x8182 -#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 - -#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) - -#endif /* GLX_INTEL_swap_event */ - -/* -------------------------- GLX_MESA_agp_offset -------------------------- */ - -#ifndef GLX_MESA_agp_offset -#define GLX_MESA_agp_offset 1 - -typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); - -#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) - -#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) - -#endif /* GLX_MESA_agp_offset */ - -/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ - -#ifndef GLX_MESA_copy_sub_buffer -#define GLX_MESA_copy_sub_buffer 1 - -typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); - -#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) - -#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) - -#endif /* GLX_MESA_copy_sub_buffer */ - -/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ - -#ifndef GLX_MESA_pixmap_colormap -#define GLX_MESA_pixmap_colormap 1 - -typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); - -#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) - -#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) - -#endif /* GLX_MESA_pixmap_colormap */ - -/* ------------------------ GLX_MESA_release_buffers ----------------------- */ - -#ifndef GLX_MESA_release_buffers -#define GLX_MESA_release_buffers 1 - -typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); - -#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) - -#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) - -#endif /* GLX_MESA_release_buffers */ - -/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ - -#ifndef GLX_MESA_set_3dfx_mode -#define GLX_MESA_set_3dfx_mode 1 - -#define GLX_3DFX_WINDOW_MODE_MESA 0x1 -#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 - -typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); - -#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) - -#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) - -#endif /* GLX_MESA_set_3dfx_mode */ - -/* ------------------------- GLX_MESA_swap_control ------------------------- */ - -#ifndef GLX_MESA_swap_control -#define GLX_MESA_swap_control 1 - -typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); -typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); - -#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) -#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) - -#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) - -#endif /* GLX_MESA_swap_control */ - -/* --------------------------- GLX_NV_copy_image --------------------------- */ - -#ifndef GLX_NV_copy_image -#define GLX_NV_copy_image 1 - -typedef 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); - -#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) - -#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) - -#endif /* GLX_NV_copy_image */ - -/* -------------------------- GLX_NV_float_buffer -------------------------- */ - -#ifndef GLX_NV_float_buffer -#define GLX_NV_float_buffer 1 - -#define GLX_FLOAT_COMPONENTS_NV 0x20B0 - -#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) - -#endif /* GLX_NV_float_buffer */ - -/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ - -#ifndef GLX_NV_multisample_coverage -#define GLX_NV_multisample_coverage 1 - -#define GLX_COLOR_SAMPLES_NV 0x20B3 -#define GLX_COVERAGE_SAMPLES_NV 100001 - -#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) - -#endif /* GLX_NV_multisample_coverage */ - -/* -------------------------- GLX_NV_present_video ------------------------- */ - -#ifndef GLX_NV_present_video -#define GLX_NV_present_video 1 - -#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 - -typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); -typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); - -#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) -#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) - -#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) - -#endif /* GLX_NV_present_video */ - -/* --------------------------- GLX_NV_swap_group --------------------------- */ - -#ifndef GLX_NV_swap_group -#define GLX_NV_swap_group 1 - -typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); -typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); -typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); -typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); -typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); -typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); - -#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) -#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) -#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) -#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) -#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) -#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) - -#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) - -#endif /* GLX_NV_swap_group */ - -/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ - -#ifndef GLX_NV_vertex_array_range -#define GLX_NV_vertex_array_range 1 - -typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); -typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); - -#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) -#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) - -#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) - -#endif /* GLX_NV_vertex_array_range */ - -/* -------------------------- GLX_NV_video_capture ------------------------- */ - -#ifndef GLX_NV_video_capture -#define GLX_NV_video_capture 1 - -#define GLX_DEVICE_ID_NV 0x20CD -#define GLX_UNIQUE_ID_NV 0x20CE -#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF - -typedef XID GLXVideoCaptureDeviceNV; - -typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); -typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); -typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); -typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); -typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); - -#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) -#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) -#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) -#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) -#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) - -#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) - -#endif /* GLX_NV_video_capture */ - -/* ---------------------------- GLX_NV_video_out --------------------------- */ - -#ifndef GLX_NV_video_out -#define GLX_NV_video_out 1 - -#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 -#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 -#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 -#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 -#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 -#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA -#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB -#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC - -typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); -typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); -typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); -typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); -typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); -typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); - -#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) -#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) -#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) -#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) -#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) -#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) - -#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) - -#endif /* GLX_NV_video_out */ - -/* -------------------------- GLX_OML_swap_method -------------------------- */ - -#ifndef GLX_OML_swap_method -#define GLX_OML_swap_method 1 - -#define GLX_SWAP_METHOD_OML 0x8060 -#define GLX_SWAP_EXCHANGE_OML 0x8061 -#define GLX_SWAP_COPY_OML 0x8062 -#define GLX_SWAP_UNDEFINED_OML 0x8063 - -#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) - -#endif /* GLX_OML_swap_method */ - -/* -------------------------- GLX_OML_sync_control ------------------------- */ - -#ifndef GLX_OML_sync_control -#define GLX_OML_sync_control 1 - -typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); -typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); -typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); -typedef 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); -typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); - -#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) -#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) -#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) -#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) -#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) - -#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) - -#endif /* GLX_OML_sync_control */ - -/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ - -#ifndef GLX_SGIS_blended_overlay -#define GLX_SGIS_blended_overlay 1 - -#define GLX_BLENDED_RGBA_SGIS 0x8025 - -#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) - -#endif /* GLX_SGIS_blended_overlay */ - -/* -------------------------- GLX_SGIS_color_range ------------------------- */ - -#ifndef GLX_SGIS_color_range -#define GLX_SGIS_color_range 1 - -#define GLX_MIN_RED_SGIS 0 -#define GLX_MAX_GREEN_SGIS 0 -#define GLX_MIN_BLUE_SGIS 0 -#define GLX_MAX_ALPHA_SGIS 0 -#define GLX_MIN_GREEN_SGIS 0 -#define GLX_MIN_ALPHA_SGIS 0 -#define GLX_MAX_RED_SGIS 0 -#define GLX_EXTENDED_RANGE_SGIS 0 -#define GLX_MAX_BLUE_SGIS 0 - -#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) - -#endif /* GLX_SGIS_color_range */ - -/* -------------------------- GLX_SGIS_multisample ------------------------- */ - -#ifndef GLX_SGIS_multisample -#define GLX_SGIS_multisample 1 - -#define GLX_SAMPLE_BUFFERS_SGIS 100000 -#define GLX_SAMPLES_SGIS 100001 - -#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) - -#endif /* GLX_SGIS_multisample */ - -/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ - -#ifndef GLX_SGIS_shared_multisample -#define GLX_SGIS_shared_multisample 1 - -#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 -#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 - -#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) - -#endif /* GLX_SGIS_shared_multisample */ - -/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ - -#ifndef GLX_SGIX_fbconfig -#define GLX_SGIX_fbconfig 1 - -#define GLX_WINDOW_BIT_SGIX 0x00000001 -#define GLX_RGBA_BIT_SGIX 0x00000001 -#define GLX_PIXMAP_BIT_SGIX 0x00000002 -#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 -#define GLX_SCREEN_EXT 0x800C -#define GLX_DRAWABLE_TYPE_SGIX 0x8010 -#define GLX_RENDER_TYPE_SGIX 0x8011 -#define GLX_X_RENDERABLE_SGIX 0x8012 -#define GLX_FBCONFIG_ID_SGIX 0x8013 -#define GLX_RGBA_TYPE_SGIX 0x8014 -#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 - -typedef XID GLXFBConfigIDSGIX; -typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; - -typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); -typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); -typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); -typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); -typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); - -#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) -#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) -#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) -#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) -#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) -#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) - -#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) - -#endif /* GLX_SGIX_fbconfig */ - -/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ - -#ifndef GLX_SGIX_hyperpipe -#define GLX_SGIX_hyperpipe 1 - -#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 -#define GLX_PIPE_RECT_SGIX 0x00000001 -#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 -#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 -#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 -#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 -#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 -#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 -#define GLX_BAD_HYPERPIPE_SGIX 92 -#define GLX_HYPERPIPE_ID_SGIX 0x8030 - -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int networkId; -} GLXHyperpipeNetworkSGIX; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int XOrigin; - int YOrigin; - int maxHeight; - int maxWidth; -} GLXPipeRectLimits; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int channel; - unsigned int participationType; - int timeSlice; -} GLXHyperpipeConfigSGIX; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int srcXOrigin; - int srcYOrigin; - int srcWidth; - int srcHeight; - int destXOrigin; - int destYOrigin; - int destWidth; - int destHeight; -} GLXPipeRect; - -typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); -typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); -typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); -typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); -typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); -typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); -typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); -typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); - -#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) -#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) -#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) -#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) -#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) -#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) -#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) -#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) - -#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) - -#endif /* GLX_SGIX_hyperpipe */ - -/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ - -#ifndef GLX_SGIX_pbuffer -#define GLX_SGIX_pbuffer 1 - -#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 -#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 -#define GLX_PBUFFER_BIT_SGIX 0x00000004 -#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 -#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 -#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 -#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 -#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 -#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 -#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 -#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 -#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 -#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A -#define GLX_PRESERVED_CONTENTS_SGIX 0x801B -#define GLX_LARGEST_PBUFFER_SGIX 0x801C -#define GLX_WIDTH_SGIX 0x801D -#define GLX_HEIGHT_SGIX 0x801E -#define GLX_EVENT_MASK_SGIX 0x801F -#define GLX_DAMAGED_SGIX 0x8020 -#define GLX_SAVED_SGIX 0x8021 -#define GLX_WINDOW_SGIX 0x8022 -#define GLX_PBUFFER_SGIX 0x8023 -#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 - -typedef XID GLXPbufferSGIX; -typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; - -typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); -typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); -typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); -typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); -typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); - -#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) -#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) -#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) -#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) -#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) - -#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) - -#endif /* GLX_SGIX_pbuffer */ - -/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ - -#ifndef GLX_SGIX_swap_barrier -#define GLX_SGIX_swap_barrier 1 - -typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); -typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); - -#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) -#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) - -#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) - -#endif /* GLX_SGIX_swap_barrier */ - -/* -------------------------- GLX_SGIX_swap_group -------------------------- */ - -#ifndef GLX_SGIX_swap_group -#define GLX_SGIX_swap_group 1 - -typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); - -#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) - -#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) - -#endif /* GLX_SGIX_swap_group */ - -/* ------------------------- GLX_SGIX_video_resize ------------------------- */ - -#ifndef GLX_SGIX_video_resize -#define GLX_SGIX_video_resize 1 - -#define GLX_SYNC_FRAME_SGIX 0x00000000 -#define GLX_SYNC_SWAP_SGIX 0x00000001 - -typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); -typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); -typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); -typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); -typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); - -#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) -#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) -#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) -#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) -#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) - -#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) - -#endif /* GLX_SGIX_video_resize */ - -/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ - -#ifndef GLX_SGIX_visual_select_group -#define GLX_SGIX_visual_select_group 1 - -#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 - -#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) - -#endif /* GLX_SGIX_visual_select_group */ - -/* ---------------------------- GLX_SGI_cushion ---------------------------- */ - -#ifndef GLX_SGI_cushion -#define GLX_SGI_cushion 1 - -typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); - -#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) - -#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) - -#endif /* GLX_SGI_cushion */ - -/* ----------------------- GLX_SGI_make_current_read ----------------------- */ - -#ifndef GLX_SGI_make_current_read -#define GLX_SGI_make_current_read 1 - -typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); -typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); - -#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) -#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) - -#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) - -#endif /* GLX_SGI_make_current_read */ - -/* -------------------------- GLX_SGI_swap_control ------------------------- */ - -#ifndef GLX_SGI_swap_control -#define GLX_SGI_swap_control 1 - -typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); - -#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) - -#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) - -#endif /* GLX_SGI_swap_control */ - -/* --------------------------- GLX_SGI_video_sync -------------------------- */ - -#ifndef GLX_SGI_video_sync -#define GLX_SGI_video_sync 1 - -typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); -typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); - -#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) -#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) - -#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) - -#endif /* GLX_SGI_video_sync */ - -/* --------------------- GLX_SUN_get_transparent_index --------------------- */ - -#ifndef GLX_SUN_get_transparent_index -#define GLX_SUN_get_transparent_index 1 - -typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); - -#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) - -#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) - -#endif /* GLX_SUN_get_transparent_index */ - -/* -------------------------- GLX_SUN_video_resize ------------------------- */ - -#ifndef GLX_SUN_video_resize -#define GLX_SUN_video_resize 1 - -#define GLX_VIDEO_RESIZE_SUN 0x8171 -#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD - -typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); -typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); - -#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) -#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) - -#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) - -#endif /* GLX_SUN_video_resize */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX -#define GLXEW_FUN_EXPORT -#define GLXEW_VAR_EXPORT -#else -#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT -#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT -#endif /* GLEW_MX */ - -GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; - -GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; -GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; -GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; -GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; -GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; -GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; -GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; -GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; -GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; -GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; -GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; -GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; -GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; -GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; -GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; - -GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; - -GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; -GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; -GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; - -GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; -GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; -GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; -GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; - -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; - -GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; -GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; - -GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; - -GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; - -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; - -GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; - -GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; - -GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; - -GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; - -GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; -GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; -GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; -GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; -GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; -GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; - -GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; -GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; -GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; -GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; -GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; - -GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; -GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; -GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; -GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; -GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; - -GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; -GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; -GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; - -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; - -GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; -GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; -GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; - -GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; - -GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; -GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; - -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; - -GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; -GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; - -GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; - -GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; -GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; - -#if defined(GLEW_MX) -struct GLXEWContextStruct -{ -#endif /* GLEW_MX */ - -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; -GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; -GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; -GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; -GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; - -#ifdef GLEW_MX -}; /* GLXEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------ */ - -#ifdef GLEW_MX - -typedef struct GLXEWContextStruct GLXEWContext; -GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); - -#define glxewInit() glxewContextInit(glxewGetContext()) -#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) - -#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) -#define GLXEW_GET_FUN(x) x - -#else /* GLEW_MX */ - -#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) -#define GLXEW_GET_FUN(x) x - -GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); - -#ifdef __cplusplus -} -#endif - -#endif /* __glxew_h__ */ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include "glew.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef 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); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) + +#endif /* GLX_NV_video_out */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef 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); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLX_MIN_RED_SGIS 0 +#define GLX_MAX_GREEN_SGIS 0 +#define GLX_MIN_BLUE_SGIS 0 +#define GLX_MAX_ALPHA_SGIS 0 +#define GLX_MIN_GREEN_SGIS 0 +#define GLX_MIN_ALPHA_SGIS 0 +#define GLX_MAX_RED_SGIS 0 +#define GLX_EXTENDED_RANGE_SGIS 0 +#define GLX_MAX_BLUE_SGIS 0 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT +#else +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/examples/common/glew/wglew.h b/examples/common/glew/wglew.h index 6dc08cde..c0f59f56 100644 --- a/examples/common/glew/wglew.h +++ b/examples/common/glew/wglew.h @@ -1,1397 +1,1397 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __wglew_h__ -#define __wglew_h__ -#define __WGLEW_H__ - -#ifdef __wglext_h_ -#error wglext.h included before wglew.h -#endif - -#define __wglext_h_ - -#if !defined(WINAPI) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN 1 -# endif -#include -# undef WIN32_LEAN_AND_MEAN -#endif - -/* - * GLEW_STATIC needs to be set when using the static version. - * GLEW_BUILD is set when building the DLL version. - */ -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# ifdef GLEW_BUILD -# define GLEWAPI extern __declspec(dllexport) -# else -# define GLEWAPI extern __declspec(dllimport) -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------------------------- WGL_3DFX_multisample ------------------------- */ - -#ifndef WGL_3DFX_multisample -#define WGL_3DFX_multisample 1 - -#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 -#define WGL_SAMPLES_3DFX 0x2061 - -#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) - -#endif /* WGL_3DFX_multisample */ - -/* ------------------------- WGL_3DL_stereo_control ------------------------ */ - -#ifndef WGL_3DL_stereo_control -#define WGL_3DL_stereo_control 1 - -#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 -#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 -#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 -#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 - -typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); - -#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) - -#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) - -#endif /* WGL_3DL_stereo_control */ - -/* ------------------------ WGL_AMD_gpu_association ------------------------ */ - -#ifndef WGL_AMD_gpu_association -#define WGL_AMD_gpu_association 1 - -#define WGL_GPU_VENDOR_AMD 0x1F00 -#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 -#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 -#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 -#define WGL_GPU_RAM_AMD 0x21A3 -#define WGL_GPU_CLOCK_AMD 0x21A4 -#define WGL_GPU_NUM_PIPES_AMD 0x21A5 -#define WGL_GPU_NUM_SIMD_AMD 0x21A6 -#define WGL_GPU_NUM_RB_AMD 0x21A7 -#define WGL_GPU_NUM_SPI_AMD 0x21A8 - -typedef 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); -typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); -typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); -typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); -typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); -typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); -typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); -typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); -typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); - -#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) -#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) -#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) -#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) -#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) -#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) -#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) -#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) -#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) - -#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) - -#endif /* WGL_AMD_gpu_association */ - -/* ------------------------- WGL_ARB_buffer_region ------------------------- */ - -#ifndef WGL_ARB_buffer_region -#define WGL_ARB_buffer_region 1 - -#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 -#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 -#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 -#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 - -typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); -typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); -typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); -typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); - -#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) -#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) -#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) -#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) - -#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) - -#endif /* WGL_ARB_buffer_region */ - -/* ------------------------- WGL_ARB_create_context ------------------------ */ - -#ifndef WGL_ARB_create_context -#define WGL_ARB_create_context 1 - -#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 -#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 -#define WGL_CONTEXT_FLAGS_ARB 0x2094 -#define ERROR_INVALID_VERSION_ARB 0x2095 -#define ERROR_INVALID_PROFILE_ARB 0x2096 - -typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); - -#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) - -#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) - -#endif /* WGL_ARB_create_context */ - -/* --------------------- WGL_ARB_create_context_profile -------------------- */ - -#ifndef WGL_ARB_create_context_profile -#define WGL_ARB_create_context_profile 1 - -#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 -#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 -#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 - -#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) - -#endif /* WGL_ARB_create_context_profile */ - -/* ------------------- WGL_ARB_create_context_robustness ------------------- */ - -#ifndef WGL_ARB_create_context_robustness -#define WGL_ARB_create_context_robustness 1 - -#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 - -#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) - -#endif /* WGL_ARB_create_context_robustness */ - -/* ----------------------- WGL_ARB_extensions_string ----------------------- */ - -#ifndef WGL_ARB_extensions_string -#define WGL_ARB_extensions_string 1 - -typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); - -#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) - -#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) - -#endif /* WGL_ARB_extensions_string */ - -/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ - -#ifndef WGL_ARB_framebuffer_sRGB -#define WGL_ARB_framebuffer_sRGB 1 - -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 - -#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) - -#endif /* WGL_ARB_framebuffer_sRGB */ - -/* ----------------------- WGL_ARB_make_current_read ----------------------- */ - -#ifndef WGL_ARB_make_current_read -#define WGL_ARB_make_current_read 1 - -#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 -#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 - -typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); - -#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) -#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) - -#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) - -#endif /* WGL_ARB_make_current_read */ - -/* -------------------------- WGL_ARB_multisample -------------------------- */ - -#ifndef WGL_ARB_multisample -#define WGL_ARB_multisample 1 - -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 - -#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) - -#endif /* WGL_ARB_multisample */ - -/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ - -#ifndef WGL_ARB_pbuffer -#define WGL_ARB_pbuffer 1 - -#define WGL_DRAW_TO_PBUFFER_ARB 0x202D -#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E -#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 -#define WGL_PBUFFER_LARGEST_ARB 0x2033 -#define WGL_PBUFFER_WIDTH_ARB 0x2034 -#define WGL_PBUFFER_HEIGHT_ARB 0x2035 -#define WGL_PBUFFER_LOST_ARB 0x2036 - -DECLARE_HANDLE(HPBUFFERARB); - -typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); -typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); -typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); -typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); -typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); - -#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) -#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) -#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) -#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) -#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) - -#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) - -#endif /* WGL_ARB_pbuffer */ - -/* -------------------------- WGL_ARB_pixel_format ------------------------- */ - -#ifndef WGL_ARB_pixel_format -#define WGL_ARB_pixel_format 1 - -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_DRAW_TO_BITMAP_ARB 0x2002 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_NEED_PALETTE_ARB 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_NUMBER_OVERLAYS_ARB 0x2008 -#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 -#define WGL_TRANSPARENT_ARB 0x200A -#define WGL_SHARE_DEPTH_ARB 0x200C -#define WGL_SHARE_STENCIL_ARB 0x200D -#define WGL_SHARE_ACCUM_ARB 0x200E -#define WGL_SUPPORT_GDI_ARB 0x200F -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_STEREO_ARB 0x2012 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_RED_SHIFT_ARB 0x2016 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_GREEN_SHIFT_ARB 0x2018 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_BLUE_SHIFT_ARB 0x201A -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_ALPHA_SHIFT_ARB 0x201C -#define WGL_ACCUM_BITS_ARB 0x201D -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_AUX_BUFFERS_ARB 0x2024 -#define WGL_NO_ACCELERATION_ARB 0x2025 -#define WGL_GENERIC_ACCELERATION_ARB 0x2026 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_SWAP_EXCHANGE_ARB 0x2028 -#define WGL_SWAP_COPY_ARB 0x2029 -#define WGL_SWAP_UNDEFINED_ARB 0x202A -#define WGL_TYPE_RGBA_ARB 0x202B -#define WGL_TYPE_COLORINDEX_ARB 0x202C -#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 -#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 -#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 -#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A -#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B - -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); - -#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) -#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) -#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) - -#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) - -#endif /* WGL_ARB_pixel_format */ - -/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ - -#ifndef WGL_ARB_pixel_format_float -#define WGL_ARB_pixel_format_float 1 - -#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 - -#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) - -#endif /* WGL_ARB_pixel_format_float */ - -/* ------------------------- WGL_ARB_render_texture ------------------------ */ - -#ifndef WGL_ARB_render_texture -#define WGL_ARB_render_texture 1 - -#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 -#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 -#define WGL_TEXTURE_FORMAT_ARB 0x2072 -#define WGL_TEXTURE_TARGET_ARB 0x2073 -#define WGL_MIPMAP_TEXTURE_ARB 0x2074 -#define WGL_TEXTURE_RGB_ARB 0x2075 -#define WGL_TEXTURE_RGBA_ARB 0x2076 -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 -#define WGL_TEXTURE_1D_ARB 0x2079 -#define WGL_TEXTURE_2D_ARB 0x207A -#define WGL_MIPMAP_LEVEL_ARB 0x207B -#define WGL_CUBE_MAP_FACE_ARB 0x207C -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 -#define WGL_FRONT_LEFT_ARB 0x2083 -#define WGL_FRONT_RIGHT_ARB 0x2084 -#define WGL_BACK_LEFT_ARB 0x2085 -#define WGL_BACK_RIGHT_ARB 0x2086 -#define WGL_AUX0_ARB 0x2087 -#define WGL_AUX1_ARB 0x2088 -#define WGL_AUX2_ARB 0x2089 -#define WGL_AUX3_ARB 0x208A -#define WGL_AUX4_ARB 0x208B -#define WGL_AUX5_ARB 0x208C -#define WGL_AUX6_ARB 0x208D -#define WGL_AUX7_ARB 0x208E -#define WGL_AUX8_ARB 0x208F -#define WGL_AUX9_ARB 0x2090 - -typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); - -#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) -#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) -#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) - -#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) - -#endif /* WGL_ARB_render_texture */ - -/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ - -#ifndef WGL_ATI_pixel_format_float -#define WGL_ATI_pixel_format_float 1 - -#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 - -#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) - -#endif /* WGL_ATI_pixel_format_float */ - -/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ - -#ifndef WGL_ATI_render_texture_rectangle -#define WGL_ATI_render_texture_rectangle 1 - -#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 - -#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) - -#endif /* WGL_ATI_render_texture_rectangle */ - -/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ - -#ifndef WGL_EXT_create_context_es2_profile -#define WGL_EXT_create_context_es2_profile 1 - -#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 - -#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) - -#endif /* WGL_EXT_create_context_es2_profile */ - -/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ - -#ifndef WGL_EXT_create_context_es_profile -#define WGL_EXT_create_context_es_profile 1 - -#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 - -#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) - -#endif /* WGL_EXT_create_context_es_profile */ - -/* -------------------------- WGL_EXT_depth_float -------------------------- */ - -#ifndef WGL_EXT_depth_float -#define WGL_EXT_depth_float 1 - -#define WGL_DEPTH_FLOAT_EXT 0x2040 - -#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) - -#endif /* WGL_EXT_depth_float */ - -/* ---------------------- WGL_EXT_display_color_table ---------------------- */ - -#ifndef WGL_EXT_display_color_table -#define WGL_EXT_display_color_table 1 - -typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); - -#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) -#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) -#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) -#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) - -#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) - -#endif /* WGL_EXT_display_color_table */ - -/* ----------------------- WGL_EXT_extensions_string ----------------------- */ - -#ifndef WGL_EXT_extensions_string -#define WGL_EXT_extensions_string 1 - -typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); - -#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) - -#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) - -#endif /* WGL_EXT_extensions_string */ - -/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ - -#ifndef WGL_EXT_framebuffer_sRGB -#define WGL_EXT_framebuffer_sRGB 1 - -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 - -#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) - -#endif /* WGL_EXT_framebuffer_sRGB */ - -/* ----------------------- WGL_EXT_make_current_read ----------------------- */ - -#ifndef WGL_EXT_make_current_read -#define WGL_EXT_make_current_read 1 - -#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 - -typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); - -#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) -#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) - -#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) - -#endif /* WGL_EXT_make_current_read */ - -/* -------------------------- WGL_EXT_multisample -------------------------- */ - -#ifndef WGL_EXT_multisample -#define WGL_EXT_multisample 1 - -#define WGL_SAMPLE_BUFFERS_EXT 0x2041 -#define WGL_SAMPLES_EXT 0x2042 - -#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) - -#endif /* WGL_EXT_multisample */ - -/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ - -#ifndef WGL_EXT_pbuffer -#define WGL_EXT_pbuffer 1 - -#define WGL_DRAW_TO_PBUFFER_EXT 0x202D -#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E -#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 -#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 -#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 -#define WGL_PBUFFER_LARGEST_EXT 0x2033 -#define WGL_PBUFFER_WIDTH_EXT 0x2034 -#define WGL_PBUFFER_HEIGHT_EXT 0x2035 - -DECLARE_HANDLE(HPBUFFEREXT); - -typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); -typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); -typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); -typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); -typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); - -#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) -#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) -#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) -#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) -#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) - -#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) - -#endif /* WGL_EXT_pbuffer */ - -/* -------------------------- WGL_EXT_pixel_format ------------------------- */ - -#ifndef WGL_EXT_pixel_format -#define WGL_EXT_pixel_format 1 - -#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 -#define WGL_DRAW_TO_WINDOW_EXT 0x2001 -#define WGL_DRAW_TO_BITMAP_EXT 0x2002 -#define WGL_ACCELERATION_EXT 0x2003 -#define WGL_NEED_PALETTE_EXT 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 -#define WGL_SWAP_METHOD_EXT 0x2007 -#define WGL_NUMBER_OVERLAYS_EXT 0x2008 -#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 -#define WGL_TRANSPARENT_EXT 0x200A -#define WGL_TRANSPARENT_VALUE_EXT 0x200B -#define WGL_SHARE_DEPTH_EXT 0x200C -#define WGL_SHARE_STENCIL_EXT 0x200D -#define WGL_SHARE_ACCUM_EXT 0x200E -#define WGL_SUPPORT_GDI_EXT 0x200F -#define WGL_SUPPORT_OPENGL_EXT 0x2010 -#define WGL_DOUBLE_BUFFER_EXT 0x2011 -#define WGL_STEREO_EXT 0x2012 -#define WGL_PIXEL_TYPE_EXT 0x2013 -#define WGL_COLOR_BITS_EXT 0x2014 -#define WGL_RED_BITS_EXT 0x2015 -#define WGL_RED_SHIFT_EXT 0x2016 -#define WGL_GREEN_BITS_EXT 0x2017 -#define WGL_GREEN_SHIFT_EXT 0x2018 -#define WGL_BLUE_BITS_EXT 0x2019 -#define WGL_BLUE_SHIFT_EXT 0x201A -#define WGL_ALPHA_BITS_EXT 0x201B -#define WGL_ALPHA_SHIFT_EXT 0x201C -#define WGL_ACCUM_BITS_EXT 0x201D -#define WGL_ACCUM_RED_BITS_EXT 0x201E -#define WGL_ACCUM_GREEN_BITS_EXT 0x201F -#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 -#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 -#define WGL_DEPTH_BITS_EXT 0x2022 -#define WGL_STENCIL_BITS_EXT 0x2023 -#define WGL_AUX_BUFFERS_EXT 0x2024 -#define WGL_NO_ACCELERATION_EXT 0x2025 -#define WGL_GENERIC_ACCELERATION_EXT 0x2026 -#define WGL_FULL_ACCELERATION_EXT 0x2027 -#define WGL_SWAP_EXCHANGE_EXT 0x2028 -#define WGL_SWAP_COPY_EXT 0x2029 -#define WGL_SWAP_UNDEFINED_EXT 0x202A -#define WGL_TYPE_RGBA_EXT 0x202B -#define WGL_TYPE_COLORINDEX_EXT 0x202C - -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); - -#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) -#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) -#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) - -#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) - -#endif /* WGL_EXT_pixel_format */ - -/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ - -#ifndef WGL_EXT_pixel_format_packed_float -#define WGL_EXT_pixel_format_packed_float 1 - -#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 - -#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) - -#endif /* WGL_EXT_pixel_format_packed_float */ - -/* -------------------------- WGL_EXT_swap_control ------------------------- */ - -#ifndef WGL_EXT_swap_control -#define WGL_EXT_swap_control 1 - -typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); -typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); - -#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) -#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) - -#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) - -#endif /* WGL_EXT_swap_control */ - -/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ - -#ifndef WGL_EXT_swap_control_tear -#define WGL_EXT_swap_control_tear 1 - -#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) - -#endif /* WGL_EXT_swap_control_tear */ - -/* --------------------- WGL_I3D_digital_video_control --------------------- */ - -#ifndef WGL_I3D_digital_video_control -#define WGL_I3D_digital_video_control 1 - -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 -#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 -#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 - -typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); - -#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) -#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) - -#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) - -#endif /* WGL_I3D_digital_video_control */ - -/* ----------------------------- WGL_I3D_gamma ----------------------------- */ - -#ifndef WGL_I3D_gamma -#define WGL_I3D_gamma 1 - -#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E -#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F - -typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); -typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); -typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); - -#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) -#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) -#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) -#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) - -#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) - -#endif /* WGL_I3D_gamma */ - -/* ---------------------------- WGL_I3D_genlock ---------------------------- */ - -#ifndef WGL_I3D_genlock -#define WGL_I3D_genlock 1 - -#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 -#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 -#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 -#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 -#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 -#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 -#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A -#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B -#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C - -typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); -typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); -typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); - -#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) -#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) -#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) -#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) -#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) -#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) -#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) -#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) -#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) -#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) -#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) -#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) - -#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) - -#endif /* WGL_I3D_genlock */ - -/* -------------------------- WGL_I3D_image_buffer ------------------------- */ - -#ifndef WGL_I3D_image_buffer -#define WGL_I3D_image_buffer 1 - -#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 -#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 - -typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); -typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); -typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); -typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); - -#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) -#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) -#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) -#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) - -#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) - -#endif /* WGL_I3D_image_buffer */ - -/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ - -#ifndef WGL_I3D_swap_frame_lock -#define WGL_I3D_swap_frame_lock 1 - -typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); - -#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) -#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) -#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) -#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) - -#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) - -#endif /* WGL_I3D_swap_frame_lock */ - -/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ - -#ifndef WGL_I3D_swap_frame_usage -#define WGL_I3D_swap_frame_usage 1 - -typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); -typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); -typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); - -#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) -#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) -#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) -#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) - -#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) - -#endif /* WGL_I3D_swap_frame_usage */ - -/* --------------------------- WGL_NV_DX_interop --------------------------- */ - -#ifndef WGL_NV_DX_interop -#define WGL_NV_DX_interop 1 - -#define WGL_ACCESS_READ_ONLY_NV 0x0000 -#define WGL_ACCESS_READ_WRITE_NV 0x0001 -#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 - -typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); -typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); -typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); -typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); -typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); -typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); -typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); -typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); - -#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) -#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) -#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) -#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) -#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) -#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) -#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) -#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) - -#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) - -#endif /* WGL_NV_DX_interop */ - -/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ - -#ifndef WGL_NV_DX_interop2 -#define WGL_NV_DX_interop2 1 - -#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) - -#endif /* WGL_NV_DX_interop2 */ - -/* --------------------------- WGL_NV_copy_image --------------------------- */ - -#ifndef WGL_NV_copy_image -#define WGL_NV_copy_image 1 - -typedef 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); - -#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) - -#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) - -#endif /* WGL_NV_copy_image */ - -/* -------------------------- WGL_NV_float_buffer -------------------------- */ - -#ifndef WGL_NV_float_buffer -#define WGL_NV_float_buffer 1 - -#define WGL_FLOAT_COMPONENTS_NV 0x20B0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 -#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 -#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 -#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 -#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 - -#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) - -#endif /* WGL_NV_float_buffer */ - -/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ - -#ifndef WGL_NV_gpu_affinity -#define WGL_NV_gpu_affinity 1 - -#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 -#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 - -DECLARE_HANDLE(HGPUNV); -typedef struct _GPU_DEVICE { - DWORD cb; - CHAR DeviceName[32]; - CHAR DeviceString[128]; - DWORD Flags; - RECT rcVirtualScreen; -} GPU_DEVICE, *PGPU_DEVICE; - -typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); -typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); -typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); -typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); -typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); - -#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) -#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) -#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) -#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) -#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) - -#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) - -#endif /* WGL_NV_gpu_affinity */ - -/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ - -#ifndef WGL_NV_multisample_coverage -#define WGL_NV_multisample_coverage 1 - -#define WGL_COVERAGE_SAMPLES_NV 0x2042 -#define WGL_COLOR_SAMPLES_NV 0x20B9 - -#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) - -#endif /* WGL_NV_multisample_coverage */ - -/* -------------------------- WGL_NV_present_video ------------------------- */ - -#ifndef WGL_NV_present_video -#define WGL_NV_present_video 1 - -#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 - -DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); -typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); -typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); - -#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) -#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) -#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) - -#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) - -#endif /* WGL_NV_present_video */ - -/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ - -#ifndef WGL_NV_render_depth_texture -#define WGL_NV_render_depth_texture 1 - -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 -#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 -#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 -#define WGL_DEPTH_COMPONENT_NV 0x20A7 - -#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) - -#endif /* WGL_NV_render_depth_texture */ - -/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ - -#ifndef WGL_NV_render_texture_rectangle -#define WGL_NV_render_texture_rectangle 1 - -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 -#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 - -#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) - -#endif /* WGL_NV_render_texture_rectangle */ - -/* --------------------------- WGL_NV_swap_group --------------------------- */ - -#ifndef WGL_NV_swap_group -#define WGL_NV_swap_group 1 - -typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); -typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); -typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); -typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); -typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); - -#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) -#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) -#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) -#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) -#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) -#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) - -#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) - -#endif /* WGL_NV_swap_group */ - -/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ - -#ifndef WGL_NV_vertex_array_range -#define WGL_NV_vertex_array_range 1 - -typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); -typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); - -#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) -#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) - -#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) - -#endif /* WGL_NV_vertex_array_range */ - -/* -------------------------- WGL_NV_video_capture ------------------------- */ - -#ifndef WGL_NV_video_capture -#define WGL_NV_video_capture 1 - -#define WGL_UNIQUE_ID_NV 0x20CE -#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF - -DECLARE_HANDLE(HVIDEOINPUTDEVICENV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); -typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); -typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); -typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); - -#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) -#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) -#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) -#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) -#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) - -#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) - -#endif /* WGL_NV_video_capture */ - -/* -------------------------- WGL_NV_video_output -------------------------- */ - -#ifndef WGL_NV_video_output -#define WGL_NV_video_output 1 - -#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 -#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 -#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 -#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 -#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 -#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 -#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define WGL_VIDEO_OUT_FRAME 0x20C8 -#define WGL_VIDEO_OUT_FIELD_1 0x20C9 -#define WGL_VIDEO_OUT_FIELD_2 0x20CA -#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB -#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC - -DECLARE_HANDLE(HPVIDEODEV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); -typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); - -#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) -#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) -#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) -#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) -#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) -#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) - -#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) - -#endif /* WGL_NV_video_output */ - -/* -------------------------- WGL_OML_sync_control ------------------------- */ - -#ifndef WGL_OML_sync_control -#define WGL_OML_sync_control 1 - -typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); -typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); -typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); -typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); - -#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) -#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) -#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) -#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) -#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) -#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) - -#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) - -#endif /* WGL_OML_sync_control */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX -#define WGLEW_FUN_EXPORT -#define WGLEW_VAR_EXPORT -#else -#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT -#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT -#endif /* GLEW_MX */ - -#ifdef GLEW_MX -struct WGLEWContextStruct -{ -#endif /* GLEW_MX */ - -WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; - -WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; -WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; -WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; -WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; -WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; -WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; - -WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; - -WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; - -WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; - -WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; -WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; - -WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; -WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; -WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; -WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; -WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; - -WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; - -WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; -WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; -WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; - -WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; - -WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; - -WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; -WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; - -WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; -WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; -WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; -WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; -WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; - -WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; - -WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; -WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; - -WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; -WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; - -WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; -WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; -WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; -WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; - -WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; -WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; - -WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; -WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; -WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; -WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; - -WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; - -WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; -WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; -WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; - -WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; -WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; -WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; -WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; -WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; -WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; -WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; -WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; - -WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; - -WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; -WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; -WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; - -WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; -WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; -WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; -WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; -WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; - -WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; -WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; -WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; -WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; -WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; - -WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; -WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; -WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; -WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; -WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; -WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; -WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; -WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; - -#ifdef GLEW_MX -}; /* WGLEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX - -typedef struct WGLEWContextStruct WGLEWContext; -GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); - -#define wglewInit() wglewContextInit(wglewGetContext()) -#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) - -#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) -#define WGLEW_GET_FUN(x) wglewGetContext()->x - -#else /* GLEW_MX */ - -#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) -#define WGLEW_GET_FUN(x) x - -GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); - -#ifdef __cplusplus -} -#endif - -#undef GLEWAPI - -#endif /* __wglew_h__ */ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef 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); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef 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); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 7c37c32e..392503b8 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,86 +1,86 @@ -# Copyright (c) 2008-2012 Matt Williams -# Copyright (c) 2008-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(PolyVox) - -add_subdirectory(PolyVoxCore) -add_subdirectory(PolyVoxUtil) -add_subdirectory(bindings) - -#Set up install paths e.g. for PolyVoxConfig.cmake -if(WIN32) - set(CONFIG_FILE_DIR "CMake") - set(PolyVoxCore_LIBRARY_INSTALL_DIRS "PolyVoxCore/lib") - set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "PolyVoxUtil/lib") - set(PolyVoxCore_INCLUDE_INSTALL_DIRS "PolyVoxCore/include") - set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "PolyVoxUtil/include") - set(PolyVox_DOC_INSTALL_DIR "PolyVox/doc") -else(WIN32) - set(CONFIG_FILE_DIR "share/PolyVox/cmake") - set(PolyVoxCore_LIBRARY_INSTALL_DIRS "lib") - set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "lib") - set(PolyVoxCore_INCLUDE_INSTALL_DIRS "include/PolyVoxCore") - set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "include/PolyVoxUtil") - set(PolyVox_DOC_INSTALL_DIR "share/doc/packages/polyvox") -endif(WIN32) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR} COMPONENT development) - -if(DOXYGEN_FOUND) - #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.css ${CMAKE_CURRENT_BINARY_DIR}/polyvox.css) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - #This is just the default doc target which only runs Doxygen - add_custom_target(doc - COMMAND ${DOXYGEN_EXECUTABLE} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Building documentation" - SOURCES Doxyfile.in polyvox.qhcp.in Mainpage.dox - VERBATIM - ) - set_target_properties(doc PROPERTIES PROJECT_LABEL "API Reference") #Set label seen in IDE - set_property(TARGET doc PROPERTY FOLDER "Documentation") - - #If we found qcollectiongenerator then do more processing - if(QT_QCOLLECTIONGENERATOR_EXECUTABLE) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.qhcp.in ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qhcp) #The QtHelp config file - - #We attach this command to the doc target so it will be run automatically - add_custom_command(TARGET doc POST_BUILD - COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} polyvox.qhcp -o polyvox.qhc - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp - COMMENT "Compiling API documentation to Qt Help format" - ) - - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qhc - ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qch - DESTINATION ${PolyVox_DOC_INSTALL_DIR}/qthelp - COMPONENT development - OPTIONAL - ) - endif() -endif() - -#add_subdirectory(bindings) +# Copyright (c) 2008-2012 Matt Williams +# Copyright (c) 2008-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(PolyVox) + +add_subdirectory(PolyVoxCore) +add_subdirectory(PolyVoxUtil) +add_subdirectory(bindings) + +#Set up install paths e.g. for PolyVoxConfig.cmake +if(WIN32) + set(CONFIG_FILE_DIR "CMake") + set(PolyVoxCore_LIBRARY_INSTALL_DIRS "PolyVoxCore/lib") + set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "PolyVoxUtil/lib") + set(PolyVoxCore_INCLUDE_INSTALL_DIRS "PolyVoxCore/include") + set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "PolyVoxUtil/include") + set(PolyVox_DOC_INSTALL_DIR "PolyVox/doc") +else(WIN32) + set(CONFIG_FILE_DIR "share/PolyVox/cmake") + set(PolyVoxCore_LIBRARY_INSTALL_DIRS "lib") + set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "lib") + set(PolyVoxCore_INCLUDE_INSTALL_DIRS "include/PolyVoxCore") + set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "include/PolyVoxUtil") + set(PolyVox_DOC_INSTALL_DIR "share/doc/packages/polyvox") +endif(WIN32) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR} COMPONENT development) + +if(DOXYGEN_FOUND) + #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.css ${CMAKE_CURRENT_BINARY_DIR}/polyvox.css) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + #This is just the default doc target which only runs Doxygen + add_custom_target(doc + COMMAND ${DOXYGEN_EXECUTABLE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building documentation" + SOURCES Doxyfile.in polyvox.qhcp.in Mainpage.dox + VERBATIM + ) + set_target_properties(doc PROPERTIES PROJECT_LABEL "API Reference") #Set label seen in IDE + set_property(TARGET doc PROPERTY FOLDER "Documentation") + + #If we found qcollectiongenerator then do more processing + if(QT_QCOLLECTIONGENERATOR_EXECUTABLE) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.qhcp.in ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qhcp) #The QtHelp config file + + #We attach this command to the doc target so it will be run automatically + add_custom_command(TARGET doc POST_BUILD + COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} polyvox.qhcp -o polyvox.qhc + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp + COMMENT "Compiling API documentation to Qt Help format" + ) + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qhc + ${CMAKE_CURRENT_BINARY_DIR}/doc/qthelp/polyvox.qch + DESTINATION ${PolyVox_DOC_INSTALL_DIR}/qthelp + COMPONENT development + OPTIONAL + ) + endif() +endif() + +#add_subdirectory(bindings) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 42d8c752..35478777 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -1,164 +1,164 @@ -# Copyright (c) 2008-2012 Matt Williams -# Copyright (c) 2008-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -PROJECT(PolyVoxCore) - -#Projects source files -SET(CORE_SRC_FILES - source/AStarPathfinder.cpp - source/Region.cpp -) - -#Projects headers files -SET(CORE_INC_FILES - include/PolyVoxCore/AmbientOcclusionCalculator.h - include/PolyVoxCore/AmbientOcclusionCalculator.inl - include/PolyVoxCore/Array.h - include/PolyVoxCore/AStarPathfinder.h - include/PolyVoxCore/AStarPathfinder.inl - include/PolyVoxCore/BaseVolume.h - include/PolyVoxCore/BaseVolume.inl - include/PolyVoxCore/BaseVolumeSampler.inl - include/PolyVoxCore/CubicSurfaceExtractor.h - include/PolyVoxCore/CubicSurfaceExtractor.inl - include/PolyVoxCore/DefaultIsQuadNeeded.h - include/PolyVoxCore/DefaultMarchingCubesController.h - include/PolyVoxCore/Density.h - include/PolyVoxCore/FilePager.h - include/PolyVoxCore/GradientEstimators.h - include/PolyVoxCore/GradientEstimators.inl - include/PolyVoxCore/Interpolation.h - include/PolyVoxCore/IteratorController.h - include/PolyVoxCore/IteratorController.inl - include/PolyVoxCore/LargeVolume.h - include/PolyVoxCore/LowPassFilter.h - include/PolyVoxCore/LowPassFilter.inl - include/PolyVoxCore/MarchingCubesSurfaceExtractor.h - include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl - include/PolyVoxCore/Material.h - include/PolyVoxCore/MaterialDensityPair.h - include/PolyVoxCore/Mesh.h - include/PolyVoxCore/Mesh.inl - include/PolyVoxCore/PagedVolume.h - include/PolyVoxCore/PagedVolume.inl - include/PolyVoxCore/PagedVolumeChunk.inl - include/PolyVoxCore/PagedVolumeSampler.inl - include/PolyVoxCore/PolyVoxForwardDeclarations.h - include/PolyVoxCore/Picking.h - include/PolyVoxCore/Picking.inl - include/PolyVoxCore/RawVolume.h - include/PolyVoxCore/RawVolume.inl - include/PolyVoxCore/RawVolumeSampler.inl - include/PolyVoxCore/Raycast.h - include/PolyVoxCore/Raycast.inl - include/PolyVoxCore/Region.h - include/PolyVoxCore/SimpleVolume.h - include/PolyVoxCore/Vector.h - include/PolyVoxCore/Vector.inl - include/PolyVoxCore/Vertex.h - include/PolyVoxCore/VolumeResampler.h - include/PolyVoxCore/VolumeResampler.inl - include/PolyVoxCore/VoxelFilters.h - include/PolyVoxCore/VoxelFilters.inl -) - -SET(IMPL_SRC_FILES - source/Impl/ErrorHandling.cpp - source/Impl/Logging.cpp - source/Impl/MarchingCubesTables.cpp - source/Impl/RandomUnitVectors.cpp - source/Impl/RandomVectors.cpp - source/Impl/Timer.cpp - source/Impl/Utility.cpp -) - -SET(IMPL_INC_FILES - include/PolyVoxCore/Impl/AStarPathfinderImpl.h - include/PolyVoxCore/Impl/Config.h - include/PolyVoxCore/Impl/ErrorHandling.h - include/PolyVoxCore/Impl/Logging.h - include/PolyVoxCore/Impl/MarchingCubesTables.h - include/PolyVoxCore/Impl/RandomUnitVectors.h - include/PolyVoxCore/Impl/RandomVectors.h - include/PolyVoxCore/Impl/Timer.h - include/PolyVoxCore/Impl/TypeDef.h - include/PolyVoxCore/Impl/Utility.h -) - -#NOTE: The following line should be uncommented when building shared libs. - -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) -SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) - -SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) -SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) - -#Tell CMake the paths -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) - -#Core -#Build -IF(LIBRARY_TYPE STREQUAL "STATIC") - ADD_LIBRARY(PolyVoxCore STATIC ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) - IF(UNIX) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF() -ENDIF() -IF(LIBRARY_TYPE STREQUAL "DYNAMIC") - ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") -ENDIF() -SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") - -SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) -IF(MSVC) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/W4 /wd4251") #Disable warning on STL exports -ENDIF(MSVC) - -#Install -IF(WIN32) - INSTALL(TARGETS PolyVoxCore - RUNTIME DESTINATION PolyVoxCore/bin COMPONENT library - LIBRARY DESTINATION PolyVoxCore/lib COMPONENT library - ARCHIVE DESTINATION PolyVoxCore/lib COMPONENT library - ) - - #Install the core header files, including the ones in the Impl subfolder. - INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) - - #On windows, we also install the debug information. It's unfortunate that we have to hard-code - #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I - #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS RelWithDebInfo) -ELSE(WIN32) - INSTALL(TARGETS PolyVoxCore - RUNTIME DESTINATION bin COMPONENT library - LIBRARY DESTINATION lib COMPONENT library - ARCHIVE DESTINATION lib COMPONENT library - ) - - #Install the core header files, including the ones in the Impl subfolder. - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) -ENDIF(WIN32) +# Copyright (c) 2008-2012 Matt Williams +# Copyright (c) 2008-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +PROJECT(PolyVoxCore) + +#Projects source files +SET(CORE_SRC_FILES + source/AStarPathfinder.cpp + source/Region.cpp +) + +#Projects headers files +SET(CORE_INC_FILES + include/PolyVoxCore/AmbientOcclusionCalculator.h + include/PolyVoxCore/AmbientOcclusionCalculator.inl + include/PolyVoxCore/Array.h + include/PolyVoxCore/AStarPathfinder.h + include/PolyVoxCore/AStarPathfinder.inl + include/PolyVoxCore/BaseVolume.h + include/PolyVoxCore/BaseVolume.inl + include/PolyVoxCore/BaseVolumeSampler.inl + include/PolyVoxCore/CubicSurfaceExtractor.h + include/PolyVoxCore/CubicSurfaceExtractor.inl + include/PolyVoxCore/DefaultIsQuadNeeded.h + include/PolyVoxCore/DefaultMarchingCubesController.h + include/PolyVoxCore/Density.h + include/PolyVoxCore/FilePager.h + include/PolyVoxCore/GradientEstimators.h + include/PolyVoxCore/GradientEstimators.inl + include/PolyVoxCore/Interpolation.h + include/PolyVoxCore/IteratorController.h + include/PolyVoxCore/IteratorController.inl + include/PolyVoxCore/LargeVolume.h + include/PolyVoxCore/LowPassFilter.h + include/PolyVoxCore/LowPassFilter.inl + include/PolyVoxCore/MarchingCubesSurfaceExtractor.h + include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl + include/PolyVoxCore/Material.h + include/PolyVoxCore/MaterialDensityPair.h + include/PolyVoxCore/Mesh.h + include/PolyVoxCore/Mesh.inl + include/PolyVoxCore/PagedVolume.h + include/PolyVoxCore/PagedVolume.inl + include/PolyVoxCore/PagedVolumeChunk.inl + include/PolyVoxCore/PagedVolumeSampler.inl + include/PolyVoxCore/PolyVoxForwardDeclarations.h + include/PolyVoxCore/Picking.h + include/PolyVoxCore/Picking.inl + include/PolyVoxCore/RawVolume.h + include/PolyVoxCore/RawVolume.inl + include/PolyVoxCore/RawVolumeSampler.inl + include/PolyVoxCore/Raycast.h + include/PolyVoxCore/Raycast.inl + include/PolyVoxCore/Region.h + include/PolyVoxCore/SimpleVolume.h + include/PolyVoxCore/Vector.h + include/PolyVoxCore/Vector.inl + include/PolyVoxCore/Vertex.h + include/PolyVoxCore/VolumeResampler.h + include/PolyVoxCore/VolumeResampler.inl + include/PolyVoxCore/VoxelFilters.h + include/PolyVoxCore/VoxelFilters.inl +) + +SET(IMPL_SRC_FILES + source/Impl/ErrorHandling.cpp + source/Impl/Logging.cpp + source/Impl/MarchingCubesTables.cpp + source/Impl/RandomUnitVectors.cpp + source/Impl/RandomVectors.cpp + source/Impl/Timer.cpp + source/Impl/Utility.cpp +) + +SET(IMPL_INC_FILES + include/PolyVoxCore/Impl/AStarPathfinderImpl.h + include/PolyVoxCore/Impl/Config.h + include/PolyVoxCore/Impl/ErrorHandling.h + include/PolyVoxCore/Impl/Logging.h + include/PolyVoxCore/Impl/MarchingCubesTables.h + include/PolyVoxCore/Impl/RandomUnitVectors.h + include/PolyVoxCore/Impl/RandomVectors.h + include/PolyVoxCore/Impl/Timer.h + include/PolyVoxCore/Impl/TypeDef.h + include/PolyVoxCore/Impl/Utility.h +) + +#NOTE: The following line should be uncommented when building shared libs. + +#"Sources" and "Headers" are the group names in Visual Studio. +#They may have other uses too... +SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) +SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) + +SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) +SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) + +#Tell CMake the paths +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) + +#Core +#Build +IF(LIBRARY_TYPE STREQUAL "STATIC") + ADD_LIBRARY(PolyVoxCore STATIC ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) + IF(UNIX) + SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) + ENDIF() +ENDIF() +IF(LIBRARY_TYPE STREQUAL "DYNAMIC") + ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) + SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") +ENDIF() +SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") + +SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) +IF(MSVC) + SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/W4 /wd4251") #Disable warning on STL exports +ENDIF(MSVC) + +#Install +IF(WIN32) + INSTALL(TARGETS PolyVoxCore + RUNTIME DESTINATION PolyVoxCore/bin COMPONENT library + LIBRARY DESTINATION PolyVoxCore/lib COMPONENT library + ARCHIVE DESTINATION PolyVoxCore/lib COMPONENT library + ) + + #Install the core header files, including the ones in the Impl subfolder. + INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) + + #On windows, we also install the debug information. It's unfortunate that we have to hard-code + #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I + #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS RelWithDebInfo) +ELSE(WIN32) + INSTALL(TARGETS PolyVoxCore + RUNTIME DESTINATION bin COMPONENT library + LIBRARY DESTINATION lib COMPONENT library + ARCHIVE DESTINATION lib COMPONENT library + ) + + #Install the core header files, including the ones in the Impl subfolder. + INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) +ENDIF(WIN32) diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index 88b22374..dce2aaf7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -1,195 +1,195 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_AStarPathfinder_H__ -#define __PolyVox_AStarPathfinder_H__ - -#include "Impl/AStarPathfinderImpl.h" -#include "Impl/TypeDef.h" - -#include -#include -#include //For runtime_error - -namespace PolyVox -{ - const float sqrt_1 = 1.0f; - const float sqrt_2 = 1.4143f; - const float sqrt_3 = 1.7321f; - - extern const POLYVOX_API Vector3DInt32 arrayPathfinderFaces[6]; - extern const POLYVOX_API Vector3DInt32 arrayPathfinderEdges[12]; - extern const POLYVOX_API Vector3DInt32 arrayPathfinderCorners[8]; - - /// This function provides the default method for checking whether a given voxel - /// is valid for the path computed by the AStarPathfinder. - template - bool aStarDefaultVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos); - - /// Provides a configuration for the AStarPathfinder. - //////////////////////////////////////////////////////////////////////////////// - /// This structure stores the AStarPathfinder%s configuration options, because this - /// is simpler than providing a large number of get/set properties within the - /// AStarPathfinder itself. In order to create an instance of this structure you - /// must provide at least a volume, a start and end point, and a list to store - /// the result. All the other option have sensible default values which can - /// optionally be changed for more precise control over the pathfinder's behaviour. - /// - /// \sa AStarPathfinder - //////////////////////////////////////////////////////////////////////////////// - template - struct AStarPathfinderParams - { - public: - AStarPathfinderParams - ( - VolumeType* volData, - const Vector3DInt32& v3dStart, - const Vector3DInt32& v3dEnd, - std::list* listResult, - float fHBias = 1.0, - uint32_t uMaxNoOfNodes = 10000, - Connectivity requiredConnectivity = TwentySixConnected, - std::function funcIsVoxelValidForPath = &aStarDefaultVoxelValidator, - std::function funcProgressCallback = nullptr - ) - :volume(volData) - ,start(v3dStart) - ,end(v3dEnd) - ,result(listResult) - ,connectivity(requiredConnectivity) - ,hBias(fHBias) - ,maxNumberOfNodes(uMaxNoOfNodes) - ,isVoxelValidForPath(funcIsVoxelValidForPath) - ,progressCallback(funcProgressCallback) - { - } - - /// This is the volume through which the AStarPathfinder must find a path. - VolumeType* volume; - - /// The start point for the pathfinding algorithm. - Vector3DInt32 start; - - /// The end point for the pathfinding algorithm. - Vector3DInt32 end; - - /// The resulting path will be stored as a series of points in - /// this list. Any existing contents will be cleared. - std::list* result; - - /// The AStarPathfinder performs its search by examining the neighbours - /// of each voxel it encounters. This property controls the meaning of - /// neighbour - e.g. whether two voxels must share a face, edge, or corner. - Connectivity connectivity; - - /// For each voxel the pathfinder tracks its distance to the start (known as g()) - /// and estimates its distance to the end (known as h()). Increasing or decreasing - /// h() has an effect on the way the pathfinder behaves. If h() is an underestimate - /// of the true distance then the pathfinder will act more like a greedy search - - /// always finding the shortest path but taking longer to do so. If h() is an over - /// estimate then the pathfinder will behave more like a best-first search - returning - /// a potentially suboptimal path but finding it more quickly. The hBias is multiplied - /// by the estimated h() value to control this behaviour. - float hBias; - - /// Volumes can be pretty huge (millions of voxels) and processing each one of these - /// can take a long time. In A* terminology each voxel is a node, and this property - /// controls the maximum number of nodes that will be considered when finding the path, - /// before giving up and throwing an exception because a path can't be found. - uint32_t maxNumberOfNodes; - - /// This function is called to determine whether the path can pass though a given voxel. The - /// default behaviour is specified by aStarDefaultVoxelValidator(), but users can specify thier - /// own criteria if desired. For example, if you always want a path to follow a surface then - /// you could check to ensure that the voxel above is empty and the voxel below is solid. - /// - /// \sa aStarDefaultVoxelValidator - std::function isVoxelValidForPath; - - /// This function is called by the AStarPathfinder to report on its progress in getting to - /// the goal. The progress is reported by computing the distance from the closest node found - /// so far to the end node, and comparing this with the distance from the start node to the - /// end node. This progress value is guarenteed to never decrease, but it may stop increasing - ///for short periods of time. It may even stop increasing altogether if a path cannot be found. - std::function progressCallback; - }; - - /// The AStarPathfinder compute a path from one point in the volume to another. - //////////////////////////////////////////////////////////////////////////////// - /// A* is a well known pathfinding algorithm commonly used in computer games. It - /// takes as input a pair of points in the world, and works out a path between - /// them which avoids obstacles and adheres to other user defined criteria. The - /// resulting path is usually the shortest possible, but a less optimal path can - /// be exchanged for reduced computation time. - /// - /// For an excellent overview of the A* algorithm please see Amit Patel's Game - /// Programming page here: http://theory.stanford.edu/~amitp/GameProgramming/ - /// Much of this class is based on the principles described in those pages. - /// - /// Usage of this class if very strightforward. You create an instance of it - /// by passing an instance of the AStarPathfinderParams structure to the constructor. - /// The details of the AStarPathfinderParams and the options it provides are described - /// in the documentation for that class. - /// - /// Next you call the execute() function and wait for it to return. If a path is - /// found then this is stored in the list which was set as the 'result' field of - /// the AStarPathfinderParams. If a path cannot be found then an exception of type - /// std::runtime_error is thrown. - /// - /// \sa AStarPathfinderParams - //////////////////////////////////////////////////////////////////////////////// - template - class AStarPathfinder - { - public: - AStarPathfinder(const AStarPathfinderParams& params); - - void execute(); - - private: - void processNeighbour(const Vector3DInt32& neighbourPos, float neighbourGVal); - - float SixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); - float EighteenConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); - float TwentySixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); - float computeH(const Vector3DInt32& a, const Vector3DInt32& b); - uint32_t hash(uint32_t a); - - //Node containers - AllNodesContainer allNodes; - OpenNodesContainer openNodes; - ClosedNodesContainer closedNodes; - - //The current node - AllNodesContainer::iterator current; - - float m_fProgress; - - AStarPathfinderParams m_params; - }; -} - -#include "PolyVoxCore/AStarPathfinder.inl" - -#endif //__PolyVox_AStarPathfinder_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_AStarPathfinder_H__ +#define __PolyVox_AStarPathfinder_H__ + +#include "Impl/AStarPathfinderImpl.h" +#include "Impl/TypeDef.h" + +#include +#include +#include //For runtime_error + +namespace PolyVox +{ + const float sqrt_1 = 1.0f; + const float sqrt_2 = 1.4143f; + const float sqrt_3 = 1.7321f; + + extern const POLYVOX_API Vector3DInt32 arrayPathfinderFaces[6]; + extern const POLYVOX_API Vector3DInt32 arrayPathfinderEdges[12]; + extern const POLYVOX_API Vector3DInt32 arrayPathfinderCorners[8]; + + /// This function provides the default method for checking whether a given voxel + /// is valid for the path computed by the AStarPathfinder. + template + bool aStarDefaultVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos); + + /// Provides a configuration for the AStarPathfinder. + //////////////////////////////////////////////////////////////////////////////// + /// This structure stores the AStarPathfinder%s configuration options, because this + /// is simpler than providing a large number of get/set properties within the + /// AStarPathfinder itself. In order to create an instance of this structure you + /// must provide at least a volume, a start and end point, and a list to store + /// the result. All the other option have sensible default values which can + /// optionally be changed for more precise control over the pathfinder's behaviour. + /// + /// \sa AStarPathfinder + //////////////////////////////////////////////////////////////////////////////// + template + struct AStarPathfinderParams + { + public: + AStarPathfinderParams + ( + VolumeType* volData, + const Vector3DInt32& v3dStart, + const Vector3DInt32& v3dEnd, + std::list* listResult, + float fHBias = 1.0, + uint32_t uMaxNoOfNodes = 10000, + Connectivity requiredConnectivity = TwentySixConnected, + std::function funcIsVoxelValidForPath = &aStarDefaultVoxelValidator, + std::function funcProgressCallback = nullptr + ) + :volume(volData) + ,start(v3dStart) + ,end(v3dEnd) + ,result(listResult) + ,connectivity(requiredConnectivity) + ,hBias(fHBias) + ,maxNumberOfNodes(uMaxNoOfNodes) + ,isVoxelValidForPath(funcIsVoxelValidForPath) + ,progressCallback(funcProgressCallback) + { + } + + /// This is the volume through which the AStarPathfinder must find a path. + VolumeType* volume; + + /// The start point for the pathfinding algorithm. + Vector3DInt32 start; + + /// The end point for the pathfinding algorithm. + Vector3DInt32 end; + + /// The resulting path will be stored as a series of points in + /// this list. Any existing contents will be cleared. + std::list* result; + + /// The AStarPathfinder performs its search by examining the neighbours + /// of each voxel it encounters. This property controls the meaning of + /// neighbour - e.g. whether two voxels must share a face, edge, or corner. + Connectivity connectivity; + + /// For each voxel the pathfinder tracks its distance to the start (known as g()) + /// and estimates its distance to the end (known as h()). Increasing or decreasing + /// h() has an effect on the way the pathfinder behaves. If h() is an underestimate + /// of the true distance then the pathfinder will act more like a greedy search - + /// always finding the shortest path but taking longer to do so. If h() is an over + /// estimate then the pathfinder will behave more like a best-first search - returning + /// a potentially suboptimal path but finding it more quickly. The hBias is multiplied + /// by the estimated h() value to control this behaviour. + float hBias; + + /// Volumes can be pretty huge (millions of voxels) and processing each one of these + /// can take a long time. In A* terminology each voxel is a node, and this property + /// controls the maximum number of nodes that will be considered when finding the path, + /// before giving up and throwing an exception because a path can't be found. + uint32_t maxNumberOfNodes; + + /// This function is called to determine whether the path can pass though a given voxel. The + /// default behaviour is specified by aStarDefaultVoxelValidator(), but users can specify thier + /// own criteria if desired. For example, if you always want a path to follow a surface then + /// you could check to ensure that the voxel above is empty and the voxel below is solid. + /// + /// \sa aStarDefaultVoxelValidator + std::function isVoxelValidForPath; + + /// This function is called by the AStarPathfinder to report on its progress in getting to + /// the goal. The progress is reported by computing the distance from the closest node found + /// so far to the end node, and comparing this with the distance from the start node to the + /// end node. This progress value is guarenteed to never decrease, but it may stop increasing + ///for short periods of time. It may even stop increasing altogether if a path cannot be found. + std::function progressCallback; + }; + + /// The AStarPathfinder compute a path from one point in the volume to another. + //////////////////////////////////////////////////////////////////////////////// + /// A* is a well known pathfinding algorithm commonly used in computer games. It + /// takes as input a pair of points in the world, and works out a path between + /// them which avoids obstacles and adheres to other user defined criteria. The + /// resulting path is usually the shortest possible, but a less optimal path can + /// be exchanged for reduced computation time. + /// + /// For an excellent overview of the A* algorithm please see Amit Patel's Game + /// Programming page here: http://theory.stanford.edu/~amitp/GameProgramming/ + /// Much of this class is based on the principles described in those pages. + /// + /// Usage of this class if very strightforward. You create an instance of it + /// by passing an instance of the AStarPathfinderParams structure to the constructor. + /// The details of the AStarPathfinderParams and the options it provides are described + /// in the documentation for that class. + /// + /// Next you call the execute() function and wait for it to return. If a path is + /// found then this is stored in the list which was set as the 'result' field of + /// the AStarPathfinderParams. If a path cannot be found then an exception of type + /// std::runtime_error is thrown. + /// + /// \sa AStarPathfinderParams + //////////////////////////////////////////////////////////////////////////////// + template + class AStarPathfinder + { + public: + AStarPathfinder(const AStarPathfinderParams& params); + + void execute(); + + private: + void processNeighbour(const Vector3DInt32& neighbourPos, float neighbourGVal); + + float SixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); + float EighteenConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); + float TwentySixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b); + float computeH(const Vector3DInt32& a, const Vector3DInt32& b); + uint32_t hash(uint32_t a); + + //Node containers + AllNodesContainer allNodes; + OpenNodesContainer openNodes; + ClosedNodesContainer closedNodes; + + //The current node + AllNodesContainer::iterator current; + + float m_fProgress; + + AStarPathfinderParams m_params; + }; +} + +#include "PolyVoxCore/AStarPathfinder.inl" + +#endif //__PolyVox_AStarPathfinder_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl index f9a59a1b..e0c570bd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl @@ -1,351 +1,351 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// Using this function, a voxel is considered valid for the path if it is inside the - /// volume and if its density is below that returned by the voxel's getDensity() function. - /// \return true is the voxel is valid for the path - //////////////////////////////////////////////////////////////////////////////// - template - bool aStarDefaultVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos) - { - //Voxels are considered valid candidates for the path if they are inside the volume... - if(volData->getEnclosingRegion().containsPoint(v3dPos) == false) - { - return false; - } - - return true; - } - - //////////////////////////////////////////////////////////////////////////////// - // AStarPathfinder Class - //////////////////////////////////////////////////////////////////////////////// - template - AStarPathfinder::AStarPathfinder(const AStarPathfinderParams& params) - :m_params(params) - { - } - - template - void AStarPathfinder::execute() - { - //Clear any existing nodes - allNodes.clear(); - openNodes.clear(); - closedNodes.clear(); - - //Clear the result - m_params.result->clear(); - - //Iterators to start and end node. - AllNodesContainer::iterator startNode = allNodes.insert(Node(m_params.start.getX(), m_params.start.getY(), m_params.start.getZ())).first; - AllNodesContainer::iterator endNode = allNodes.insert(Node(m_params.end.getX(), m_params.end.getY(), m_params.end.getZ())).first; - - //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. - //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, - //and changing the object directly can break the sorting. However, in our case we have provided a - //custom sort operator for the set which we know only uses the position to sort. Hence we can safely - //modify other properties of the object while it is in the set. - Node* tempStart = const_cast(&(*startNode)); - tempStart->gVal = 0; - tempStart->hVal = computeH(startNode->position, endNode->position); - - Node* tempEnd = const_cast(&(*endNode)); - tempEnd->hVal = 0.0f; - - openNodes.insert(startNode); - - float fDistStartToEnd = (endNode->position - startNode->position).length(); - m_fProgress = 0.0f; - if(m_params.progressCallback) - { - m_params.progressCallback(m_fProgress); - } - - while((openNodes.empty() == false) && (openNodes.getFirst() != endNode)) - { - //Move the first node from open to closed. - current = openNodes.getFirst(); - openNodes.removeFirst(); - closedNodes.insert(current); - - //Update the user on our progress - if(m_params.progressCallback) - { - const float fMinProgresIncreament = 0.001f; - float fDistCurrentToEnd = (endNode->position - current->position).length(); - float fDistNormalised = fDistCurrentToEnd / fDistStartToEnd; - float fProgress = 1.0f - fDistNormalised; - if(fProgress >= m_fProgress + fMinProgresIncreament) - { - m_fProgress = fProgress; - m_params.progressCallback(m_fProgress); - } - } - - //The distance from one cell to another connected by face, edge, or corner. - const float fFaceCost = sqrt_1; - const float fEdgeCost = sqrt_2; - const float fCornerCost = sqrt_3; - - //Process the neighbours. Note the deliberate lack of 'break' - //statements, larger connectivities include smaller ones. - switch(m_params.connectivity) - { - case TwentySixConnected: - processNeighbour(current->position + arrayPathfinderCorners[0], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[1], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[2], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[3], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[4], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[5], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[6], current->gVal + fCornerCost); - processNeighbour(current->position + arrayPathfinderCorners[7], current->gVal + fCornerCost); - - case EighteenConnected: - processNeighbour(current->position + arrayPathfinderEdges[ 0], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 1], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 2], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 3], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 4], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 5], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 6], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 7], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 8], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[ 9], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[10], current->gVal + fEdgeCost); - processNeighbour(current->position + arrayPathfinderEdges[11], current->gVal + fEdgeCost); - - case SixConnected: - processNeighbour(current->position + arrayPathfinderFaces[0], current->gVal + fFaceCost); - processNeighbour(current->position + arrayPathfinderFaces[1], current->gVal + fFaceCost); - processNeighbour(current->position + arrayPathfinderFaces[2], current->gVal + fFaceCost); - processNeighbour(current->position + arrayPathfinderFaces[3], current->gVal + fFaceCost); - processNeighbour(current->position + arrayPathfinderFaces[4], current->gVal + fFaceCost); - processNeighbour(current->position + arrayPathfinderFaces[5], current->gVal + fFaceCost); - } - - if(allNodes.size() > m_params.maxNumberOfNodes) - { - //We've reached the specified maximum number - //of nodes. Just give up on the search. - break; - } - } - - if((openNodes.empty()) || (openNodes.getFirst() != endNode)) - { - //In this case we failed to find a valid path. - POLYVOX_THROW(std::runtime_error, "No path found"); - } - else - { - //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. - //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, - //and changing the object directly can break the sorting. However, in our case we have provided a - //custom sort operator for the set which we know only uses the position to sort. Hence we can safely - //modify other properties of the object while it is in the set. - Node* n = const_cast(&(*endNode)); - while(n != 0) - { - m_params.result->push_front(n->position); - n = n->parent; - } - } - - if(m_params.progressCallback) - { - m_params.progressCallback(1.0f); - } - } - - template - void AStarPathfinder::processNeighbour(const Vector3DInt32& neighbourPos, float neighbourGVal) - { - bool bIsVoxelValidForPath = m_params.isVoxelValidForPath(m_params.volume, neighbourPos); - if(!bIsVoxelValidForPath) - { - return; - } - - float cost = neighbourGVal; - - std::pair insertResult = allNodes.insert(Node(neighbourPos.getX(), neighbourPos.getY(), neighbourPos.getZ())); - AllNodesContainer::iterator neighbour = insertResult.first; - - if(insertResult.second == true) //New node, compute h. - { - Node* tempNeighbour = const_cast(&(*neighbour)); - tempNeighbour -> hVal = computeH(neighbour->position, m_params.end); - } - - OpenNodesContainer::iterator openIter = openNodes.find(neighbour); - if(openIter != openNodes.end()) - { - if(cost < neighbour->gVal) - { - openNodes.remove(openIter); - openIter = openNodes.end(); - } - } - - //TODO - Nodes could keep track of if they are in open or closed? And a pointer to where they are? - ClosedNodesContainer::iterator closedIter = closedNodes.find(neighbour); - if(closedIter != closedNodes.end()) - { - if(cost < neighbour->gVal) - { - //Probably shouldn't happen? - closedNodes.remove(closedIter); - closedIter = closedNodes.end(); - } - } - - if((openIter == openNodes.end()) && (closedIter == closedNodes.end())) - { - //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. - //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, - //and changing the object directly can break the sorting. However, in our case we have provided a - //custom sort operator for the set which we know only uses the position to sort. Hence we can safely - //modify other properties of the object while it is in the set. - Node* temp = const_cast(&(*neighbour)); - temp->gVal = cost; - openNodes.insert(neighbour); - temp->parent = const_cast(&(*current)); - } - } - - template - float AStarPathfinder::SixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) - { - //This is the only heuristic I'm sure of - just use the manhatten distance for the 6-connected case. - uint32_t faceSteps = std::abs(a.getX()-b.getX()) + std::abs(a.getY()-b.getY()) + std::abs(a.getZ()-b.getZ()); - - return faceSteps * 1.0f; - } - - template - float AStarPathfinder::EighteenConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) - { - //I'm not sure of the correct heuristic for the 18-connected case, so I'm just letting it fall through to the - //6-connected case. This means 'h' will be bigger than it should be, resulting in a faster path which may not - //actually be the shortest one. If you have a correct heuristic for the 18-connected case then please let me know. - - return SixConnectedCost(a,b); - } - - template - float AStarPathfinder::TwentySixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) - { - //Can't say I'm certain about this heuristic - if anyone has - //a better idea of what it should be then please let me know. - uint32_t array[3]; - array[0] = std::abs(a.getX() - b.getX()); - array[1] = std::abs(a.getY() - b.getY()); - array[2] = std::abs(a.getZ() - b.getZ()); - - //Maybe this is better implemented directly - //using three compares and two swaps... but not - //until the profiler says so. - std::sort(&array[0], &array[3]); - - uint32_t cornerSteps = array[0]; - uint32_t edgeSteps = array[1] - array[0]; - uint32_t faceSteps = array[2] - array[1]; - - return cornerSteps * sqrt_3 + edgeSteps * sqrt_2 + faceSteps * sqrt_1; - } - - template - float AStarPathfinder::computeH(const Vector3DInt32& a, const Vector3DInt32& b) - { - float hVal; - - switch(m_params.connectivity) - { - case TwentySixConnected: - hVal = TwentySixConnectedCost(a, b); - break; - case EighteenConnected: - hVal = EighteenConnectedCost(a, b); - break; - case SixConnected: - hVal = SixConnectedCost(a, b); - break; - default: - POLYVOX_THROW(std::invalid_argument, "Connectivity parameter has an unrecognised value."); - } - - //Sanity checks in debug mode. These can come out eventually, but I - //want to make sure that the heuristics I've come up with make sense. - POLYVOX_ASSERT((a-b).length() <= TwentySixConnectedCost(a,b), "A* heuristic error."); - POLYVOX_ASSERT(TwentySixConnectedCost(a,b) <= EighteenConnectedCost(a,b), "A* heuristic error."); - POLYVOX_ASSERT(EighteenConnectedCost(a,b) <= SixConnectedCost(a,b), "A* heuristic error."); - - //Apply the bias to the computed h value; - hVal *= m_params.hBias; - - //Having computed hVal, we now apply some random bias to break ties. - //This needs to be deterministic on the input position. This random - //bias means it is much les likely that two paths are exactly the same - //length, and so far fewer nodes must be expanded to find the shortest path. - //See http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html#S12 - - //Note that if the hash is zero we can have differences between the Linux vs. Windows - //(or perhaps GCC vs. VS) versions of the code. This is probably because of the way - //sorting inside the std::set works (i.e. one system swaps values which are identical - //while the other one doesn't - both approaches are valid). For the same reason we want - //to make sure that position (x,y,z) has a differnt hash from e.g. position (x,z,y). - uint32_t aX = (a.getX() << 16) & 0x00FF0000; - uint32_t aY = (a.getY() << 8) & 0x0000FF00; - uint32_t aZ = (a.getZ() ) & 0x000000FF; - uint32_t hashVal = hash(aX | aY | aZ); - - //Stop hashVal going over 65535, and divide by 1000000 to make sure it is small. - hashVal &= 0x0000FFFF; - float fHash = hashVal / 1000000.0f; - - //Apply the hash and return - hVal += fHash; - return hVal; - } - - // Robert Jenkins' 32 bit integer hash function - // http://www.burtleburtle.net/bob/hash/integer.html - template - uint32_t AStarPathfinder::hash( uint32_t a) - { - a = (a+0x7ed55d16) + (a<<12); - a = (a^0xc761c23c) ^ (a>>19); - a = (a+0x165667b1) + (a<<5); - a = (a+0xd3a2646c) ^ (a<<9); - a = (a+0xfd7046c5) + (a<<3); - a = (a^0xb55a4f09) ^ (a>>16); - return a; - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/ErrorHandling.h" + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////// + /// Using this function, a voxel is considered valid for the path if it is inside the + /// volume and if its density is below that returned by the voxel's getDensity() function. + /// \return true is the voxel is valid for the path + //////////////////////////////////////////////////////////////////////////////// + template + bool aStarDefaultVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos) + { + //Voxels are considered valid candidates for the path if they are inside the volume... + if(volData->getEnclosingRegion().containsPoint(v3dPos) == false) + { + return false; + } + + return true; + } + + //////////////////////////////////////////////////////////////////////////////// + // AStarPathfinder Class + //////////////////////////////////////////////////////////////////////////////// + template + AStarPathfinder::AStarPathfinder(const AStarPathfinderParams& params) + :m_params(params) + { + } + + template + void AStarPathfinder::execute() + { + //Clear any existing nodes + allNodes.clear(); + openNodes.clear(); + closedNodes.clear(); + + //Clear the result + m_params.result->clear(); + + //Iterators to start and end node. + AllNodesContainer::iterator startNode = allNodes.insert(Node(m_params.start.getX(), m_params.start.getY(), m_params.start.getZ())).first; + AllNodesContainer::iterator endNode = allNodes.insert(Node(m_params.end.getX(), m_params.end.getY(), m_params.end.getZ())).first; + + //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. + //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, + //and changing the object directly can break the sorting. However, in our case we have provided a + //custom sort operator for the set which we know only uses the position to sort. Hence we can safely + //modify other properties of the object while it is in the set. + Node* tempStart = const_cast(&(*startNode)); + tempStart->gVal = 0; + tempStart->hVal = computeH(startNode->position, endNode->position); + + Node* tempEnd = const_cast(&(*endNode)); + tempEnd->hVal = 0.0f; + + openNodes.insert(startNode); + + float fDistStartToEnd = (endNode->position - startNode->position).length(); + m_fProgress = 0.0f; + if(m_params.progressCallback) + { + m_params.progressCallback(m_fProgress); + } + + while((openNodes.empty() == false) && (openNodes.getFirst() != endNode)) + { + //Move the first node from open to closed. + current = openNodes.getFirst(); + openNodes.removeFirst(); + closedNodes.insert(current); + + //Update the user on our progress + if(m_params.progressCallback) + { + const float fMinProgresIncreament = 0.001f; + float fDistCurrentToEnd = (endNode->position - current->position).length(); + float fDistNormalised = fDistCurrentToEnd / fDistStartToEnd; + float fProgress = 1.0f - fDistNormalised; + if(fProgress >= m_fProgress + fMinProgresIncreament) + { + m_fProgress = fProgress; + m_params.progressCallback(m_fProgress); + } + } + + //The distance from one cell to another connected by face, edge, or corner. + const float fFaceCost = sqrt_1; + const float fEdgeCost = sqrt_2; + const float fCornerCost = sqrt_3; + + //Process the neighbours. Note the deliberate lack of 'break' + //statements, larger connectivities include smaller ones. + switch(m_params.connectivity) + { + case TwentySixConnected: + processNeighbour(current->position + arrayPathfinderCorners[0], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[1], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[2], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[3], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[4], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[5], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[6], current->gVal + fCornerCost); + processNeighbour(current->position + arrayPathfinderCorners[7], current->gVal + fCornerCost); + + case EighteenConnected: + processNeighbour(current->position + arrayPathfinderEdges[ 0], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 1], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 2], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 3], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 4], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 5], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 6], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 7], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 8], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[ 9], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[10], current->gVal + fEdgeCost); + processNeighbour(current->position + arrayPathfinderEdges[11], current->gVal + fEdgeCost); + + case SixConnected: + processNeighbour(current->position + arrayPathfinderFaces[0], current->gVal + fFaceCost); + processNeighbour(current->position + arrayPathfinderFaces[1], current->gVal + fFaceCost); + processNeighbour(current->position + arrayPathfinderFaces[2], current->gVal + fFaceCost); + processNeighbour(current->position + arrayPathfinderFaces[3], current->gVal + fFaceCost); + processNeighbour(current->position + arrayPathfinderFaces[4], current->gVal + fFaceCost); + processNeighbour(current->position + arrayPathfinderFaces[5], current->gVal + fFaceCost); + } + + if(allNodes.size() > m_params.maxNumberOfNodes) + { + //We've reached the specified maximum number + //of nodes. Just give up on the search. + break; + } + } + + if((openNodes.empty()) || (openNodes.getFirst() != endNode)) + { + //In this case we failed to find a valid path. + POLYVOX_THROW(std::runtime_error, "No path found"); + } + else + { + //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. + //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, + //and changing the object directly can break the sorting. However, in our case we have provided a + //custom sort operator for the set which we know only uses the position to sort. Hence we can safely + //modify other properties of the object while it is in the set. + Node* n = const_cast(&(*endNode)); + while(n != 0) + { + m_params.result->push_front(n->position); + n = n->parent; + } + } + + if(m_params.progressCallback) + { + m_params.progressCallback(1.0f); + } + } + + template + void AStarPathfinder::processNeighbour(const Vector3DInt32& neighbourPos, float neighbourGVal) + { + bool bIsVoxelValidForPath = m_params.isVoxelValidForPath(m_params.volume, neighbourPos); + if(!bIsVoxelValidForPath) + { + return; + } + + float cost = neighbourGVal; + + std::pair insertResult = allNodes.insert(Node(neighbourPos.getX(), neighbourPos.getY(), neighbourPos.getZ())); + AllNodesContainer::iterator neighbour = insertResult.first; + + if(insertResult.second == true) //New node, compute h. + { + Node* tempNeighbour = const_cast(&(*neighbour)); + tempNeighbour -> hVal = computeH(neighbour->position, m_params.end); + } + + OpenNodesContainer::iterator openIter = openNodes.find(neighbour); + if(openIter != openNodes.end()) + { + if(cost < neighbour->gVal) + { + openNodes.remove(openIter); + openIter = openNodes.end(); + } + } + + //TODO - Nodes could keep track of if they are in open or closed? And a pointer to where they are? + ClosedNodesContainer::iterator closedIter = closedNodes.find(neighbour); + if(closedIter != closedNodes.end()) + { + if(cost < neighbour->gVal) + { + //Probably shouldn't happen? + closedNodes.remove(closedIter); + closedIter = closedNodes.end(); + } + } + + if((openIter == openNodes.end()) && (closedIter == closedNodes.end())) + { + //Regarding the const_cast - normally you should not modify an object which is in an sdt::set. + //The reason is that objects in a set are stored sorted in a tree so they can be accessed quickly, + //and changing the object directly can break the sorting. However, in our case we have provided a + //custom sort operator for the set which we know only uses the position to sort. Hence we can safely + //modify other properties of the object while it is in the set. + Node* temp = const_cast(&(*neighbour)); + temp->gVal = cost; + openNodes.insert(neighbour); + temp->parent = const_cast(&(*current)); + } + } + + template + float AStarPathfinder::SixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) + { + //This is the only heuristic I'm sure of - just use the manhatten distance for the 6-connected case. + uint32_t faceSteps = std::abs(a.getX()-b.getX()) + std::abs(a.getY()-b.getY()) + std::abs(a.getZ()-b.getZ()); + + return faceSteps * 1.0f; + } + + template + float AStarPathfinder::EighteenConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) + { + //I'm not sure of the correct heuristic for the 18-connected case, so I'm just letting it fall through to the + //6-connected case. This means 'h' will be bigger than it should be, resulting in a faster path which may not + //actually be the shortest one. If you have a correct heuristic for the 18-connected case then please let me know. + + return SixConnectedCost(a,b); + } + + template + float AStarPathfinder::TwentySixConnectedCost(const Vector3DInt32& a, const Vector3DInt32& b) + { + //Can't say I'm certain about this heuristic - if anyone has + //a better idea of what it should be then please let me know. + uint32_t array[3]; + array[0] = std::abs(a.getX() - b.getX()); + array[1] = std::abs(a.getY() - b.getY()); + array[2] = std::abs(a.getZ() - b.getZ()); + + //Maybe this is better implemented directly + //using three compares and two swaps... but not + //until the profiler says so. + std::sort(&array[0], &array[3]); + + uint32_t cornerSteps = array[0]; + uint32_t edgeSteps = array[1] - array[0]; + uint32_t faceSteps = array[2] - array[1]; + + return cornerSteps * sqrt_3 + edgeSteps * sqrt_2 + faceSteps * sqrt_1; + } + + template + float AStarPathfinder::computeH(const Vector3DInt32& a, const Vector3DInt32& b) + { + float hVal; + + switch(m_params.connectivity) + { + case TwentySixConnected: + hVal = TwentySixConnectedCost(a, b); + break; + case EighteenConnected: + hVal = EighteenConnectedCost(a, b); + break; + case SixConnected: + hVal = SixConnectedCost(a, b); + break; + default: + POLYVOX_THROW(std::invalid_argument, "Connectivity parameter has an unrecognised value."); + } + + //Sanity checks in debug mode. These can come out eventually, but I + //want to make sure that the heuristics I've come up with make sense. + POLYVOX_ASSERT((a-b).length() <= TwentySixConnectedCost(a,b), "A* heuristic error."); + POLYVOX_ASSERT(TwentySixConnectedCost(a,b) <= EighteenConnectedCost(a,b), "A* heuristic error."); + POLYVOX_ASSERT(EighteenConnectedCost(a,b) <= SixConnectedCost(a,b), "A* heuristic error."); + + //Apply the bias to the computed h value; + hVal *= m_params.hBias; + + //Having computed hVal, we now apply some random bias to break ties. + //This needs to be deterministic on the input position. This random + //bias means it is much les likely that two paths are exactly the same + //length, and so far fewer nodes must be expanded to find the shortest path. + //See http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html#S12 + + //Note that if the hash is zero we can have differences between the Linux vs. Windows + //(or perhaps GCC vs. VS) versions of the code. This is probably because of the way + //sorting inside the std::set works (i.e. one system swaps values which are identical + //while the other one doesn't - both approaches are valid). For the same reason we want + //to make sure that position (x,y,z) has a differnt hash from e.g. position (x,z,y). + uint32_t aX = (a.getX() << 16) & 0x00FF0000; + uint32_t aY = (a.getY() << 8) & 0x0000FF00; + uint32_t aZ = (a.getZ() ) & 0x000000FF; + uint32_t hashVal = hash(aX | aY | aZ); + + //Stop hashVal going over 65535, and divide by 1000000 to make sure it is small. + hashVal &= 0x0000FFFF; + float fHash = hashVal / 1000000.0f; + + //Apply the hash and return + hVal += fHash; + return hVal; + } + + // Robert Jenkins' 32 bit integer hash function + // http://www.burtleburtle.net/bob/hash/integer.html + template + uint32_t AStarPathfinder::hash( uint32_t a) + { + a = (a+0x7ed55d16) + (a<<12); + a = (a^0xc761c23c) ^ (a>>19); + a = (a+0x165667b1) + (a<<5); + a = (a+0xd3a2646c) ^ (a<<9); + a = (a+0xfd7046c5) + (a<<3); + a = (a^0xb55a4f09) ^ (a>>16); + return a; + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h index 70a5d89d..b9ca636a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h @@ -1,82 +1,82 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __AmbientOcclusionCalculator_H__ -#define __AmbientOcclusionCalculator_H__ - -#include "Impl/RandomUnitVectors.h" -#include "Impl/RandomVectors.h" - -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Raycast.h" - -//These two should not be here! -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/PagedVolume.h" - -#include - -namespace PolyVox -{ - /** - * \file - * - * Ambient occlusion - */ - - template - class AmbientOcclusionCalculatorRaycastCallback - { - public: - AmbientOcclusionCalculatorRaycastCallback(IsVoxelTransparentCallback isVoxelTransparentCallback) : mIsVoxelTransparentCallback(isVoxelTransparentCallback) - { - } - - bool operator()(const PagedVolume::Sampler& sampler) - { - uint8_t sample = sampler.getVoxel(); - bool func = mIsVoxelTransparentCallback(sample); - return func; - } - - IsVoxelTransparentCallback mIsVoxelTransparentCallback; - }; - - // NOTE: The callback needs to be a functor not a function. I haven't been - // able to work the required template magic to get functions working as well. - // - // Matt: If you make the function take a "IsVoxelTransparentCallback&&" then - // it will forward it on. Works for functors, functions and lambdas. - // This will be 'perfect forwarding' using 'universal references' - // This will require C++11 rvalue references which is why I haven't made the - // change yet. - - /// Calculate the ambient occlusion for the volume - template - void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback); -} - -#include "PolyVoxCore/AmbientOcclusionCalculator.inl" - -#endif //__AmbientOcclusionCalculator_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __AmbientOcclusionCalculator_H__ +#define __AmbientOcclusionCalculator_H__ + +#include "Impl/RandomUnitVectors.h" +#include "Impl/RandomVectors.h" + +#include "PolyVoxCore/Array.h" +#include "PolyVoxCore/Region.h" +#include "PolyVoxCore/Raycast.h" + +//These two should not be here! +#include "PolyVoxCore/Material.h" +#include "PolyVoxCore/PagedVolume.h" + +#include + +namespace PolyVox +{ + /** + * \file + * + * Ambient occlusion + */ + + template + class AmbientOcclusionCalculatorRaycastCallback + { + public: + AmbientOcclusionCalculatorRaycastCallback(IsVoxelTransparentCallback isVoxelTransparentCallback) : mIsVoxelTransparentCallback(isVoxelTransparentCallback) + { + } + + bool operator()(const PagedVolume::Sampler& sampler) + { + uint8_t sample = sampler.getVoxel(); + bool func = mIsVoxelTransparentCallback(sample); + return func; + } + + IsVoxelTransparentCallback mIsVoxelTransparentCallback; + }; + + // NOTE: The callback needs to be a functor not a function. I haven't been + // able to work the required template magic to get functions working as well. + // + // Matt: If you make the function take a "IsVoxelTransparentCallback&&" then + // it will forward it on. Works for functors, functions and lambdas. + // This will be 'perfect forwarding' using 'universal references' + // This will require C++11 rvalue references which is why I haven't made the + // change yet. + + /// Calculate the ambient occlusion for the volume + template + void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback); +} + +#include "PolyVoxCore/AmbientOcclusionCalculator.inl" + +#endif //__AmbientOcclusionCalculator_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl index c64c6d22..be9db40e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl @@ -1,136 +1,136 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - /** - * \param volInput The volume to calculate the ambient occlusion for - * \param[out] arrayResult The output of the calculator - * \param region The region of the volume for which the occlusion should be calculated - * \param fRayLength The length for each test ray - * \param uNoOfSamplesPerOutputElement The number of samples to calculate the occlusion - * \param isVoxelTransparentCallback A callback which takes a \a VoxelType and returns a \a bool whether the voxel is transparent - */ - template - void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback) - { - //Make sure that the size of the volume is an exact multiple of the size of the array. - if(volInput->getWidth() % arrayResult->getDimension(0) != 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array width."); - } - if(volInput->getHeight() % arrayResult->getDimension(1) != 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array height."); - } - if(volInput->getDepth() % arrayResult->getDimension(2) != 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array depth."); - } - - uint16_t uRandomUnitVectorIndex = 0; - uint16_t uRandomVectorIndex = 0; - uint16_t uIndexIncreament; - - //Our initial indices. It doesn't matter exactly what we set here, but the code below makes - //sure they are different for different regions which helps reduce tiling patterns in the results. - uRandomUnitVectorIndex += region.getLowerX() + region.getLowerY() + region.getLowerZ(); - uRandomVectorIndex += region.getLowerX() + region.getLowerY() + region.getLowerZ(); - - //This value helps us jump around in the array a bit more, so the - //nth 'random' value isn't always followed by the n+1th 'random' value. - uIndexIncreament = 1; - - const int iRatioX = volInput->getWidth() / arrayResult->getDimension(0); - const int iRatioY = volInput->getHeight() / arrayResult->getDimension(1); - const int iRatioZ = volInput->getDepth() / arrayResult->getDimension(2); - - const float fRatioX = iRatioX; - const float fRatioY = iRatioY; - const float fRatioZ = iRatioZ; - const Vector3DFloat v3dRatio(fRatioX, fRatioY, fRatioZ); - - const float fHalfRatioX = fRatioX * 0.5f; - const float fHalfRatioY = fRatioY * 0.5f; - const float fHalfRatioZ = fRatioZ * 0.5f; - const Vector3DFloat v3dHalfRatio(fHalfRatioX, fHalfRatioY, fHalfRatioZ); - - const Vector3DFloat v3dOffset(0.5f,0.5f,0.5f); - - //This loop iterates over the bottom-lower-left voxel in each of the cells in the output array - for(uint16_t z = region.getLowerZ(); z <= region.getUpperZ(); z += iRatioZ) - { - for(uint16_t y = region.getLowerY(); y <= region.getUpperY(); y += iRatioY) - { - for(uint16_t x = region.getLowerX(); x <= region.getUpperX(); x += iRatioX) - { - //Compute a start position corresponding to - //the centre of the cell in the output array. - Vector3DFloat v3dStart(x, y, z); - v3dStart -= v3dOffset; - v3dStart += v3dHalfRatio; - - //Keep track of how many rays did not hit anything - uint8_t uVisibleDirections = 0; - - for(int ct = 0; ct < uNoOfSamplesPerOutputElement; ct++) - { - //We take a random vector with components going from -1 to 1 and scale it to go from -halfRatio to +halfRatio. - //This jitter value moves our sample point from the centre of the array cell to somewhere else in the array cell - Vector3DFloat v3dJitter = randomVectors[(uRandomVectorIndex += (++uIndexIncreament)) % 1019]; //Prime number helps avoid repetition on successive loops. - v3dJitter *= v3dHalfRatio; - const Vector3DFloat v3dRayStart = v3dStart + v3dJitter; - - Vector3DFloat v3dRayDirection = randomUnitVectors[(uRandomUnitVectorIndex += (++uIndexIncreament)) % 1021]; //Different prime number. - v3dRayDirection *= fRayLength; - - AmbientOcclusionCalculatorRaycastCallback ambientOcclusionCalculatorRaycastCallback(isVoxelTransparentCallback); - RaycastResult result = raycastWithDirection(volInput, v3dRayStart, v3dRayDirection, ambientOcclusionCalculatorRaycastCallback); - - // Note - The performance of this could actually be improved it we exited as soon - // as the ray left the volume. The raycast test has an example of how to do this. - if(result == RaycastResults::Completed) - { - ++uVisibleDirections; - } - } - - float fVisibility; - if(uNoOfSamplesPerOutputElement == 0) - { - //The user might request zero samples (I've done this in the past while debugging - I don't want to - //wait for ambient occlusion but I do want as valid result for rendering). Avoid the divide by zero. - fVisibility = 1.0f; - } - else - { - fVisibility = static_cast(uVisibleDirections) / static_cast(uNoOfSamplesPerOutputElement); - POLYVOX_ASSERT((fVisibility >= 0.0f) && (fVisibility <= 1.0f), "Visibility value out of range."); - } - - (*arrayResult)(z / iRatioZ, y / iRatioY, x / iRatioX) = static_cast(255.0f * fVisibility); - } - } - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + /** + * \param volInput The volume to calculate the ambient occlusion for + * \param[out] arrayResult The output of the calculator + * \param region The region of the volume for which the occlusion should be calculated + * \param fRayLength The length for each test ray + * \param uNoOfSamplesPerOutputElement The number of samples to calculate the occlusion + * \param isVoxelTransparentCallback A callback which takes a \a VoxelType and returns a \a bool whether the voxel is transparent + */ + template + void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback) + { + //Make sure that the size of the volume is an exact multiple of the size of the array. + if(volInput->getWidth() % arrayResult->getDimension(0) != 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array width."); + } + if(volInput->getHeight() % arrayResult->getDimension(1) != 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array height."); + } + if(volInput->getDepth() % arrayResult->getDimension(2) != 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume width must be an exact multiple of array depth."); + } + + uint16_t uRandomUnitVectorIndex = 0; + uint16_t uRandomVectorIndex = 0; + uint16_t uIndexIncreament; + + //Our initial indices. It doesn't matter exactly what we set here, but the code below makes + //sure they are different for different regions which helps reduce tiling patterns in the results. + uRandomUnitVectorIndex += region.getLowerX() + region.getLowerY() + region.getLowerZ(); + uRandomVectorIndex += region.getLowerX() + region.getLowerY() + region.getLowerZ(); + + //This value helps us jump around in the array a bit more, so the + //nth 'random' value isn't always followed by the n+1th 'random' value. + uIndexIncreament = 1; + + const int iRatioX = volInput->getWidth() / arrayResult->getDimension(0); + const int iRatioY = volInput->getHeight() / arrayResult->getDimension(1); + const int iRatioZ = volInput->getDepth() / arrayResult->getDimension(2); + + const float fRatioX = iRatioX; + const float fRatioY = iRatioY; + const float fRatioZ = iRatioZ; + const Vector3DFloat v3dRatio(fRatioX, fRatioY, fRatioZ); + + const float fHalfRatioX = fRatioX * 0.5f; + const float fHalfRatioY = fRatioY * 0.5f; + const float fHalfRatioZ = fRatioZ * 0.5f; + const Vector3DFloat v3dHalfRatio(fHalfRatioX, fHalfRatioY, fHalfRatioZ); + + const Vector3DFloat v3dOffset(0.5f,0.5f,0.5f); + + //This loop iterates over the bottom-lower-left voxel in each of the cells in the output array + for(uint16_t z = region.getLowerZ(); z <= region.getUpperZ(); z += iRatioZ) + { + for(uint16_t y = region.getLowerY(); y <= region.getUpperY(); y += iRatioY) + { + for(uint16_t x = region.getLowerX(); x <= region.getUpperX(); x += iRatioX) + { + //Compute a start position corresponding to + //the centre of the cell in the output array. + Vector3DFloat v3dStart(x, y, z); + v3dStart -= v3dOffset; + v3dStart += v3dHalfRatio; + + //Keep track of how many rays did not hit anything + uint8_t uVisibleDirections = 0; + + for(int ct = 0; ct < uNoOfSamplesPerOutputElement; ct++) + { + //We take a random vector with components going from -1 to 1 and scale it to go from -halfRatio to +halfRatio. + //This jitter value moves our sample point from the centre of the array cell to somewhere else in the array cell + Vector3DFloat v3dJitter = randomVectors[(uRandomVectorIndex += (++uIndexIncreament)) % 1019]; //Prime number helps avoid repetition on successive loops. + v3dJitter *= v3dHalfRatio; + const Vector3DFloat v3dRayStart = v3dStart + v3dJitter; + + Vector3DFloat v3dRayDirection = randomUnitVectors[(uRandomUnitVectorIndex += (++uIndexIncreament)) % 1021]; //Different prime number. + v3dRayDirection *= fRayLength; + + AmbientOcclusionCalculatorRaycastCallback ambientOcclusionCalculatorRaycastCallback(isVoxelTransparentCallback); + RaycastResult result = raycastWithDirection(volInput, v3dRayStart, v3dRayDirection, ambientOcclusionCalculatorRaycastCallback); + + // Note - The performance of this could actually be improved it we exited as soon + // as the ray left the volume. The raycast test has an example of how to do this. + if(result == RaycastResults::Completed) + { + ++uVisibleDirections; + } + } + + float fVisibility; + if(uNoOfSamplesPerOutputElement == 0) + { + //The user might request zero samples (I've done this in the past while debugging - I don't want to + //wait for ambient occlusion but I do want as valid result for rendering). Avoid the divide by zero. + fVisibility = 1.0f; + } + else + { + fVisibility = static_cast(uVisibleDirections) / static_cast(uNoOfSamplesPerOutputElement); + POLYVOX_ASSERT((fVisibility >= 0.0f) && (fVisibility <= 1.0f), "Visibility value out of range."); + } + + (*arrayResult)(z / iRatioZ, y / iRatioY, x / iRatioX) = static_cast(255.0f * fVisibility); + } + } + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index 276a4f1e..aa03f604 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -1,193 +1,193 @@ -/******************************************************************************* -Copyright (c) 2005-20014 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Array_H__ -#define __PolyVox_Array_H__ - -#include - -#include - -namespace PolyVox -{ - template - class Array - { - public: - - Array(uint32_t width) - :m_pElements(0) - { - static_assert(noOfDims == 1, "This constructor can only be used with a one-dimensional array"); - - m_uDimensions[0] = width; - - initialize(); - } - - Array(uint32_t width, uint32_t height) - :m_pElements(0) - { - static_assert(noOfDims == 2, "This constructor can only be used with a two-dimensional array"); - - m_uDimensions[0] = width; - m_uDimensions[1] = height; - - initialize(); - } - - Array(uint32_t width, uint32_t height, uint32_t depth) - :m_pElements(0) - { - static_assert(noOfDims == 3, "This constructor can only be used with a three-dimensional array"); - - m_uDimensions[0] = width; - m_uDimensions[1] = height; - m_uDimensions[2] = depth; - - initialize(); - } - - // These are deleted to avoid accidental copying. - Array(const Array&) = delete; - Array& operator=(const Array&) = delete; - - ~Array() - { - delete[] m_pElements; - } - - ElementType& operator()(uint32_t x) const - { - static_assert(noOfDims == 1, "This accessor can only be used with a one-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0], "Array access is out-of-range."); - return m_pElements[x]; - } - - ElementType& operator()(uint32_t x, uint32_t y) const - { - static_assert(noOfDims == 2, "This accessor can only be used with a two-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1], "Array access is out-of-range."); - return m_pElements[y * m_uDimensions[0] + x]; - } - - ElementType& operator()(uint32_t x, uint32_t y, uint32_t z) const - { - static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); - POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); - return m_pElements[z * m_uDimensions[0] * m_uDimensions[1] + y * m_uDimensions[0] + x]; - } - - uint32_t getDimension(uint32_t dimension) - { - return m_uDimensions[dimension]; - } - - ElementType* getRawData() - { - return m_pElements; - } - - uint32_t getNoOfElements() - { - return m_uNoOfElements; - } - - void swap(Array& other) - { - ElementType* temp = other.m_pElements; - other.m_pElements = m_pElements; - m_pElements = temp; - } - - private: - - void initialize(void) - { - // Calculate the total number of elements in the array. - m_uNoOfElements = 1; - for (uint32_t i = 0; i < noOfDims; i++) - { - m_uNoOfElements *= m_uDimensions[i]; - } - m_pElements = new ElementType[m_uNoOfElements]; - } - - uint32_t m_uDimensions[noOfDims]; - uint32_t m_uNoOfElements; - ElementType* m_pElements; - }; - - ///A 1D Array of floats. - typedef Array<1, float> Array1DFloat; - ///A 1D Array of doubles. - typedef Array<1, double> Array1DDouble; - ///A 1D Array of signed 8-bit values. - typedef Array<1, int8_t> Array1DInt8; - ///A 1D Array of unsigned 8-bit values. - typedef Array<1, uint8_t> Array1DUint8; - ///A 1D Array of signed 16-bit values. - typedef Array<1, int16_t> Array1DInt16; - ///A 1D Array of unsigned 16-bit values. - typedef Array<1, uint16_t> Array1DUint16; - ///A 1D Array of signed 32-bit values. - typedef Array<1, int32_t> Array1DInt32; - ///A 1D Array of unsigned 32-bit values. - typedef Array<1, uint32_t> Array1DUint32; - - ///A 2D Array of floats. - typedef Array<2, float> Array2DFloat; - ///A 2D Array of doubles. - typedef Array<2, double> Array2DDouble; - ///A 2D Array of signed 8-bit values. - typedef Array<2, int8_t> Array2DInt8; - ///A 2D Array of unsigned 8-bit values. - typedef Array<2, uint8_t> Array2DUint8; - ///A 2D Array of signed 16-bit values. - typedef Array<2, int16_t> Array2DInt16; - ///A 2D Array of unsigned 16-bit values. - typedef Array<2, uint16_t> Array2DUint16; - ///A 2D Array of signed 32-bit values. - typedef Array<2, int32_t> Array2DInt32; - ///A 2D Array of unsigned 32-bit values. - typedef Array<2, uint32_t> Array2DUint32; - - ///A 3D Array of floats. - typedef Array<3, float> Array3DFloat; - ///A 3D Array of doubles. - typedef Array<3, double> Array3DDouble; - ///A 3D Array of signed 8-bit values. - typedef Array<3, int8_t> Array3DInt8; - ///A 3D Array of unsigned 8-bit values. - typedef Array<3, uint8_t> Array3DUint8; - ///A 3D Array of signed 16-bit values. - typedef Array<3, int16_t> Array3DInt16; - ///A 3D Array of unsigned 16-bit values. - typedef Array<3, uint16_t> Array3DUint16; - ///A 3D Array of signed 32-bit values. - typedef Array<3, int32_t> Array3DInt32; - ///A 3D Array of unsigned 32-bit values. - typedef Array<3, uint32_t> Array3DUint32; -} - +/******************************************************************************* +Copyright (c) 2005-20014 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Array_H__ +#define __PolyVox_Array_H__ + +#include + +#include + +namespace PolyVox +{ + template + class Array + { + public: + + Array(uint32_t width) + :m_pElements(0) + { + static_assert(noOfDims == 1, "This constructor can only be used with a one-dimensional array"); + + m_uDimensions[0] = width; + + initialize(); + } + + Array(uint32_t width, uint32_t height) + :m_pElements(0) + { + static_assert(noOfDims == 2, "This constructor can only be used with a two-dimensional array"); + + m_uDimensions[0] = width; + m_uDimensions[1] = height; + + initialize(); + } + + Array(uint32_t width, uint32_t height, uint32_t depth) + :m_pElements(0) + { + static_assert(noOfDims == 3, "This constructor can only be used with a three-dimensional array"); + + m_uDimensions[0] = width; + m_uDimensions[1] = height; + m_uDimensions[2] = depth; + + initialize(); + } + + // These are deleted to avoid accidental copying. + Array(const Array&) = delete; + Array& operator=(const Array&) = delete; + + ~Array() + { + delete[] m_pElements; + } + + ElementType& operator()(uint32_t x) const + { + static_assert(noOfDims == 1, "This accessor can only be used with a one-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0], "Array access is out-of-range."); + return m_pElements[x]; + } + + ElementType& operator()(uint32_t x, uint32_t y) const + { + static_assert(noOfDims == 2, "This accessor can only be used with a two-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1], "Array access is out-of-range."); + return m_pElements[y * m_uDimensions[0] + x]; + } + + ElementType& operator()(uint32_t x, uint32_t y, uint32_t z) const + { + static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); + POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); + return m_pElements[z * m_uDimensions[0] * m_uDimensions[1] + y * m_uDimensions[0] + x]; + } + + uint32_t getDimension(uint32_t dimension) + { + return m_uDimensions[dimension]; + } + + ElementType* getRawData() + { + return m_pElements; + } + + uint32_t getNoOfElements() + { + return m_uNoOfElements; + } + + void swap(Array& other) + { + ElementType* temp = other.m_pElements; + other.m_pElements = m_pElements; + m_pElements = temp; + } + + private: + + void initialize(void) + { + // Calculate the total number of elements in the array. + m_uNoOfElements = 1; + for (uint32_t i = 0; i < noOfDims; i++) + { + m_uNoOfElements *= m_uDimensions[i]; + } + m_pElements = new ElementType[m_uNoOfElements]; + } + + uint32_t m_uDimensions[noOfDims]; + uint32_t m_uNoOfElements; + ElementType* m_pElements; + }; + + ///A 1D Array of floats. + typedef Array<1, float> Array1DFloat; + ///A 1D Array of doubles. + typedef Array<1, double> Array1DDouble; + ///A 1D Array of signed 8-bit values. + typedef Array<1, int8_t> Array1DInt8; + ///A 1D Array of unsigned 8-bit values. + typedef Array<1, uint8_t> Array1DUint8; + ///A 1D Array of signed 16-bit values. + typedef Array<1, int16_t> Array1DInt16; + ///A 1D Array of unsigned 16-bit values. + typedef Array<1, uint16_t> Array1DUint16; + ///A 1D Array of signed 32-bit values. + typedef Array<1, int32_t> Array1DInt32; + ///A 1D Array of unsigned 32-bit values. + typedef Array<1, uint32_t> Array1DUint32; + + ///A 2D Array of floats. + typedef Array<2, float> Array2DFloat; + ///A 2D Array of doubles. + typedef Array<2, double> Array2DDouble; + ///A 2D Array of signed 8-bit values. + typedef Array<2, int8_t> Array2DInt8; + ///A 2D Array of unsigned 8-bit values. + typedef Array<2, uint8_t> Array2DUint8; + ///A 2D Array of signed 16-bit values. + typedef Array<2, int16_t> Array2DInt16; + ///A 2D Array of unsigned 16-bit values. + typedef Array<2, uint16_t> Array2DUint16; + ///A 2D Array of signed 32-bit values. + typedef Array<2, int32_t> Array2DInt32; + ///A 2D Array of unsigned 32-bit values. + typedef Array<2, uint32_t> Array2DUint32; + + ///A 3D Array of floats. + typedef Array<3, float> Array3DFloat; + ///A 3D Array of doubles. + typedef Array<3, double> Array3DDouble; + ///A 3D Array of signed 8-bit values. + typedef Array<3, int8_t> Array3DInt8; + ///A 3D Array of unsigned 8-bit values. + typedef Array<3, uint8_t> Array3DUint8; + ///A 3D Array of signed 16-bit values. + typedef Array<3, int16_t> Array3DInt16; + ///A 3D Array of unsigned 16-bit values. + typedef Array<3, uint16_t> Array3DUint16; + ///A 3D Array of signed 32-bit values. + typedef Array<3, int32_t> Array3DInt32; + ///A 3D Array of unsigned 32-bit values. + typedef Array<3, uint32_t> Array3DUint32; +} + #endif //__PolyVox_Array_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h index 84d46c9b..6947188f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h @@ -1,217 +1,217 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_BaseVolume_H__ -#define __PolyVox_BaseVolume_H__ - -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" - -#include - -namespace PolyVox -{ - /// The BaseVolume class provides common functionality and an interface for other volume classes to implement. You should not try to create an instance of this - /// class directly. Instead you should use RawVolume or PagedVolume. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// More details to come... - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - namespace WrapModes - { - enum WrapMode - { - Validate = 0, - Clamp = 1, - Border = 2, - AssumeValid = 3 - }; - } - typedef WrapModes::WrapMode WrapMode; - - // Required for a trick to implement specialization of template member - // functions in template classes. See http://stackoverflow.com/a/4951057 - template struct WrapModeType{}; - - template - class BaseVolume - { - public: - typedef _VoxelType VoxelType; - - #ifndef SWIG - template - class Sampler - { - public: - Sampler(DerivedVolumeType* volume); - ~Sampler(); - - Vector3DInt32 getPosition(void) const; - inline VoxelType getVoxel(void) const; - - bool isCurrentPositionValid(void) const; - - void setPosition(const Vector3DInt32& v3dNewPos); - void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); - inline bool setVoxel(VoxelType tValue); - void setWrapMode(WrapMode eWrapMode, VoxelType tBorder = VoxelType()); - - void movePositiveX(void); - void movePositiveY(void); - void movePositiveZ(void); - - void moveNegativeX(void); - void moveNegativeY(void); - void moveNegativeZ(void); - - inline VoxelType peekVoxel1nx1ny1nz(void) const; - inline VoxelType peekVoxel1nx1ny0pz(void) const; - inline VoxelType peekVoxel1nx1ny1pz(void) const; - inline VoxelType peekVoxel1nx0py1nz(void) const; - inline VoxelType peekVoxel1nx0py0pz(void) const; - inline VoxelType peekVoxel1nx0py1pz(void) const; - inline VoxelType peekVoxel1nx1py1nz(void) const; - inline VoxelType peekVoxel1nx1py0pz(void) const; - inline VoxelType peekVoxel1nx1py1pz(void) const; - - inline VoxelType peekVoxel0px1ny1nz(void) const; - inline VoxelType peekVoxel0px1ny0pz(void) const; - inline VoxelType peekVoxel0px1ny1pz(void) const; - inline VoxelType peekVoxel0px0py1nz(void) const; - inline VoxelType peekVoxel0px0py0pz(void) const; - inline VoxelType peekVoxel0px0py1pz(void) const; - inline VoxelType peekVoxel0px1py1nz(void) const; - inline VoxelType peekVoxel0px1py0pz(void) const; - inline VoxelType peekVoxel0px1py1pz(void) const; - - inline VoxelType peekVoxel1px1ny1nz(void) const; - inline VoxelType peekVoxel1px1ny0pz(void) const; - inline VoxelType peekVoxel1px1ny1pz(void) const; - inline VoxelType peekVoxel1px0py1nz(void) const; - inline VoxelType peekVoxel1px0py0pz(void) const; - inline VoxelType peekVoxel1px0py1pz(void) const; - inline VoxelType peekVoxel1px1py1nz(void) const; - inline VoxelType peekVoxel1px1py0pz(void) const; - inline VoxelType peekVoxel1px1py1pz(void) const; - - protected: - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - - DerivedVolumeType* mVolume; - - //The current position in the volume - int32_t mXPosInVolume; - int32_t mYPosInVolume; - int32_t mZPosInVolume; - - WrapMode m_eWrapMode; - VoxelType m_tBorder; - - //Whether the current position is inside the volume - //FIXME - Replace these with flags - bool m_bIsCurrentPositionValidInX; - bool m_bIsCurrentPositionValidInY; - bool m_bIsCurrentPositionValidInZ; - }; - #endif - - public: - /// Gets the value used for voxels which are outside the volume - VoxelType getBorderValue(void) const; - /// Gets a Region representing the extents of the Volume. - const Region& getEnclosingRegion(void) const; - /// Gets the width of the volume in voxels. - int32_t getWidth(void) const; - /// Gets the height of the volume in voxels. - int32_t getHeight(void) const; - /// Gets the depth of the volume in voxels. - int32_t getDepth(void) const; - /// Gets the length of the longest side in voxels - int32_t getLongestSideLength(void) const; - /// Gets the length of the shortest side in voxels - int32_t getShortestSideLength(void) const; - /// Gets the length of the diagonal in voxels - float getDiagonalLength(void) const; - - /// Gets a voxel at the position given by x,y,z coordinates - template - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - template - VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - /// Gets a voxel at the position given by a 3D vector - POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - - /// Sets the value used for voxels which are outside the volume - void setBorderValue(const VoxelType& tBorder); - /// Sets the voxel at the position given by x,y,z coordinates - void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by a 3D vector - void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); - - /// Calculates approximatly how many bytes of memory the volume is currently using. - uint32_t calculateSizeInBytes(void); - - protected: - /// Constructor for creating a fixed size volume. - BaseVolume(const Region& regValid); - - /// Copy constructor - BaseVolume(const BaseVolume& rhs); - - /// Destructor - ~BaseVolume(); - - /// Assignment operator - BaseVolume& operator=(const BaseVolume& rhs); - - //The size of the volume - Region m_regValidRegion; - - //Some useful sizes - int32_t m_uLongestSideLength; - int32_t m_uShortestSideLength; - float m_fDiagonalLength; - - //The border value - VoxelType m_tBorderValue; - }; -} - -#include "PolyVoxCore/BaseVolume.inl" -#include "PolyVoxCore/BaseVolumeSampler.inl" - -#endif //__PolyVox_BaseVolume_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_BaseVolume_H__ +#define __PolyVox_BaseVolume_H__ + +#include "PolyVoxCore/Region.h" +#include "PolyVoxCore/Vector.h" + +#include + +namespace PolyVox +{ + /// The BaseVolume class provides common functionality and an interface for other volume classes to implement. You should not try to create an instance of this + /// class directly. Instead you should use RawVolume or PagedVolume. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// More details to come... + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + namespace WrapModes + { + enum WrapMode + { + Validate = 0, + Clamp = 1, + Border = 2, + AssumeValid = 3 + }; + } + typedef WrapModes::WrapMode WrapMode; + + // Required for a trick to implement specialization of template member + // functions in template classes. See http://stackoverflow.com/a/4951057 + template struct WrapModeType{}; + + template + class BaseVolume + { + public: + typedef _VoxelType VoxelType; + + #ifndef SWIG + template + class Sampler + { + public: + Sampler(DerivedVolumeType* volume); + ~Sampler(); + + Vector3DInt32 getPosition(void) const; + inline VoxelType getVoxel(void) const; + + bool isCurrentPositionValid(void) const; + + void setPosition(const Vector3DInt32& v3dNewPos); + void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); + inline bool setVoxel(VoxelType tValue); + void setWrapMode(WrapMode eWrapMode, VoxelType tBorder = VoxelType()); + + void movePositiveX(void); + void movePositiveY(void); + void movePositiveZ(void); + + void moveNegativeX(void); + void moveNegativeY(void); + void moveNegativeZ(void); + + inline VoxelType peekVoxel1nx1ny1nz(void) const; + inline VoxelType peekVoxel1nx1ny0pz(void) const; + inline VoxelType peekVoxel1nx1ny1pz(void) const; + inline VoxelType peekVoxel1nx0py1nz(void) const; + inline VoxelType peekVoxel1nx0py0pz(void) const; + inline VoxelType peekVoxel1nx0py1pz(void) const; + inline VoxelType peekVoxel1nx1py1nz(void) const; + inline VoxelType peekVoxel1nx1py0pz(void) const; + inline VoxelType peekVoxel1nx1py1pz(void) const; + + inline VoxelType peekVoxel0px1ny1nz(void) const; + inline VoxelType peekVoxel0px1ny0pz(void) const; + inline VoxelType peekVoxel0px1ny1pz(void) const; + inline VoxelType peekVoxel0px0py1nz(void) const; + inline VoxelType peekVoxel0px0py0pz(void) const; + inline VoxelType peekVoxel0px0py1pz(void) const; + inline VoxelType peekVoxel0px1py1nz(void) const; + inline VoxelType peekVoxel0px1py0pz(void) const; + inline VoxelType peekVoxel0px1py1pz(void) const; + + inline VoxelType peekVoxel1px1ny1nz(void) const; + inline VoxelType peekVoxel1px1ny0pz(void) const; + inline VoxelType peekVoxel1px1ny1pz(void) const; + inline VoxelType peekVoxel1px0py1nz(void) const; + inline VoxelType peekVoxel1px0py0pz(void) const; + inline VoxelType peekVoxel1px0py1pz(void) const; + inline VoxelType peekVoxel1px1py1nz(void) const; + inline VoxelType peekVoxel1px1py0pz(void) const; + inline VoxelType peekVoxel1px1py1pz(void) const; + + protected: + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; + + DerivedVolumeType* mVolume; + + //The current position in the volume + int32_t mXPosInVolume; + int32_t mYPosInVolume; + int32_t mZPosInVolume; + + WrapMode m_eWrapMode; + VoxelType m_tBorder; + + //Whether the current position is inside the volume + //FIXME - Replace these with flags + bool m_bIsCurrentPositionValidInX; + bool m_bIsCurrentPositionValidInY; + bool m_bIsCurrentPositionValidInZ; + }; + #endif + + public: + /// Gets the value used for voxels which are outside the volume + VoxelType getBorderValue(void) const; + /// Gets a Region representing the extents of the Volume. + const Region& getEnclosingRegion(void) const; + /// Gets the width of the volume in voxels. + int32_t getWidth(void) const; + /// Gets the height of the volume in voxels. + int32_t getHeight(void) const; + /// Gets the depth of the volume in voxels. + int32_t getDepth(void) const; + /// Gets the length of the longest side in voxels + int32_t getLongestSideLength(void) const; + /// Gets the length of the shortest side in voxels + int32_t getShortestSideLength(void) const; + /// Gets the length of the diagonal in voxels + float getDiagonalLength(void) const; + + /// Gets a voxel at the position given by x,y,z coordinates + template + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + template + VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; + /// Gets a voxel at the position given by a 3D vector + POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; + + /// Sets the value used for voxels which are outside the volume + void setBorderValue(const VoxelType& tBorder); + /// Sets the voxel at the position given by x,y,z coordinates + void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by a 3D vector + void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by x,y,z coordinates + bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); + /// Sets the voxel at the position given by a 3D vector + bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); + + /// Calculates approximatly how many bytes of memory the volume is currently using. + uint32_t calculateSizeInBytes(void); + + protected: + /// Constructor for creating a fixed size volume. + BaseVolume(const Region& regValid); + + /// Copy constructor + BaseVolume(const BaseVolume& rhs); + + /// Destructor + ~BaseVolume(); + + /// Assignment operator + BaseVolume& operator=(const BaseVolume& rhs); + + //The size of the volume + Region m_regValidRegion; + + //Some useful sizes + int32_t m_uLongestSideLength; + int32_t m_uShortestSideLength; + float m_fDiagonalLength; + + //The border value + VoxelType m_tBorderValue; + }; +} + +#include "PolyVoxCore/BaseVolume.inl" +#include "PolyVoxCore/BaseVolumeSampler.inl" + +#endif //__PolyVox_BaseVolume_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl index aeefc305..4f2d8121 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl @@ -1,314 +1,314 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// This is protected because you should never create a BaseVolume directly, you should instead use one of the derived classes. - /// - /// \sa RawVolume, PagedVolume - //////////////////////////////////////////////////////////////////////////////// - template - BaseVolume::BaseVolume(const Region& regValid) - :m_regValidRegion(regValid) - ,m_tBorderValue() - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the VolumeResampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - BaseVolume::BaseVolume(const BaseVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Destroys the volume - //////////////////////////////////////////////////////////////////////////////// - template - BaseVolume::~BaseVolume() - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the VolumeResampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - BaseVolume& BaseVolume::operator=(const BaseVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// The border value is returned whenever an attempt is made to read a voxel which - /// is outside the extents of the volume. - /// \return The value used for voxels outside of the volume - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType BaseVolume::getBorderValue(void) const - { - return m_tBorderValue; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return A Region representing the extent of the volume. - //////////////////////////////////////////////////////////////////////////////// - template - const Region& BaseVolume::getEnclosingRegion(void) const - { - return m_regValidRegion; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The width of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the width is 64. - /// \sa getHeight(), getDepth() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t BaseVolume::getWidth(void) const - { - return m_regValidRegion.getUpperX() - m_regValidRegion.getLowerX() + 1; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The height of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the height is 64. - /// \sa getWidth(), getDepth() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t BaseVolume::getHeight(void) const - { - return m_regValidRegion.getUpperY() - m_regValidRegion.getLowerY() + 1; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The depth of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the depth is 64. - /// \sa getWidth(), getHeight() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t BaseVolume::getDepth(void) const - { - return m_regValidRegion.getUpperZ() - m_regValidRegion.getLowerZ() + 1; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the shortest side in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return 256. - /// \sa getLongestSideLength(), getDiagonalLength() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t BaseVolume::getShortestSideLength(void) const - { - return m_uShortestSideLength; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the longest side in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return 1024. - /// \sa getShortestSideLength(), getDiagonalLength() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t BaseVolume::getLongestSideLength(void) const - { - return m_uLongestSideLength; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the diagonal in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return sqrt(256*256+512*512+1024*1024) - /// = 1173.139. This value is computed on volume creation so retrieving it is fast. - /// \sa getShortestSideLength(), getLongestSideLength() - //////////////////////////////////////////////////////////////////////////////// - template - float BaseVolume::getDiagonalLength(void) const - { - return m_fDiagonalLength; - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType BaseVolume::getVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tBorder*/) const - { - POLYVOX_ASSERT(false, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType BaseVolume::getVoxel(const Vector3DInt32& /*v3dPos*/, VoxelType /*tBorder*/) const - { - POLYVOX_ASSERT(false, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType BaseVolume::getVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const - { - POLYVOX_ASSERT(false, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param v3dPos The 3D position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType BaseVolume::getVoxel(const Vector3DInt32& /*v3dPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const - { - POLYVOX_ASSERT(false, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType BaseVolume::getVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/) const - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos The 3D position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType BaseVolume::getVoxelAt(const Vector3DInt32& /*v3dPos*/) const - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - return VoxelType(); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param tBorder The value to use for voxels outside the volume. - //////////////////////////////////////////////////////////////////////////////// - template - void BaseVolume::setBorderValue(const VoxelType& tBorder) - { - m_tBorderValue = tBorder; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - //////////////////////////////////////////////////////////////////////////////// - template - void BaseVolume::setVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tValue*/, WrapMode /*eWrapMode*/) - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - //////////////////////////////////////////////////////////////////////////////// - template - void BaseVolume::setVoxel(const Vector3DInt32& /*v3dPos*/, VoxelType /*tValue*/, WrapMode /*eWrapMode*/) - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool BaseVolume::setVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tValue*/) - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - return false; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool BaseVolume::setVoxelAt(const Vector3DInt32& /*v3dPos*/, VoxelType /*tValue*/) - { - POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); - return false; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Note: This function needs reviewing for accuracy... - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t BaseVolume::calculateSizeInBytes(void) - { - return getWidth() * getHeight() * getDepth() * sizeof(VoxelType); - } -} - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////// + /// This is protected because you should never create a BaseVolume directly, you should instead use one of the derived classes. + /// + /// \sa RawVolume, PagedVolume + //////////////////////////////////////////////////////////////////////////////// + template + BaseVolume::BaseVolume(const Region& regValid) + :m_regValidRegion(regValid) + ,m_tBorderValue() + { + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the VolumeResampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + BaseVolume::BaseVolume(const BaseVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Destroys the volume + //////////////////////////////////////////////////////////////////////////////// + template + BaseVolume::~BaseVolume() + { + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the VolumeResampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + BaseVolume& BaseVolume::operator=(const BaseVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// The border value is returned whenever an attempt is made to read a voxel which + /// is outside the extents of the volume. + /// \return The value used for voxels outside of the volume + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType BaseVolume::getBorderValue(void) const + { + return m_tBorderValue; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return A Region representing the extent of the volume. + //////////////////////////////////////////////////////////////////////////////// + template + const Region& BaseVolume::getEnclosingRegion(void) const + { + return m_regValidRegion; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The width of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the width is 64. + /// \sa getHeight(), getDepth() + //////////////////////////////////////////////////////////////////////////////// + template + int32_t BaseVolume::getWidth(void) const + { + return m_regValidRegion.getUpperX() - m_regValidRegion.getLowerX() + 1; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The height of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the height is 64. + /// \sa getWidth(), getDepth() + //////////////////////////////////////////////////////////////////////////////// + template + int32_t BaseVolume::getHeight(void) const + { + return m_regValidRegion.getUpperY() - m_regValidRegion.getLowerY() + 1; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The depth of the volume in voxels. Note that this value is inclusive, so that if the valid range is e.g. 0 to 63 then the depth is 64. + /// \sa getWidth(), getHeight() + //////////////////////////////////////////////////////////////////////////////// + template + int32_t BaseVolume::getDepth(void) const + { + return m_regValidRegion.getUpperZ() - m_regValidRegion.getLowerZ() + 1; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The length of the shortest side in voxels. For example, if a volume has + /// dimensions 256x512x1024 this function will return 256. + /// \sa getLongestSideLength(), getDiagonalLength() + //////////////////////////////////////////////////////////////////////////////// + template + int32_t BaseVolume::getShortestSideLength(void) const + { + return m_uShortestSideLength; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The length of the longest side in voxels. For example, if a volume has + /// dimensions 256x512x1024 this function will return 1024. + /// \sa getShortestSideLength(), getDiagonalLength() + //////////////////////////////////////////////////////////////////////////////// + template + int32_t BaseVolume::getLongestSideLength(void) const + { + return m_uLongestSideLength; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \return The length of the diagonal in voxels. For example, if a volume has + /// dimensions 256x512x1024 this function will return sqrt(256*256+512*512+1024*1024) + /// = 1173.139. This value is computed on volume creation so retrieving it is fast. + /// \sa getShortestSideLength(), getLongestSideLength() + //////////////////////////////////////////////////////////////////////////////// + template + float BaseVolume::getDiagonalLength(void) const + { + return m_fDiagonalLength; + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType BaseVolume::getVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tBorder*/) const + { + POLYVOX_ASSERT(false, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType BaseVolume::getVoxel(const Vector3DInt32& /*v3dPos*/, VoxelType /*tBorder*/) const + { + POLYVOX_ASSERT(false, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType BaseVolume::getVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const + { + POLYVOX_ASSERT(false, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param v3dPos The 3D position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType BaseVolume::getVoxel(const Vector3DInt32& /*v3dPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const + { + POLYVOX_ASSERT(false, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType BaseVolume::getVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/) const + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos The 3D position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType BaseVolume::getVoxelAt(const Vector3DInt32& /*v3dPos*/) const + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + return VoxelType(); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param tBorder The value to use for voxels outside the volume. + //////////////////////////////////////////////////////////////////////////////// + template + void BaseVolume::setBorderValue(const VoxelType& tBorder) + { + m_tBorderValue = tBorder; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + //////////////////////////////////////////////////////////////////////////////// + template + void BaseVolume::setVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tValue*/, WrapMode /*eWrapMode*/) + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + //////////////////////////////////////////////////////////////////////////////// + template + void BaseVolume::setVoxel(const Vector3DInt32& /*v3dPos*/, VoxelType /*tValue*/, WrapMode /*eWrapMode*/) + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool BaseVolume::setVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tValue*/) + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + return false; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool BaseVolume::setVoxelAt(const Vector3DInt32& /*v3dPos*/, VoxelType /*tValue*/) + { + POLYVOX_THROW(not_implemented, "You should never call the base class version of this function."); + return false; + } + + //////////////////////////////////////////////////////////////////////////////// + /// Note: This function needs reviewing for accuracy... + //////////////////////////////////////////////////////////////////////////////// + template + uint32_t BaseVolume::calculateSizeInBytes(void) + { + return getWidth() * getHeight() * getDepth() * sizeof(VoxelType); + } +} + diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl index fedf56f6..0084f0db 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl @@ -1,366 +1,366 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Utility.h" - -namespace PolyVox -{ - template - template - BaseVolume::Sampler::Sampler(DerivedVolumeType* volume) - :mVolume(volume) - ,mXPosInVolume(0) - ,mYPosInVolume(0) - ,mZPosInVolume(0) - ,m_eWrapMode(WrapModes::Border) - ,m_tBorder() - ,m_bIsCurrentPositionValidInX(false) - ,m_bIsCurrentPositionValidInY(false) - ,m_bIsCurrentPositionValidInZ(false) - { - } - - template - template - BaseVolume::Sampler::~Sampler() - { - } - - template - template - Vector3DInt32 BaseVolume::Sampler::getPosition(void) const - { - return Vector3DInt32(mXPosInVolume, mYPosInVolume, mZPosInVolume); - } - - template - template - VoxelType BaseVolume::Sampler::getVoxel(void) const - { - return mVolume->getVoxel(mXPosInVolume, mYPosInVolume, mZPosInVolume, WrapModes::Validate); // FIXME - Use templatised version instead but watch for Linux compile errors. - } - - template - template - bool inline BaseVolume::Sampler::isCurrentPositionValid(void) const - { - return m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ; - } - - template - template - void BaseVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) - { - setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); - } - - template - template - void BaseVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) - { - mXPosInVolume = xPos; - mYPosInVolume = yPos; - mZPosInVolume = zPos; - - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(xPos); - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(yPos); - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(zPos); - } - - template - template - bool BaseVolume::Sampler::setVoxel(VoxelType tValue) - { - return mVolume->setVoxelAt(mXPosInVolume, mYPosInVolume, mZPosInVolume, tValue); - } - - template - template - void BaseVolume::Sampler::setWrapMode(WrapMode eWrapMode, VoxelType tBorder) - { - m_eWrapMode = eWrapMode; - m_tBorder = tBorder; - } - - template - template - void BaseVolume::Sampler::movePositiveX(void) - { - mXPosInVolume++; - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); - } - - template - template - void BaseVolume::Sampler::movePositiveY(void) - { - mYPosInVolume++; - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); - } - - template - template - void BaseVolume::Sampler::movePositiveZ(void) - { - mZPosInVolume++; - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); - } - - template - template - void BaseVolume::Sampler::moveNegativeX(void) - { - mXPosInVolume--; - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); - } - - template - template - void BaseVolume::Sampler::moveNegativeY(void) - { - mYPosInVolume--; - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); - } - - template - template - void BaseVolume::Sampler::moveNegativeZ(void) - { - mZPosInVolume--; - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1ny1nz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1ny0pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1ny1pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx0py1nz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx0py0pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx0py1pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1py1nz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1py0pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1nx1py1pz(void) const - { - return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume + 1); - } - - ////////////////////////////////////////////////////////////////////////// - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1ny1nz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1ny0pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1ny1pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px0py1nz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px0py0pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px0py1pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1py1nz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1py0pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel0px1py1pz(void) const - { - return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume + 1); - } - - ////////////////////////////////////////////////////////////////////////// - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1ny1nz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1ny0pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1ny1pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px0py1nz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px0py0pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px0py1pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1py1nz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume - 1); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1py0pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume ); - } - - template - template - VoxelType BaseVolume::Sampler::peekVoxel1px1py1pz(void) const - { - return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume + 1); - } - - template - template - VoxelType BaseVolume::Sampler::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos) const - { - switch(m_eWrapMode) - { - case WrapModes::Validate: - return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Validate, m_tBorder); - case WrapModes::Clamp: - return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Clamp, m_tBorder); - case WrapModes::Border: - return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Border, m_tBorder); - case WrapModes::AssumeValid: - return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::AssumeValid, m_tBorder); - default: - // Should never happen - POLYVOX_ASSERT(false, "Invalid wrap mode"); - return VoxelType(); - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/Utility.h" + +namespace PolyVox +{ + template + template + BaseVolume::Sampler::Sampler(DerivedVolumeType* volume) + :mVolume(volume) + ,mXPosInVolume(0) + ,mYPosInVolume(0) + ,mZPosInVolume(0) + ,m_eWrapMode(WrapModes::Border) + ,m_tBorder() + ,m_bIsCurrentPositionValidInX(false) + ,m_bIsCurrentPositionValidInY(false) + ,m_bIsCurrentPositionValidInZ(false) + { + } + + template + template + BaseVolume::Sampler::~Sampler() + { + } + + template + template + Vector3DInt32 BaseVolume::Sampler::getPosition(void) const + { + return Vector3DInt32(mXPosInVolume, mYPosInVolume, mZPosInVolume); + } + + template + template + VoxelType BaseVolume::Sampler::getVoxel(void) const + { + return mVolume->getVoxel(mXPosInVolume, mYPosInVolume, mZPosInVolume, WrapModes::Validate); // FIXME - Use templatised version instead but watch for Linux compile errors. + } + + template + template + bool inline BaseVolume::Sampler::isCurrentPositionValid(void) const + { + return m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ; + } + + template + template + void BaseVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) + { + setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); + } + + template + template + void BaseVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) + { + mXPosInVolume = xPos; + mYPosInVolume = yPos; + mZPosInVolume = zPos; + + m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(xPos); + m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(yPos); + m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(zPos); + } + + template + template + bool BaseVolume::Sampler::setVoxel(VoxelType tValue) + { + return mVolume->setVoxelAt(mXPosInVolume, mYPosInVolume, mZPosInVolume, tValue); + } + + template + template + void BaseVolume::Sampler::setWrapMode(WrapMode eWrapMode, VoxelType tBorder) + { + m_eWrapMode = eWrapMode; + m_tBorder = tBorder; + } + + template + template + void BaseVolume::Sampler::movePositiveX(void) + { + mXPosInVolume++; + m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); + } + + template + template + void BaseVolume::Sampler::movePositiveY(void) + { + mYPosInVolume++; + m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); + } + + template + template + void BaseVolume::Sampler::movePositiveZ(void) + { + mZPosInVolume++; + m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); + } + + template + template + void BaseVolume::Sampler::moveNegativeX(void) + { + mXPosInVolume--; + m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); + } + + template + template + void BaseVolume::Sampler::moveNegativeY(void) + { + mYPosInVolume--; + m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); + } + + template + template + void BaseVolume::Sampler::moveNegativeZ(void) + { + mZPosInVolume--; + m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1ny1nz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1ny0pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1ny1pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx0py1nz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx0py0pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx0py1pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1py1nz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1py0pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1nx1py1pz(void) const + { + return getVoxelImpl(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume + 1); + } + + ////////////////////////////////////////////////////////////////////////// + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1ny1nz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1ny0pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1ny1pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px0py1nz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px0py0pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px0py1pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume , mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1py1nz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1py0pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel0px1py1pz(void) const + { + return getVoxelImpl(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume + 1); + } + + ////////////////////////////////////////////////////////////////////////// + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1ny1nz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1ny0pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1ny1pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px0py1nz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px0py0pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px0py1pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1py1nz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume - 1); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1py0pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume ); + } + + template + template + VoxelType BaseVolume::Sampler::peekVoxel1px1py1pz(void) const + { + return getVoxelImpl(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume + 1); + } + + template + template + VoxelType BaseVolume::Sampler::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos) const + { + switch(m_eWrapMode) + { + case WrapModes::Validate: + return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Validate, m_tBorder); + case WrapModes::Clamp: + return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Clamp, m_tBorder); + case WrapModes::Border: + return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Border, m_tBorder); + case WrapModes::AssumeValid: + return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::AssumeValid, m_tBorder); + default: + // Should never happen + POLYVOX_ASSERT(false, "Invalid wrap mode"); + return VoxelType(); + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h index 9e86ee1a..6ea600e9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h @@ -1,158 +1,158 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_CubicSurfaceExtractor_H__ -#define __PolyVox_CubicSurfaceExtractor_H__ - -#include "Impl/TypeDef.h" - -#include "PolyVoxForwardDeclarations.h" - -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? -#include "PolyVoxCore/DefaultIsQuadNeeded.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/Vertex.h" - -namespace PolyVox -{ -#ifdef SWIG - struct CubicVertex -#else - template - struct POLYVOX_API CubicVertex -#endif - { - typedef _DataType DataType; - - // Each component of the position is stored as a single unsigned byte. - // The true position is found by offseting each component by 0.5f. - Vector3DUint8 encodedPosition; - - // User data - DataType data; - }; - - // Convienient shorthand for declaring a mesh of 'cubic' vertices - // Currently disabled because it requires GCC 4.7 - //template - //using CubicMesh = Mesh< CubicVertex, IndexType >; - - /// Decodes a position from a CubicVertex - inline Vector3DFloat decodePosition(const Vector3DUint8& encodedPosition) - { - Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); - result -= 0.5f; // Apply the required offset - return result; - } - - /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. - template - Vertex decodeVertex(const CubicVertex& cubicVertex) - { - Vertex result; - result.position = decodePosition(cubicVertex.encodedPosition); - result.normal.setElements(0.0f, 0.0f, 0.0f); // Currently not calculated - result.data = cubicVertex.data; // Data is not encoded - return result; - } - - /// Do not use this class directly. Use the 'extractCubicSurface' function instead (see examples). - template - class CubicSurfaceExtractor - { - struct IndexAndMaterial - { - int32_t iIndex; - typename VolumeType::VoxelType uMaterial; - }; - - enum FaceNames - { - PositiveX, - PositiveY, - PositiveZ, - NegativeX, - NegativeY, - NegativeZ, - NoOfFaces - }; - - struct Quad - { - Quad(uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) - { - vertices[0] = v0; - vertices[1] = v1; - vertices[2] = v2; - vertices[3] = v3; - } - - uint32_t vertices[4]; - }; - - public: - CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true); - - void execute(); - - private: - int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices); - bool performQuadMerging(std::list& quads); - bool mergeQuads(Quad& q1, Quad& q2); - - IsQuadNeeded m_funcIsQuadNeededCallback; - - //The volume data and a sampler to access it. - VolumeType* m_volData; - - //Information about the region we are currently processing - Region m_regSizeInVoxels; - - //The surface patch we are currently filling. - MeshType* m_meshCurrent; - - //Used to avoid creating duplicate vertices. - Array<3, IndexAndMaterial> m_previousSliceVertices; - Array<3, IndexAndMaterial> m_currentSliceVertices; - - //During extraction we create a number of different lists of quads. All the - //quads in a given list are in the same plane and facing in the same direction. - std::vector< std::list > m_vecQuads[NoOfFaces]; - - //Controls whether quad merging should be performed. This might be undesirable - //is the user needs per-vertex attributes, or to perform per vertex lighting. - bool m_bMergeQuads; - - //This constant defines the maximum number of quads which can share a - //vertex in a cubic style mesh. See the initialisation for more details. - static const uint32_t MaxVerticesPerPosition; - - //The wrap mode - WrapMode m_eWrapMode; - typename VolumeType::VoxelType m_tBorderValue; - }; - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_CubicSurfaceExtractor_H__ +#define __PolyVox_CubicSurfaceExtractor_H__ + +#include "Impl/TypeDef.h" + +#include "PolyVoxForwardDeclarations.h" + +#include "PolyVoxCore/Array.h" +#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? +#include "PolyVoxCore/DefaultIsQuadNeeded.h" +#include "PolyVoxCore/Mesh.h" +#include "PolyVoxCore/Vertex.h" + +namespace PolyVox +{ +#ifdef SWIG + struct CubicVertex +#else + template + struct POLYVOX_API CubicVertex +#endif + { + typedef _DataType DataType; + + // Each component of the position is stored as a single unsigned byte. + // The true position is found by offseting each component by 0.5f. + Vector3DUint8 encodedPosition; + + // User data + DataType data; + }; + + // Convienient shorthand for declaring a mesh of 'cubic' vertices + // Currently disabled because it requires GCC 4.7 + //template + //using CubicMesh = Mesh< CubicVertex, IndexType >; + + /// Decodes a position from a CubicVertex + inline Vector3DFloat decodePosition(const Vector3DUint8& encodedPosition) + { + Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); + result -= 0.5f; // Apply the required offset + return result; + } + + /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. + template + Vertex decodeVertex(const CubicVertex& cubicVertex) + { + Vertex result; + result.position = decodePosition(cubicVertex.encodedPosition); + result.normal.setElements(0.0f, 0.0f, 0.0f); // Currently not calculated + result.data = cubicVertex.data; // Data is not encoded + return result; + } + + /// Do not use this class directly. Use the 'extractCubicSurface' function instead (see examples). + template + class CubicSurfaceExtractor + { + struct IndexAndMaterial + { + int32_t iIndex; + typename VolumeType::VoxelType uMaterial; + }; + + enum FaceNames + { + PositiveX, + PositiveY, + PositiveZ, + NegativeX, + NegativeY, + NegativeZ, + NoOfFaces + }; + + struct Quad + { + Quad(uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) + { + vertices[0] = v0; + vertices[1] = v1; + vertices[2] = v2; + vertices[3] = v3; + } + + uint32_t vertices[4]; + }; + + public: + CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true); + + void execute(); + + private: + int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices); + bool performQuadMerging(std::list& quads); + bool mergeQuads(Quad& q1, Quad& q2); + + IsQuadNeeded m_funcIsQuadNeededCallback; + + //The volume data and a sampler to access it. + VolumeType* m_volData; + + //Information about the region we are currently processing + Region m_regSizeInVoxels; + + //The surface patch we are currently filling. + MeshType* m_meshCurrent; + + //Used to avoid creating duplicate vertices. + Array<3, IndexAndMaterial> m_previousSliceVertices; + Array<3, IndexAndMaterial> m_currentSliceVertices; + + //During extraction we create a number of different lists of quads. All the + //quads in a given list are in the same plane and facing in the same direction. + std::vector< std::list > m_vecQuads[NoOfFaces]; + + //Controls whether quad merging should be performed. This might be undesirable + //is the user needs per-vertex attributes, or to perform per vertex lighting. + bool m_bMergeQuads; + + //This constant defines the maximum number of quads which can share a + //vertex in a cubic style mesh. See the initialisation for more details. + static const uint32_t MaxVerticesPerPosition; + + //The wrap mode + WrapMode m_eWrapMode; + typename VolumeType::VoxelType m_tBorderValue; + }; + // This version of the function performs the extraction into a user-provided mesh rather than allocating a mesh automatically. // There are a few reasons why this might be useful to more advanced users: // @@ -165,64 +165,64 @@ namespace PolyVox // // Note: This function is called 'extractCubicMeshCustom' rather than 'extractCubicMesh' to avoid ambiguity when only three parameters // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, - // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. - template > - void extractCubicMeshCustom(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) - { - CubicSurfaceExtractor extractor(volData, region, result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); - extractor.execute(); - } - - /// The CubicSurfaceExtractor creates a mesh in which each voxel appears to be rendered as a cube - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Introduction - /// ------------ - /// Games such as Minecraft and Voxatron have a unique graphical style in which each voxel in the world appears to be rendered as a single cube. Actually rendering a cube for each voxel would be very expensive, but in practice the only faces which need to be drawn are those which lie on the boundary between solid and empty voxels. The CubicSurfaceExtractor can be used to create such a mesh from PolyVox volume data. As an example, images from Minecraft and Voxatron are shown below: - /// - /// \image html MinecraftAndVoxatron.jpg - /// - /// Before we get into the specifics of the CubicSurfaceExtractor, it is useful to understand the principles which apply to *all* PolyVox surface extractors and which are described in the Surface Extraction document (ADD LINK). From here on, it is assumed that you are familier with PolyVox regions and how they are used to limit surface extraction to a particular part of the volume. The principles of allowing dynamic terrain are also common to all surface extractors and are described here (ADD LINK). - /// - /// Basic Operation - /// --------------- - /// At its core, the CubicSurfaceExtractor works by by looking at pairs of adjacent voxels and determining whether a quad should be placed between then. The most simple situation to imagine is a binary volume where every voxel is either solid or empty. In this case a quad should be generated whenever a solid voxel is next to an empty voxel as this represents part of the surface of the solid object. There is no need to generate a quad between two solid voxels (this quad would never be seen as it is inside the object) and there is no need to generate a quad between two empty voxels (there is no object here). PolyVox allows the principle to be extended far beyond such simple binary volumes but they provide a useful starting point for understanding how the algorithm works. - /// - /// As an example, lets consider the part of a volume shown below. We are going to explain the principles in only two dimensions as this makes it much simpler to illustrate, so you will need to mentally extend the process into the third dimension. Hopefully you will find this intuitive. The diagram below shows a small part of a larger volume (as indicated by the voxel coordinates on the axes) which contains only solid and empty voxels represented by solid and hollow circles respectively. The region on which we are running the surface extractor is marked in pink, and for the purpose of this example it corresponds to the whole of the diagram. - /// - /// \image html CubicSurfaceExtractor1.png - /// - /// The output of the surface extractor is the mesh marked in red. As you can see, this forms a closed object which corrsponds to the shape of the underlying voxel data. We won't describe the rendering of such meshes here - for details of this please see (SOME LINK HERE). - /// - /// Working with Regions - /// -------------------- - /// So far the behaviour is easy to understand, but let's look at what happens when the extraction is limited to a particular region of the volume. The figure below shows the same data set as the previous figure, but the extraction region (still marked in pink) has been limited to 13 to 16 in x and 47 to 51 in y: - /// - /// \image html CubicSurfaceExtractor2.png - /// - /// As you can see, the extractor continues to generate a number of quads as indicated by the solid red lines. However, you can also see that the shape is no longer closed. This is because the solid voxels actually extend outside the region which is being processed, and so the extractor does not encounter a boundary between solid and empty voxels. Although this may initially appear problematic, the hole in the mesh does not actually matter because it will be hidden by the mesh corresponding to the region adjacent to it (see next diagram). - /// - /// More interestingly, the diagram also contains a couple of dotted red lines lying on the bottom and right hand side of the extracted region. These are present to illustrate a common point of confusion, which is that *no quads are generated at this position even though it is a boundary between solid and empty voxels*. This is indeed somewhat counter intuitive but there is a rational reasaoning behind it. - /// If you consider the dashed line on the righthand side of the extracted region, then it is clear that this lies on a boundary between solid and empty voxels and so we do need to create quads here. But what is not so clear is whether these quads should be assigned to the mesh which corresponds to the region in pink, or whether they should be assigned to the region to the right of it which is marked in blue in the diagram below: - /// - /// \image html CubicSurfaceExtractor3.png - /// - /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent voxels from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). - /// - /// **Note:** *This behaviour has changed recently (September 2012). Earlier versions of PolyVox tried to be smart about this problem by looking beyond the region which was being processed, but this complicated the code and didn't work very well. Ultimatly we decided to simply stick with the convention outlined above.* - /// - /// One of the practical implications of this is that when you modify a voxel *you may have to re-extract the mesh for regions other than region which actually contains the voxel you modified.* This happens when the voxel lies on the upper x,y or z face of a region. Assuming that you have some management code which can mark a region as needing re-extraction when a voxel changes, you should probably extend this to mark the regions of neighbouring voxels as invalid (this will have no effect when the voxel is well within a region, but will mark the neighbouring region as needing an update if the voxel lies on a region face). - /// - /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - template > - Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) - { - Mesh< CubicVertex > result; - extractCubicMeshCustom(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); - return result; - } -} - -#include "PolyVoxCore/CubicSurfaceExtractor.inl" - -#endif + // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. + template > + void extractCubicMeshCustom(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + { + CubicSurfaceExtractor extractor(volData, region, result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); + extractor.execute(); + } + + /// The CubicSurfaceExtractor creates a mesh in which each voxel appears to be rendered as a cube + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Introduction + /// ------------ + /// Games such as Minecraft and Voxatron have a unique graphical style in which each voxel in the world appears to be rendered as a single cube. Actually rendering a cube for each voxel would be very expensive, but in practice the only faces which need to be drawn are those which lie on the boundary between solid and empty voxels. The CubicSurfaceExtractor can be used to create such a mesh from PolyVox volume data. As an example, images from Minecraft and Voxatron are shown below: + /// + /// \image html MinecraftAndVoxatron.jpg + /// + /// Before we get into the specifics of the CubicSurfaceExtractor, it is useful to understand the principles which apply to *all* PolyVox surface extractors and which are described in the Surface Extraction document (ADD LINK). From here on, it is assumed that you are familier with PolyVox regions and how they are used to limit surface extraction to a particular part of the volume. The principles of allowing dynamic terrain are also common to all surface extractors and are described here (ADD LINK). + /// + /// Basic Operation + /// --------------- + /// At its core, the CubicSurfaceExtractor works by by looking at pairs of adjacent voxels and determining whether a quad should be placed between then. The most simple situation to imagine is a binary volume where every voxel is either solid or empty. In this case a quad should be generated whenever a solid voxel is next to an empty voxel as this represents part of the surface of the solid object. There is no need to generate a quad between two solid voxels (this quad would never be seen as it is inside the object) and there is no need to generate a quad between two empty voxels (there is no object here). PolyVox allows the principle to be extended far beyond such simple binary volumes but they provide a useful starting point for understanding how the algorithm works. + /// + /// As an example, lets consider the part of a volume shown below. We are going to explain the principles in only two dimensions as this makes it much simpler to illustrate, so you will need to mentally extend the process into the third dimension. Hopefully you will find this intuitive. The diagram below shows a small part of a larger volume (as indicated by the voxel coordinates on the axes) which contains only solid and empty voxels represented by solid and hollow circles respectively. The region on which we are running the surface extractor is marked in pink, and for the purpose of this example it corresponds to the whole of the diagram. + /// + /// \image html CubicSurfaceExtractor1.png + /// + /// The output of the surface extractor is the mesh marked in red. As you can see, this forms a closed object which corrsponds to the shape of the underlying voxel data. We won't describe the rendering of such meshes here - for details of this please see (SOME LINK HERE). + /// + /// Working with Regions + /// -------------------- + /// So far the behaviour is easy to understand, but let's look at what happens when the extraction is limited to a particular region of the volume. The figure below shows the same data set as the previous figure, but the extraction region (still marked in pink) has been limited to 13 to 16 in x and 47 to 51 in y: + /// + /// \image html CubicSurfaceExtractor2.png + /// + /// As you can see, the extractor continues to generate a number of quads as indicated by the solid red lines. However, you can also see that the shape is no longer closed. This is because the solid voxels actually extend outside the region which is being processed, and so the extractor does not encounter a boundary between solid and empty voxels. Although this may initially appear problematic, the hole in the mesh does not actually matter because it will be hidden by the mesh corresponding to the region adjacent to it (see next diagram). + /// + /// More interestingly, the diagram also contains a couple of dotted red lines lying on the bottom and right hand side of the extracted region. These are present to illustrate a common point of confusion, which is that *no quads are generated at this position even though it is a boundary between solid and empty voxels*. This is indeed somewhat counter intuitive but there is a rational reasaoning behind it. + /// If you consider the dashed line on the righthand side of the extracted region, then it is clear that this lies on a boundary between solid and empty voxels and so we do need to create quads here. But what is not so clear is whether these quads should be assigned to the mesh which corresponds to the region in pink, or whether they should be assigned to the region to the right of it which is marked in blue in the diagram below: + /// + /// \image html CubicSurfaceExtractor3.png + /// + /// We could choose to add the quads to *both* regions, but this can cause confusion when one of the region is modified (causing the face to disappear or a new one to be created) as *both* regions need to have their mesh regenerated to correctly represent the new state of the volume data. Such pairs of coplanar quads can also cause problems with physics engines, and may prevent transparent voxels from rendering correctly. Therefore we choose to instead only add the quad to one of the the regions and we always choose the one with the greater coordinate value in the direction in which they differ. In the above example the regions differ by the 'x' component of their position, and so the quad is added to the region with the greater 'x' value (the one marked in blue). + /// + /// **Note:** *This behaviour has changed recently (September 2012). Earlier versions of PolyVox tried to be smart about this problem by looking beyond the region which was being processed, but this complicated the code and didn't work very well. Ultimatly we decided to simply stick with the convention outlined above.* + /// + /// One of the practical implications of this is that when you modify a voxel *you may have to re-extract the mesh for regions other than region which actually contains the voxel you modified.* This happens when the voxel lies on the upper x,y or z face of a region. Assuming that you have some management code which can mark a region as needing re-extraction when a voxel changes, you should probably extend this to mark the regions of neighbouring voxels as invalid (this will have no effect when the voxel is well within a region, but will mark the neighbouring region as needing an update if the voxel lies on a region face). + /// + /// Another scenario which sometimes results in confusion is when you wish to extract a region which corresponds to the whole volume, partcularly when solid voxels extend right to the edge of the volume. + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template > + Mesh > extractCubicMesh(VolumeType* volData, Region region, IsQuadNeeded isQuadNeeded = IsQuadNeeded(), WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true) + { + Mesh< CubicVertex > result; + extractCubicMeshCustom(volData, region, &result, isQuadNeeded, eWrapMode, tBorderValue, bMergeQuads); + return result; + } +} + +#include "PolyVoxCore/CubicSurfaceExtractor.inl" + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index bcf4247d..a406d7c5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -1,310 +1,310 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Timer.h" - -namespace PolyVox -{ - // We try to avoid duplicate vertices by checking whether a vertex has already been added at a given position. - // However, it is possible that vertices have the same position but different materials. In this case, the - // vertices are not true duplicates and both must be added to the mesh. As far as I can tell, it is possible to have - // at most eight vertices with the same position but different materials. For example, this worst-case scenario - // happens when we have a 2x2x2 group of voxels, all with different materials and some/all partially transparent. - // The vertex position at the center of this group is then going to be used by all eight voxels all with different - // materials. - template - const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; - - template - CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads) - :m_volData(volData) - ,m_regSizeInVoxels(region) - ,m_meshCurrent(result) - ,m_bMergeQuads(bMergeQuads) - ,m_eWrapMode(eWrapMode) - ,m_tBorderValue(tBorderValue) - ,m_previousSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) - ,m_currentSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) - { - m_funcIsQuadNeededCallback = isQuadNeeded; - - // This extractor has a limit as to how large the extracted region can be, because the vertex positions are encoded with a single byte per component. - int32_t maxReionDimension = 256; - POLYVOX_THROW_IF(region.getWidthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); - POLYVOX_THROW_IF(region.getHeightInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); - POLYVOX_THROW_IF(region.getDepthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); - } - - template - void CubicSurfaceExtractor::execute() - { - Timer timer; - m_meshCurrent->clear(); - - //uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2; - //uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2; - - //uint32_t arraySize[3]= {uArrayWidth, uArrayHeight, MaxVerticesPerPosition}; - //m_previousSliceVertices.resize(arraySize); - //m_currentSliceVertices.resize(arraySize); - memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); - memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); - - m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); - m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); - - m_vecQuads[NegativeY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); - m_vecQuads[PositiveY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); - - m_vecQuads[NegativeZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); - m_vecQuads[PositiveZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); - - typename VolumeType::Sampler volumeSampler(m_volData); - volumeSampler.setWrapMode(m_eWrapMode, m_tBorderValue); - - for(int32_t z = m_regSizeInVoxels.getLowerZ(); z <= m_regSizeInVoxels.getUpperZ(); z++) - { - uint32_t regZ = z - m_regSizeInVoxels.getLowerZ(); - - for(int32_t y = m_regSizeInVoxels.getLowerY(); y <= m_regSizeInVoxels.getUpperY(); y++) - { - uint32_t regY = y - m_regSizeInVoxels.getLowerY(); - - volumeSampler.setPosition(m_regSizeInVoxels.getLowerX(),y,z); - - for(int32_t x = m_regSizeInVoxels.getLowerX(); x <= m_regSizeInVoxels.getUpperX(); x++) - { - uint32_t regX = x - m_regSizeInVoxels.getLowerX(); - - typename VolumeType::VoxelType material; //Filled in by callback - typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); - typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); - typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); - typename VolumeType::VoxelType negZVoxel = volumeSampler.peekVoxel0px0py1nz(); - - // X - if(m_funcIsQuadNeededCallback(currentVoxel, negXVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); - uint32_t v2 = addVertex(regX , regY + 1, regZ + 1, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); - - m_vecQuads[NegativeX][regX].push_back(Quad(v0, v1, v2, v3)); - } - - if(m_funcIsQuadNeededCallback(negXVoxel, currentVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); - uint32_t v2 = addVertex(regX , regY + 1, regZ + 1, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); - - m_vecQuads[PositiveX][regX].push_back(Quad(v0, v3, v2, v1)); - } - - // Y - if(m_funcIsQuadNeededCallback(currentVoxel, negYVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 1, regY , regZ + 1, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); - - m_vecQuads[NegativeY][regY].push_back(Quad(v0, v1, v2, v3)); - } - - if(m_funcIsQuadNeededCallback(negYVoxel, currentVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 1, regY , regZ + 1, material, m_currentSliceVertices); - uint32_t v3 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); - - m_vecQuads[PositiveY][regY].push_back(Quad(v0, v3, v2, v1)); - } - - // Z - if(m_funcIsQuadNeededCallback(currentVoxel, negZVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 1, regY + 1, regZ , material, m_previousSliceVertices); - uint32_t v3 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); - - m_vecQuads[NegativeZ][regZ].push_back(Quad(v0, v1, v2, v3)); - } - - if(m_funcIsQuadNeededCallback(negZVoxel, currentVoxel, material)) - { - uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); - uint32_t v1 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); - uint32_t v2 = addVertex(regX + 1, regY + 1, regZ , material, m_previousSliceVertices); - uint32_t v3 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); - - m_vecQuads[PositiveZ][regZ].push_back(Quad(v0, v3, v2, v1)); - } - - volumeSampler.movePositiveX(); - } - } - - m_previousSliceVertices.swap(m_currentSliceVertices); - memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); - } - - for(uint32_t uFace = 0; uFace < NoOfFaces; uFace++) - { - std::vector< std::list >& vecListQuads = m_vecQuads[uFace]; - - for(uint32_t slice = 0; slice < vecListQuads.size(); slice++) - { - std::list& listQuads = vecListQuads[slice]; - - if(m_bMergeQuads) - { - //Repeatedly call this function until it returns - //false to indicate nothing more can be done. - while(performQuadMerging(listQuads)){} - } - - typename std::list::iterator iterEnd = listQuads.end(); - for(typename std::list::iterator quadIter = listQuads.begin(); quadIter != iterEnd; quadIter++) - { - Quad& quad = *quadIter; - m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[1],quad.vertices[2]); - m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[2],quad.vertices[3]); - } - } - } - - m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); - m_meshCurrent->removeUnusedVertices(); - - POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds() - << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() - << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); - } - - template - int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) - { - for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) - { - IndexAndMaterial& rEntry = existingVertices(uX, uY, ct); - - if(rEntry.iIndex == -1) - { - //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. - CubicVertex cubicVertex; - cubicVertex.encodedPosition.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); - cubicVertex.data = uMaterialIn; - rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); - rEntry.uMaterial = uMaterialIn; - - return rEntry.iIndex; - } - - //If we have an existing vertex and the material matches then we can return it. - if(rEntry.uMaterial == uMaterialIn) - { - return rEntry.iIndex; - } - } - - // If we exit the loop here then apparently all the slots were full but none of them matched. - // This shouldn't ever happen, so if it does it is probably a bug in PolyVox. Please report it to us! - POLYVOX_THROW(std::runtime_error, "All slots full but no matches during cubic surface extraction. This is probably a bug in PolyVox"); - return -1; //Should never happen. - } - - template - bool CubicSurfaceExtractor::performQuadMerging(std::list& quads) - { - bool bDidMerge = false; - for(typename std::list::iterator outerIter = quads.begin(); outerIter != quads.end(); outerIter++) - { - typename std::list::iterator innerIter = outerIter; - innerIter++; - while(innerIter != quads.end()) - { - Quad& q1 = *outerIter; - Quad& q2 = *innerIter; - - bool result = mergeQuads(q1,q2); - - if(result) - { - bDidMerge = true; - innerIter = quads.erase(innerIter); - } - else - { - innerIter++; - } - } - } - - return bDidMerge; - } - - template - bool CubicSurfaceExtractor::mergeQuads(Quad& q1, Quad& q2) - { - //All four vertices of a given quad have the same data, - //so just check that the first pair of vertices match. - if (m_meshCurrent->getVertices()[q1.vertices[0]].data == m_meshCurrent->getVertices()[q2.vertices[0]].data) - { - //Now check whether quad 2 is adjacent to quad one by comparing vertices. - //Adjacent quads must share two vertices, and the second quad could be to the - //top, bottom, left, of right of the first one. This gives four combinations to test. - if((q1.vertices[0] == q2.vertices[1]) && ((q1.vertices[3] == q2.vertices[2]))) - { - q1.vertices[0] = q2.vertices[0]; - q1.vertices[3] = q2.vertices[3]; - return true; - } - else if((q1.vertices[3] == q2.vertices[0]) && ((q1.vertices[2] == q2.vertices[1]))) - { - q1.vertices[3] = q2.vertices[3]; - q1.vertices[2] = q2.vertices[2]; - return true; - } - else if((q1.vertices[1] == q2.vertices[0]) && ((q1.vertices[2] == q2.vertices[3]))) - { - q1.vertices[1] = q2.vertices[1]; - q1.vertices[2] = q2.vertices[2]; - return true; - } - else if((q1.vertices[0] == q2.vertices[3]) && ((q1.vertices[1] == q2.vertices[2]))) - { - q1.vertices[0] = q2.vertices[0]; - q1.vertices[1] = q2.vertices[1]; - return true; - } - } - - //Quads cannot be merged. - return false; - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/Timer.h" + +namespace PolyVox +{ + // We try to avoid duplicate vertices by checking whether a vertex has already been added at a given position. + // However, it is possible that vertices have the same position but different materials. In this case, the + // vertices are not true duplicates and both must be added to the mesh. As far as I can tell, it is possible to have + // at most eight vertices with the same position but different materials. For example, this worst-case scenario + // happens when we have a 2x2x2 group of voxels, all with different materials and some/all partially transparent. + // The vertex position at the center of this group is then going to be used by all eight voxels all with different + // materials. + template + const uint32_t CubicSurfaceExtractor::MaxVerticesPerPosition = 8; + + template + CubicSurfaceExtractor::CubicSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, IsQuadNeeded isQuadNeeded, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads) + :m_volData(volData) + ,m_regSizeInVoxels(region) + ,m_meshCurrent(result) + ,m_bMergeQuads(bMergeQuads) + ,m_eWrapMode(eWrapMode) + ,m_tBorderValue(tBorderValue) + ,m_previousSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) + ,m_currentSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) + { + m_funcIsQuadNeededCallback = isQuadNeeded; + + // This extractor has a limit as to how large the extracted region can be, because the vertex positions are encoded with a single byte per component. + int32_t maxReionDimension = 256; + POLYVOX_THROW_IF(region.getWidthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); + POLYVOX_THROW_IF(region.getHeightInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); + POLYVOX_THROW_IF(region.getDepthInVoxels() > maxReionDimension, std::invalid_argument, "Requested extraction region exceeds maximum dimensions"); + } + + template + void CubicSurfaceExtractor::execute() + { + Timer timer; + m_meshCurrent->clear(); + + //uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2; + //uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2; + + //uint32_t arraySize[3]= {uArrayWidth, uArrayHeight, MaxVerticesPerPosition}; + //m_previousSliceVertices.resize(arraySize); + //m_currentSliceVertices.resize(arraySize); + memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); + memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); + + m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); + m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2); + + m_vecQuads[NegativeY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); + m_vecQuads[PositiveY].resize(m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2); + + m_vecQuads[NegativeZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); + m_vecQuads[PositiveZ].resize(m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ() + 2); + + typename VolumeType::Sampler volumeSampler(m_volData); + volumeSampler.setWrapMode(m_eWrapMode, m_tBorderValue); + + for(int32_t z = m_regSizeInVoxels.getLowerZ(); z <= m_regSizeInVoxels.getUpperZ(); z++) + { + uint32_t regZ = z - m_regSizeInVoxels.getLowerZ(); + + for(int32_t y = m_regSizeInVoxels.getLowerY(); y <= m_regSizeInVoxels.getUpperY(); y++) + { + uint32_t regY = y - m_regSizeInVoxels.getLowerY(); + + volumeSampler.setPosition(m_regSizeInVoxels.getLowerX(),y,z); + + for(int32_t x = m_regSizeInVoxels.getLowerX(); x <= m_regSizeInVoxels.getUpperX(); x++) + { + uint32_t regX = x - m_regSizeInVoxels.getLowerX(); + + typename VolumeType::VoxelType material; //Filled in by callback + typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); + typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); + typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); + typename VolumeType::VoxelType negZVoxel = volumeSampler.peekVoxel0px0py1nz(); + + // X + if(m_funcIsQuadNeededCallback(currentVoxel, negXVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); + uint32_t v2 = addVertex(regX , regY + 1, regZ + 1, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); + + m_vecQuads[NegativeX][regX].push_back(Quad(v0, v1, v2, v3)); + } + + if(m_funcIsQuadNeededCallback(negXVoxel, currentVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); + uint32_t v2 = addVertex(regX , regY + 1, regZ + 1, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); + + m_vecQuads[PositiveX][regX].push_back(Quad(v0, v3, v2, v1)); + } + + // Y + if(m_funcIsQuadNeededCallback(currentVoxel, negYVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 1, regY , regZ + 1, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); + + m_vecQuads[NegativeY][regY].push_back(Quad(v0, v1, v2, v3)); + } + + if(m_funcIsQuadNeededCallback(negYVoxel, currentVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 1, regY , regZ + 1, material, m_currentSliceVertices); + uint32_t v3 = addVertex(regX , regY , regZ + 1, material, m_currentSliceVertices); + + m_vecQuads[PositiveY][regY].push_back(Quad(v0, v3, v2, v1)); + } + + // Z + if(m_funcIsQuadNeededCallback(currentVoxel, negZVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 1, regY + 1, regZ , material, m_previousSliceVertices); + uint32_t v3 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); + + m_vecQuads[NegativeZ][regZ].push_back(Quad(v0, v1, v2, v3)); + } + + if(m_funcIsQuadNeededCallback(negZVoxel, currentVoxel, material)) + { + uint32_t v0 = addVertex(regX , regY , regZ , material, m_previousSliceVertices); + uint32_t v1 = addVertex(regX , regY + 1, regZ , material, m_previousSliceVertices); + uint32_t v2 = addVertex(regX + 1, regY + 1, regZ , material, m_previousSliceVertices); + uint32_t v3 = addVertex(regX + 1, regY , regZ , material, m_previousSliceVertices); + + m_vecQuads[PositiveZ][regZ].push_back(Quad(v0, v3, v2, v1)); + } + + volumeSampler.movePositiveX(); + } + } + + m_previousSliceVertices.swap(m_currentSliceVertices); + memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); + } + + for(uint32_t uFace = 0; uFace < NoOfFaces; uFace++) + { + std::vector< std::list >& vecListQuads = m_vecQuads[uFace]; + + for(uint32_t slice = 0; slice < vecListQuads.size(); slice++) + { + std::list& listQuads = vecListQuads[slice]; + + if(m_bMergeQuads) + { + //Repeatedly call this function until it returns + //false to indicate nothing more can be done. + while(performQuadMerging(listQuads)){} + } + + typename std::list::iterator iterEnd = listQuads.end(); + for(typename std::list::iterator quadIter = listQuads.begin(); quadIter != iterEnd; quadIter++) + { + Quad& quad = *quadIter; + m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[1],quad.vertices[2]); + m_meshCurrent->addTriangle(quad.vertices[0], quad.vertices[2],quad.vertices[3]); + } + } + } + + m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); + m_meshCurrent->removeUnusedVertices(); + + POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds() + << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() + << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); + } + + template + int32_t CubicSurfaceExtractor::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices) + { + for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++) + { + IndexAndMaterial& rEntry = existingVertices(uX, uY, ct); + + if(rEntry.iIndex == -1) + { + //No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them. + CubicVertex cubicVertex; + cubicVertex.encodedPosition.setElements(static_cast(uX), static_cast(uY), static_cast(uZ)); + cubicVertex.data = uMaterialIn; + rEntry.iIndex = m_meshCurrent->addVertex(cubicVertex); + rEntry.uMaterial = uMaterialIn; + + return rEntry.iIndex; + } + + //If we have an existing vertex and the material matches then we can return it. + if(rEntry.uMaterial == uMaterialIn) + { + return rEntry.iIndex; + } + } + + // If we exit the loop here then apparently all the slots were full but none of them matched. + // This shouldn't ever happen, so if it does it is probably a bug in PolyVox. Please report it to us! + POLYVOX_THROW(std::runtime_error, "All slots full but no matches during cubic surface extraction. This is probably a bug in PolyVox"); + return -1; //Should never happen. + } + + template + bool CubicSurfaceExtractor::performQuadMerging(std::list& quads) + { + bool bDidMerge = false; + for(typename std::list::iterator outerIter = quads.begin(); outerIter != quads.end(); outerIter++) + { + typename std::list::iterator innerIter = outerIter; + innerIter++; + while(innerIter != quads.end()) + { + Quad& q1 = *outerIter; + Quad& q2 = *innerIter; + + bool result = mergeQuads(q1,q2); + + if(result) + { + bDidMerge = true; + innerIter = quads.erase(innerIter); + } + else + { + innerIter++; + } + } + } + + return bDidMerge; + } + + template + bool CubicSurfaceExtractor::mergeQuads(Quad& q1, Quad& q2) + { + //All four vertices of a given quad have the same data, + //so just check that the first pair of vertices match. + if (m_meshCurrent->getVertices()[q1.vertices[0]].data == m_meshCurrent->getVertices()[q2.vertices[0]].data) + { + //Now check whether quad 2 is adjacent to quad one by comparing vertices. + //Adjacent quads must share two vertices, and the second quad could be to the + //top, bottom, left, of right of the first one. This gives four combinations to test. + if((q1.vertices[0] == q2.vertices[1]) && ((q1.vertices[3] == q2.vertices[2]))) + { + q1.vertices[0] = q2.vertices[0]; + q1.vertices[3] = q2.vertices[3]; + return true; + } + else if((q1.vertices[3] == q2.vertices[0]) && ((q1.vertices[2] == q2.vertices[1]))) + { + q1.vertices[3] = q2.vertices[3]; + q1.vertices[2] = q2.vertices[2]; + return true; + } + else if((q1.vertices[1] == q2.vertices[0]) && ((q1.vertices[2] == q2.vertices[3]))) + { + q1.vertices[1] = q2.vertices[1]; + q1.vertices[2] = q2.vertices[2]; + return true; + } + else if((q1.vertices[0] == q2.vertices[3]) && ((q1.vertices[1] == q2.vertices[2]))) + { + q1.vertices[0] = q2.vertices[0]; + q1.vertices[1] = q2.vertices[1]; + return true; + } + } + + //Quads cannot be merged. + return false; + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index 86e2ee6d..ef15444e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -1,52 +1,52 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_DefaultIsQuadNeeded_H__ -#define __PolyVox_DefaultIsQuadNeeded_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - template - class DefaultIsQuadNeeded - { +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_DefaultIsQuadNeeded_H__ +#define __PolyVox_DefaultIsQuadNeeded_H__ + +#include "PolyVoxCore/Impl/TypeDef.h" + +#include + +namespace PolyVox +{ + template + class DefaultIsQuadNeeded + { public: - bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) - { - if((back > 0) && (front == 0)) - { + bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) + { + if((back > 0) && (front == 0)) + { materialToUse = static_cast(back); - return true; - } - else - { - return false; - } - } - }; -} - + return true; + } + else + { + return false; + } + } + }; +} + #endif //__PolyVox_DefaultIsQuadNeeded_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index 5eb75e26..1cb18065 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -1,191 +1,191 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Density_H__ -#define __PolyVox_Density_H__ - -#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here - -#include "Impl/TypeDef.h" - -#include - -#undef min -#undef max - -namespace PolyVox -{ - /// This class represents a voxel storing only a density. - //////////////////////////////////////////////////////////////////////////////// - /// Detailed description... - //////////////////////////////////////////////////////////////////////////////// - template - class Density - { - public: - /// Constructor - Density() : m_uDensity(0) {} - - /// Copy constructor - Density(Type uDensity) : m_uDensity(uDensity) {} - - // The LowPassFilter uses this to convert between normal and accumulated types. - /// Copy constructor with cast - template explicit Density(const Density& density) - { - m_uDensity = static_cast(density.getDensity()); - } - - bool operator==(const Density& rhs) const - { - return (m_uDensity == rhs.m_uDensity); - }; - - bool operator!=(const Density& rhs) const - { - return !(*this == rhs); - } - - // For densities we can supply mathematical operators which behave in an intuitive way. - // In particular the ability to add and subtract densities is important in order to - // apply an averaging filter. The ability to divide by an integer is also needed for - // this same purpose. - Density& operator+=(const Density& rhs) - { - m_uDensity += rhs.m_uDensity; - return *this; - } - - Density& operator-=(const Density& rhs) - { - m_uDensity -= rhs.m_uDensity; - return *this; - } - - Density& operator/=(uint32_t rhs) - { - m_uDensity /= rhs; - return *this; - } - - /// \return The current density of the voxel - Type getDensity() const { return m_uDensity; } - /** - * Set the density of the voxel - * - * \param uDensity The density to set to - */ - void setDensity(Type uDensity) { m_uDensity = uDensity; } - - /// \return The maximum allowed density of the voxel - static Type getMaxDensity() { return (std::numeric_limits::max)(); } - /// \return The minimum allowed density of the voxel - static Type getMinDensity() { return (std::numeric_limits::min)(); } - - private: - Type m_uDensity; - }; - - template - Density operator+(const Density& lhs, const Density& rhs) - { - Density result = lhs; - result += rhs; - return result; - } - - template - Density operator-(const Density& lhs, const Density& rhs) - { - Density result = lhs; - result -= rhs; - return result; - } - - template - Density operator/(const Density& lhs, uint32_t rhs) - { - Density result = lhs; - result /= rhs; - return result; - } - - // These are the predefined density types. The 8-bit types are sufficient for many purposes (including - // most games) but 16-bit and float types do have uses particularly in medical/scientific visualisation. - typedef Density Density8; - typedef Density Density16; - typedef Density Density32; - typedef Density DensityFloat; - - /** - * This is a specialisation of DefaultMarchingCubesController for the Density voxel type - */ - template - class DefaultMarchingCubesController< Density > - { - public: - typedef Type DensityType; - typedef float MaterialType; - - DefaultMarchingCubesController(void) - { - // Default to a threshold value halfway between the min and max possible values. - m_tThreshold = (Density::getMinDensity() + Density::getMaxDensity()) / 2; - } - - DefaultMarchingCubesController(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - DensityType convertToDensity(Density voxel) - { - return voxel.getDensity(); - } - - MaterialType convertToMaterial(Density /*voxel*/) - { - return 1; - } - - MaterialType blendMaterials(Density /*a*/, Density /*b*/, float /*weight*/) - { - return 1; - } - - DensityType getThreshold(void) - { - return m_tThreshold; - } - - void setThreshold(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - private: - DensityType m_tThreshold; - }; -} - -#endif //__PolyVox_Density_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Density_H__ +#define __PolyVox_Density_H__ + +#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here + +#include "Impl/TypeDef.h" + +#include + +#undef min +#undef max + +namespace PolyVox +{ + /// This class represents a voxel storing only a density. + //////////////////////////////////////////////////////////////////////////////// + /// Detailed description... + //////////////////////////////////////////////////////////////////////////////// + template + class Density + { + public: + /// Constructor + Density() : m_uDensity(0) {} + + /// Copy constructor + Density(Type uDensity) : m_uDensity(uDensity) {} + + // The LowPassFilter uses this to convert between normal and accumulated types. + /// Copy constructor with cast + template explicit Density(const Density& density) + { + m_uDensity = static_cast(density.getDensity()); + } + + bool operator==(const Density& rhs) const + { + return (m_uDensity == rhs.m_uDensity); + }; + + bool operator!=(const Density& rhs) const + { + return !(*this == rhs); + } + + // For densities we can supply mathematical operators which behave in an intuitive way. + // In particular the ability to add and subtract densities is important in order to + // apply an averaging filter. The ability to divide by an integer is also needed for + // this same purpose. + Density& operator+=(const Density& rhs) + { + m_uDensity += rhs.m_uDensity; + return *this; + } + + Density& operator-=(const Density& rhs) + { + m_uDensity -= rhs.m_uDensity; + return *this; + } + + Density& operator/=(uint32_t rhs) + { + m_uDensity /= rhs; + return *this; + } + + /// \return The current density of the voxel + Type getDensity() const { return m_uDensity; } + /** + * Set the density of the voxel + * + * \param uDensity The density to set to + */ + void setDensity(Type uDensity) { m_uDensity = uDensity; } + + /// \return The maximum allowed density of the voxel + static Type getMaxDensity() { return (std::numeric_limits::max)(); } + /// \return The minimum allowed density of the voxel + static Type getMinDensity() { return (std::numeric_limits::min)(); } + + private: + Type m_uDensity; + }; + + template + Density operator+(const Density& lhs, const Density& rhs) + { + Density result = lhs; + result += rhs; + return result; + } + + template + Density operator-(const Density& lhs, const Density& rhs) + { + Density result = lhs; + result -= rhs; + return result; + } + + template + Density operator/(const Density& lhs, uint32_t rhs) + { + Density result = lhs; + result /= rhs; + return result; + } + + // These are the predefined density types. The 8-bit types are sufficient for many purposes (including + // most games) but 16-bit and float types do have uses particularly in medical/scientific visualisation. + typedef Density Density8; + typedef Density Density16; + typedef Density Density32; + typedef Density DensityFloat; + + /** + * This is a specialisation of DefaultMarchingCubesController for the Density voxel type + */ + template + class DefaultMarchingCubesController< Density > + { + public: + typedef Type DensityType; + typedef float MaterialType; + + DefaultMarchingCubesController(void) + { + // Default to a threshold value halfway between the min and max possible values. + m_tThreshold = (Density::getMinDensity() + Density::getMaxDensity()) / 2; + } + + DefaultMarchingCubesController(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + DensityType convertToDensity(Density voxel) + { + return voxel.getDensity(); + } + + MaterialType convertToMaterial(Density /*voxel*/) + { + return 1; + } + + MaterialType blendMaterials(Density /*a*/, Density /*b*/, float /*weight*/) + { + return 1; + } + + DensityType getThreshold(void) + { + return m_tThreshold; + } + + void setThreshold(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + private: + DensityType m_tThreshold; + }; +} + +#endif //__PolyVox_Density_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h index 871dbcb2..02b1eb0c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h +++ b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h @@ -1,64 +1,64 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_GradientEstimators_H__ -#define __PolyVox_GradientEstimators_H__ - -#include "PolyVoxCore/Vector.h" -#include "PolyVoxCore/VoxelFilters.h" - -#include - -namespace PolyVox -{ - enum NormalGenerationMethod - { - SIMPLE, /// - Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter); - - template - Vector3DFloat computeSmoothCentralDifferenceGradient(typename VolumeType::Sampler& volIter); - - template - Vector3DFloat computeDecimatedCentralDifferenceGradient(typename VolumeType::Sampler& volIter); - - template - Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter); - - template - Vector3DFloat computeSmoothSobelGradient(typename VolumeType::Sampler& volIter); - - //POLYVOX_API void computeNormalsForVertices(VolumeType* volumeData, Mesh& mesh, NormalGenerationMethod normalGenerationMethod); - //POLYVOX_API Vector3DFloat computeNormal(VolumeType* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); -} - -#include "PolyVoxCore/GradientEstimators.inl" - -#endif //__PolyVox_GradientEstimators_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_GradientEstimators_H__ +#define __PolyVox_GradientEstimators_H__ + +#include "PolyVoxCore/Vector.h" +#include "PolyVoxCore/VoxelFilters.h" + +#include + +namespace PolyVox +{ + enum NormalGenerationMethod + { + SIMPLE, /// + Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter); + + template + Vector3DFloat computeSmoothCentralDifferenceGradient(typename VolumeType::Sampler& volIter); + + template + Vector3DFloat computeDecimatedCentralDifferenceGradient(typename VolumeType::Sampler& volIter); + + template + Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter); + + template + Vector3DFloat computeSmoothSobelGradient(typename VolumeType::Sampler& volIter); + + //POLYVOX_API void computeNormalsForVertices(VolumeType* volumeData, Mesh& mesh, NormalGenerationMethod normalGenerationMethod); + //POLYVOX_API Vector3DFloat computeNormal(VolumeType* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); +} + +#include "PolyVoxCore/GradientEstimators.inl" + +#endif //__PolyVox_GradientEstimators_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl index 5add45bd..4a577dee 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl @@ -1,302 +1,302 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - template - Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) - { - //FIXME - bitwise way of doing this? - typename VolumeType::VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1px = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; - - typename VolumeType::VoxelType voxel1ny = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1py = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; - - typename VolumeType::VoxelType voxel1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; - - return Vector3DFloat - ( - static_cast(voxel1nx) - static_cast(voxel1px), - static_cast(voxel1ny) - static_cast(voxel1py), - static_cast(voxel1nz) - static_cast(voxel1pz) - ); - } - - template - Vector3DFloat computeDecimatedCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) - { - const int32_t x = volIter.getPosition().getX(); - const int32_t y = volIter.getPosition().getY(); - const int32_t z = volIter.getPosition().getZ(); - - //FIXME - bitwise way of doing this? - typename VolumeType::VoxelType voxel1nx = volIter.getVoxel(x-2, y ,z ) > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1px = volIter.getVoxel(x-2, y ,z ) > 0 ? 1: 0; - - typename VolumeType::VoxelType voxel1ny = volIter.getVoxel(x , y-2,z ) > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1py = volIter.getVoxel(x , y-2,z ) > 0 ? 1: 0; - - typename VolumeType::VoxelType voxel1nz = volIter.getVoxel(x , y ,z-2) > 0 ? 1: 0; - typename VolumeType::VoxelType voxel1pz = volIter.getVoxel(x , y ,z-2) > 0 ? 1: 0; - - return Vector3DFloat - ( - static_cast(voxel1nx) - static_cast(voxel1px), - static_cast(voxel1ny) - static_cast(voxel1py), - static_cast(voxel1nz) - static_cast(voxel1pz) - ); - } - - template - Vector3DFloat computeSmoothCentralDifferenceGradient(typename VolumeType::Sampler& volIter) - { - int32_t initialX = volIter.getPosition().getX(); - int32_t initialY = volIter.getPosition().getY(); - int32_t initialZ = volIter.getPosition().getZ(); - - //FIXME - bitwise way of doing this? - volIter.setPosition(initialX-1, initialY, initialZ); - float voxel1nx = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY, initialZ); - float voxel1px = computeSmoothedVoxel(volIter); - - volIter.setPosition(initialX, initialY-1, initialZ); - float voxel1ny = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX, initialY+1, initialZ); - float voxel1py = computeSmoothedVoxel(volIter); - - volIter.setPosition(initialX, initialY, initialZ-1); - float voxel1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX, initialY, initialZ+1); - float voxel1pz = computeSmoothedVoxel(volIter); - - return Vector3DFloat - ( - voxel1nx - voxel1px, - voxel1ny - voxel1py, - voxel1nz - voxel1pz - ); - } - - template - Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter) - { - static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { - {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; - - const typename VolumeType::VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; - - const typename VolumeType::VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; - //const VolumeType::VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; - - const typename VolumeType::VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; - const typename VolumeType::VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0; - - const int xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - - weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * - pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - - weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * - pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + - weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + - weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * - pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const int yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + - weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - - weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * - pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + - weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - - weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const int zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + - weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * - pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - - weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + - weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * - pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - - weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + - weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * - pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - - weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * - pVoxel1px1py1pz); - - //Note: The above actually give gradients going from low density to high density. - //For our normals we want the the other way around, so we switch the components as we return them. - return Vector3DFloat(static_cast(-xGrad),static_cast(-yGrad),static_cast(-zGrad)); - } - - template - Vector3DFloat computeSmoothSobelGradient(typename VolumeType::Sampler& volIter) - { - static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { - {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; - - int32_t initialX = volIter.getPosition().getX(); - int32_t initialY = volIter.getPosition().getY(); - int32_t initialZ = volIter.getPosition().getZ(); - - volIter.setPosition(initialX-1, initialY-1, initialZ-1); const float pVoxel1nx1ny1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY-1, initialZ ); const float pVoxel1nx1ny0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY-1, initialZ+1); const float pVoxel1nx1ny1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY , initialZ-1); const float pVoxel1nx0py1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY , initialZ ); const float pVoxel1nx0py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY , initialZ+1); const float pVoxel1nx0py1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY+1, initialZ-1); const float pVoxel1nx1py1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY+1, initialZ ); const float pVoxel1nx1py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX-1, initialY+1, initialZ+1); const float pVoxel1nx1py1pz = computeSmoothedVoxel(volIter); - - volIter.setPosition(initialX , initialY-1, initialZ-1); const float pVoxel0px1ny1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY-1, initialZ ); const float pVoxel0px1ny0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY-1, initialZ+1); const float pVoxel0px1ny1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY , initialZ-1); const float pVoxel0px0py1nz = computeSmoothedVoxel(volIter); - //volIter.setPosition(initialX , initialY , initialZ ); const float pVoxel0px0py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY , initialZ+1); const float pVoxel0px0py1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY+1, initialZ-1); const float pVoxel0px1py1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY+1, initialZ ); const float pVoxel0px1py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX , initialY+1, initialZ+1); const float pVoxel0px1py1pz = computeSmoothedVoxel(volIter); - - volIter.setPosition(initialX+1, initialY-1, initialZ-1); const float pVoxel1px1ny1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY-1, initialZ ); const float pVoxel1px1ny0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY-1, initialZ+1); const float pVoxel1px1ny1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY , initialZ-1); const float pVoxel1px0py1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY , initialZ ); const float pVoxel1px0py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY , initialZ+1); const float pVoxel1px0py1pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY+1, initialZ-1); const float pVoxel1px1py1nz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY+1, initialZ ); const float pVoxel1px1py0pz = computeSmoothedVoxel(volIter); - volIter.setPosition(initialX+1, initialY+1, initialZ+1); const float pVoxel1px1py1pz = computeSmoothedVoxel(volIter); - - /*const VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; - const VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; - const VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; - const VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; - const VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; - const VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; - const VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; - const VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; - const VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; - - const VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; - const VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; - const VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; - const VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; - //const VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; - const VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; - const VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; - const VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; - const VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; - - const VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; - const VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; - const VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; - const VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; - const VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; - const VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; - const VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; - const VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; - const VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0;*/ - - const float xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - - weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * - pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - - weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * - pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + - weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + - weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * - pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const float yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - - weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * - pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + - weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - - weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * - pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + - weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - - weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * - pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + - weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * - pVoxel1px1py1pz); - - const float zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + - weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * - pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - - weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * - pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + - weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * - pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - - weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * - pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + - weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * - pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - - weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * - pVoxel1px1py1pz); - - //Note: The above actually give gradients going from low density to high density. - //For our normals we want the the other way around, so we switch the components as we return them. - return Vector3DFloat(-xGrad,-yGrad,-zGrad); - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + template + Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) + { + //FIXME - bitwise way of doing this? + typename VolumeType::VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1px = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; + + typename VolumeType::VoxelType voxel1ny = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1py = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; + + typename VolumeType::VoxelType voxel1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; + + return Vector3DFloat + ( + static_cast(voxel1nx) - static_cast(voxel1px), + static_cast(voxel1ny) - static_cast(voxel1py), + static_cast(voxel1nz) - static_cast(voxel1pz) + ); + } + + template + Vector3DFloat computeDecimatedCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) + { + const int32_t x = volIter.getPosition().getX(); + const int32_t y = volIter.getPosition().getY(); + const int32_t z = volIter.getPosition().getZ(); + + //FIXME - bitwise way of doing this? + typename VolumeType::VoxelType voxel1nx = volIter.getVoxel(x-2, y ,z ) > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1px = volIter.getVoxel(x-2, y ,z ) > 0 ? 1: 0; + + typename VolumeType::VoxelType voxel1ny = volIter.getVoxel(x , y-2,z ) > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1py = volIter.getVoxel(x , y-2,z ) > 0 ? 1: 0; + + typename VolumeType::VoxelType voxel1nz = volIter.getVoxel(x , y ,z-2) > 0 ? 1: 0; + typename VolumeType::VoxelType voxel1pz = volIter.getVoxel(x , y ,z-2) > 0 ? 1: 0; + + return Vector3DFloat + ( + static_cast(voxel1nx) - static_cast(voxel1px), + static_cast(voxel1ny) - static_cast(voxel1py), + static_cast(voxel1nz) - static_cast(voxel1pz) + ); + } + + template + Vector3DFloat computeSmoothCentralDifferenceGradient(typename VolumeType::Sampler& volIter) + { + int32_t initialX = volIter.getPosition().getX(); + int32_t initialY = volIter.getPosition().getY(); + int32_t initialZ = volIter.getPosition().getZ(); + + //FIXME - bitwise way of doing this? + volIter.setPosition(initialX-1, initialY, initialZ); + float voxel1nx = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY, initialZ); + float voxel1px = computeSmoothedVoxel(volIter); + + volIter.setPosition(initialX, initialY-1, initialZ); + float voxel1ny = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX, initialY+1, initialZ); + float voxel1py = computeSmoothedVoxel(volIter); + + volIter.setPosition(initialX, initialY, initialZ-1); + float voxel1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX, initialY, initialZ+1); + float voxel1pz = computeSmoothedVoxel(volIter); + + return Vector3DFloat + ( + voxel1nx - voxel1px, + voxel1ny - voxel1py, + voxel1nz - voxel1pz + ); + } + + template + Vector3DFloat computeSobelGradient(const typename VolumeType::Sampler& volIter) + { + static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { + {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; + + const typename VolumeType::VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; + + const typename VolumeType::VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; + //const VolumeType::VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; + + const typename VolumeType::VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; + const typename VolumeType::VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0; + + const int xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - + weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * + pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - + weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * + pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + + weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + + weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * + pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const int yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + + weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - + weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * + pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + + weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - + weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const int zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + + weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * + pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - + weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + + weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * + pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - + weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + + weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * + pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - + weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * + pVoxel1px1py1pz); + + //Note: The above actually give gradients going from low density to high density. + //For our normals we want the the other way around, so we switch the components as we return them. + return Vector3DFloat(static_cast(-xGrad),static_cast(-yGrad),static_cast(-zGrad)); + } + + template + Vector3DFloat computeSmoothSobelGradient(typename VolumeType::Sampler& volIter) + { + static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { + {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; + + int32_t initialX = volIter.getPosition().getX(); + int32_t initialY = volIter.getPosition().getY(); + int32_t initialZ = volIter.getPosition().getZ(); + + volIter.setPosition(initialX-1, initialY-1, initialZ-1); const float pVoxel1nx1ny1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY-1, initialZ ); const float pVoxel1nx1ny0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY-1, initialZ+1); const float pVoxel1nx1ny1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY , initialZ-1); const float pVoxel1nx0py1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY , initialZ ); const float pVoxel1nx0py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY , initialZ+1); const float pVoxel1nx0py1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY+1, initialZ-1); const float pVoxel1nx1py1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY+1, initialZ ); const float pVoxel1nx1py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX-1, initialY+1, initialZ+1); const float pVoxel1nx1py1pz = computeSmoothedVoxel(volIter); + + volIter.setPosition(initialX , initialY-1, initialZ-1); const float pVoxel0px1ny1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY-1, initialZ ); const float pVoxel0px1ny0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY-1, initialZ+1); const float pVoxel0px1ny1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY , initialZ-1); const float pVoxel0px0py1nz = computeSmoothedVoxel(volIter); + //volIter.setPosition(initialX , initialY , initialZ ); const float pVoxel0px0py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY , initialZ+1); const float pVoxel0px0py1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY+1, initialZ-1); const float pVoxel0px1py1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY+1, initialZ ); const float pVoxel0px1py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX , initialY+1, initialZ+1); const float pVoxel0px1py1pz = computeSmoothedVoxel(volIter); + + volIter.setPosition(initialX+1, initialY-1, initialZ-1); const float pVoxel1px1ny1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY-1, initialZ ); const float pVoxel1px1ny0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY-1, initialZ+1); const float pVoxel1px1ny1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY , initialZ-1); const float pVoxel1px0py1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY , initialZ ); const float pVoxel1px0py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY , initialZ+1); const float pVoxel1px0py1pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY+1, initialZ-1); const float pVoxel1px1py1nz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY+1, initialZ ); const float pVoxel1px1py0pz = computeSmoothedVoxel(volIter); + volIter.setPosition(initialX+1, initialY+1, initialZ+1); const float pVoxel1px1py1pz = computeSmoothedVoxel(volIter); + + /*const VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; + const VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; + const VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; + const VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; + const VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; + const VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; + const VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; + const VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; + const VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; + + const VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; + const VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; + const VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; + const VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; + //const VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; + const VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; + const VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; + const VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; + const VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; + + const VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; + const VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; + const VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; + const VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; + const VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; + const VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; + const VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; + const VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; + const VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0;*/ + + const float xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz - weights[0][1][0] * pVoxel1nx0py1nz - + weights[1][1][0] * pVoxel1nx0py0pz - weights[2][1][0] * + pVoxel1nx0py1pz - weights[0][2][0] * pVoxel1nx1py1nz - + weights[1][2][0] * pVoxel1nx1py0pz - weights[2][2][0] * + pVoxel1nx1py1pz + weights[0][0][2] * pVoxel1px1ny1nz + + weights[1][0][2] * pVoxel1px1ny0pz + weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][1][2] * pVoxel1px0py1nz + + weights[1][1][2] * pVoxel1px0py0pz + weights[2][1][2] * + pVoxel1px0py1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const float yGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - + weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * + pVoxel1nx1ny1pz + weights[0][2][0] * pVoxel1nx1py1nz + + weights[1][2][0] * pVoxel1nx1py0pz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz - + weights[1][0][1] * pVoxel0px1ny0pz - weights[2][0][1] * + pVoxel0px1ny1pz + weights[0][2][1] * pVoxel0px1py1nz + + weights[1][2][1] * pVoxel0px1py0pz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz - + weights[1][0][2] * pVoxel1px1ny0pz - weights[2][0][2] * + pVoxel1px1ny1pz + weights[0][2][2] * pVoxel1px1py1nz + + weights[1][2][2] * pVoxel1px1py0pz + weights[2][2][2] * + pVoxel1px1py1pz); + + const float zGrad(- weights[0][0][0] * pVoxel1nx1ny1nz + + weights[2][0][0] * pVoxel1nx1ny1pz - weights[0][1][0] * + pVoxel1nx0py1nz + weights[2][1][0] * pVoxel1nx0py1pz - + weights[0][2][0] * pVoxel1nx1py1nz + weights[2][2][0] * + pVoxel1nx1py1pz - weights[0][0][1] * pVoxel0px1ny1nz + + weights[2][0][1] * pVoxel0px1ny1pz - weights[0][1][1] * + pVoxel0px0py1nz + weights[2][1][1] * pVoxel0px0py1pz - + weights[0][2][1] * pVoxel0px1py1nz + weights[2][2][1] * + pVoxel0px1py1pz - weights[0][0][2] * pVoxel1px1ny1nz + + weights[2][0][2] * pVoxel1px1ny1pz - weights[0][1][2] * + pVoxel1px0py1nz + weights[2][1][2] * pVoxel1px0py1pz - + weights[0][2][2] * pVoxel1px1py1nz + weights[2][2][2] * + pVoxel1px1py1pz); + + //Note: The above actually give gradients going from low density to high density. + //For our normals we want the the other way around, so we switch the components as we return them. + return Vector3DFloat(-xGrad,-yGrad,-zGrad); + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index 0ae8353e..ff9a6e7b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -1,59 +1,59 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Utility_H__ -#define __PolyVox_Utility_H__ - -#include "PolyVoxCore/Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - POLYVOX_API uint8_t logBase2(uint32_t uInput); - POLYVOX_API bool isPowerOf2(uint32_t uInput); - - int32_t roundTowardsNegInf(float r); - int32_t roundToInteger(float r); - template - Type clamp(const Type& value, const Type& low, const Type& high); - uint32_t upperPowerOfTwo(uint32_t v); - - inline int32_t roundTowardsNegInf(float r) - { - return (r >= 0.0) ? static_cast(r) : static_cast(r - 1.0f); - } - - inline int32_t roundToNearestInteger(float r) - { - return (r >= 0.0) ? static_cast(r + 0.5f) : static_cast(r - 0.5f); - } - - template - inline Type clamp(const Type& value, const Type& low, const Type& high) - { - return (std::min)(high, (std::max)(low, value)); - } -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Utility_H__ +#define __PolyVox_Utility_H__ + +#include "PolyVoxCore/Impl/TypeDef.h" + +#include + +namespace PolyVox +{ + POLYVOX_API uint8_t logBase2(uint32_t uInput); + POLYVOX_API bool isPowerOf2(uint32_t uInput); + + int32_t roundTowardsNegInf(float r); + int32_t roundToInteger(float r); + template + Type clamp(const Type& value, const Type& low, const Type& high); + uint32_t upperPowerOfTwo(uint32_t v); + + inline int32_t roundTowardsNegInf(float r) + { + return (r >= 0.0) ? static_cast(r) : static_cast(r - 1.0f); + } + + inline int32_t roundToNearestInteger(float r) + { + return (r >= 0.0) ? static_cast(r + 0.5f) : static_cast(r - 0.5f); + } + + template + inline Type clamp(const Type& value, const Type& low, const Type& high) + { + return (std::min)(high, (std::max)(low, value)); + } +} + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.h b/library/PolyVoxCore/include/PolyVoxCore/IteratorController.h index 935cc845..b819fd6e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/IteratorController.h @@ -1,46 +1,46 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_IteratorController_H__ -#define __PolyVox_IteratorController_H__ - -#include "PolyVoxCore/Region.h" - -namespace PolyVox -{ - template - class IteratorController - { - public: - void reset(void); - bool moveForward(void); - - public: - Region m_regValid; - IteratorType* m_Iter; - }; -} - -#include "PolyVoxCore/IteratorController.inl" - -#endif //__PolyVox_IteratorController_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_IteratorController_H__ +#define __PolyVox_IteratorController_H__ + +#include "PolyVoxCore/Region.h" + +namespace PolyVox +{ + template + class IteratorController + { + public: + void reset(void); + bool moveForward(void); + + public: + Region m_regValid; + IteratorType* m_Iter; + }; +} + +#include "PolyVoxCore/IteratorController.inl" + +#endif //__PolyVox_IteratorController_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl b/library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl index 58246823..c6f6bbef 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl @@ -1,63 +1,63 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - template - void IteratorController::reset(void) - { - m_Iter->setPosition(m_regValid.getLowerCorner()); - } - - template - bool IteratorController::moveForward(void) - { - Vector3DInt32 v3dInitialPosition(m_Iter->getPosition().getX(), m_Iter->getPosition().getY(), m_Iter->getPosition().getZ()); - - if(v3dInitialPosition.getX() < m_regValid.getUpperX()) - { - m_Iter->movePositiveX(); - return true; - } - - v3dInitialPosition.setX(m_regValid.getLowerX()); - - if(v3dInitialPosition.getY() < m_regValid.getUpperY()) - { - v3dInitialPosition.setY(v3dInitialPosition.getY() + 1); - m_Iter->setPosition(v3dInitialPosition); - return true; - } - - v3dInitialPosition.setY(m_regValid.getLowerY()); - - if(v3dInitialPosition.getZ() < m_regValid.getUpperZ()) - { - v3dInitialPosition.setZ(v3dInitialPosition.getZ() + 1); - m_Iter->setPosition(v3dInitialPosition); - return true; - } - - return false; - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + template + void IteratorController::reset(void) + { + m_Iter->setPosition(m_regValid.getLowerCorner()); + } + + template + bool IteratorController::moveForward(void) + { + Vector3DInt32 v3dInitialPosition(m_Iter->getPosition().getX(), m_Iter->getPosition().getY(), m_Iter->getPosition().getZ()); + + if(v3dInitialPosition.getX() < m_regValid.getUpperX()) + { + m_Iter->movePositiveX(); + return true; + } + + v3dInitialPosition.setX(m_regValid.getLowerX()); + + if(v3dInitialPosition.getY() < m_regValid.getUpperY()) + { + v3dInitialPosition.setY(v3dInitialPosition.getY() + 1); + m_Iter->setPosition(v3dInitialPosition); + return true; + } + + v3dInitialPosition.setY(m_regValid.getLowerY()); + + if(v3dInitialPosition.getZ() < m_regValid.getUpperZ()) + { + v3dInitialPosition.setZ(v3dInitialPosition.getZ() + 1); + m_Iter->setPosition(v3dInitialPosition); + return true; + } + + return false; + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index a018e67c..5dacf48a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -1,9 +1,9 @@ -#ifndef __PolyVox_LargeVolume_H__ -#define __PolyVox_LargeVolume_H__ - -#pragma message("WARNING - The LargeVolume class has been replaced by PagedVolume. Please use that instead.") - -#include "PagedVolume.h" -#include "PolyVoxForwardDeclarations.h" - +#ifndef __PolyVox_LargeVolume_H__ +#define __PolyVox_LargeVolume_H__ + +#pragma message("WARNING - The LargeVolume class has been replaced by PagedVolume. Please use that instead.") + +#include "PagedVolume.h" +#include "PolyVoxForwardDeclarations.h" + #endif //__PolyVox_LargeVolume_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h index 732e2506..5ec1ea71 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h @@ -1,60 +1,60 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_LowPassFilter_H__ -#define __PolyVox_LowPassFilter_H__ - -#include "PolyVoxCore/IteratorController.h" -#include "PolyVoxCore/RawVolume.h" //Is this desirable? -#include "PolyVoxCore/Region.h" - -namespace PolyVox -{ - template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> - class LowPassFilter - { - public: - LowPassFilter(SrcVolumeType* pVolSrc, Region regSrc, DstVolumeType* pVolDst, Region regDst, uint32_t uKernelSize); - - void execute(); - void executeSAT(); - - private: - //Source data - SrcVolumeType* m_pVolSrc; - Region m_regSrc; - - //Destination data - DstVolumeType* m_pVolDst; - Region m_regDst; - - //Kernel size - uint32_t m_uKernelSize; - }; - -}//namespace PolyVox - -#include "PolyVoxCore/LowPassFilter.inl" - -#endif //__PolyVox_LowPassFilter_H__ - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_LowPassFilter_H__ +#define __PolyVox_LowPassFilter_H__ + +#include "PolyVoxCore/IteratorController.h" +#include "PolyVoxCore/RawVolume.h" //Is this desirable? +#include "PolyVoxCore/Region.h" + +namespace PolyVox +{ + template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> + class LowPassFilter + { + public: + LowPassFilter(SrcVolumeType* pVolSrc, Region regSrc, DstVolumeType* pVolDst, Region regDst, uint32_t uKernelSize); + + void execute(); + void executeSAT(); + + private: + //Source data + SrcVolumeType* m_pVolSrc; + Region m_regSrc; + + //Destination data + DstVolumeType* m_pVolDst; + Region m_regDst; + + //Kernel size + uint32_t m_uKernelSize; + }; + +}//namespace PolyVox + +#include "PolyVoxCore/LowPassFilter.inl" + +#endif //__PolyVox_LowPassFilter_H__ + diff --git a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl index 22e476a9..d4211f44 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl @@ -1,255 +1,255 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - /** - * \param pVolSrc - * \param regSrc - * \param[out] pVolDst - * \param regDst - * \param uKernelSize - */ - template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> - LowPassFilter::LowPassFilter(SrcVolumeType* pVolSrc, Region regSrc, DstVolumeType* pVolDst, Region regDst, uint32_t uKernelSize) - :m_pVolSrc(pVolSrc) - ,m_regSrc(regSrc) - ,m_pVolDst(pVolDst) - ,m_regDst(regDst) - ,m_uKernelSize(uKernelSize) - { - //Kernel size must be at least three - if(m_uKernelSize < 3) - { - POLYVOX_THROW(std::invalid_argument, "Kernel size must be at least three"); - } - - //Kernel size must be odd - if(m_uKernelSize % 2 == 0) - { - POLYVOX_THROW(std::invalid_argument, "Kernel size must be odd"); - } - } - - template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> - void LowPassFilter::execute() - { - int32_t iSrcMinX = m_regSrc.getLowerX(); - int32_t iSrcMinY = m_regSrc.getLowerY(); - int32_t iSrcMinZ = m_regSrc.getLowerZ(); - - int32_t iSrcMaxX = m_regSrc.getUpperX(); - int32_t iSrcMaxY = m_regSrc.getUpperY(); - int32_t iSrcMaxZ = m_regSrc.getUpperZ(); - - int32_t iDstMinX = m_regDst.getLowerX(); - int32_t iDstMinY = m_regDst.getLowerY(); - int32_t iDstMinZ = m_regDst.getLowerZ(); - - //int32_t iDstMaxX = m_regDst.getUpperX(); - //int32_t iDstMaxY = m_regDst.getUpperY(); - //int32_t iDstMaxZ = m_regDst.getUpperZ(); - - typename SrcVolumeType::Sampler srcSampler(m_pVolSrc); - - for(int32_t iSrcZ = iSrcMinZ, iDstZ = iDstMinZ; iSrcZ <= iSrcMaxZ; iSrcZ++, iDstZ++) - { - for(int32_t iSrcY = iSrcMinY, iDstY = iDstMinY; iSrcY <= iSrcMaxY; iSrcY++, iDstY++) - { - for(int32_t iSrcX = iSrcMinX, iDstX = iDstMinX; iSrcX <= iSrcMaxX; iSrcX++, iDstX++) - { - AccumulationType tSrcVoxel(0); - srcSampler.setPosition(iSrcX, iSrcY, iSrcZ); - - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py1pz()); - - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py1pz()); - - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py1pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py1nz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py0pz()); - tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py1pz()); - - tSrcVoxel /= 27; - - //tSrcVoxel.setDensity(uDensity); - m_pVolDst->setVoxelAt(iSrcX, iSrcY, iSrcZ, static_cast(tSrcVoxel)); - } - } - } - } - - template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> - void LowPassFilter::executeSAT() - { - const uint32_t border = (m_uKernelSize - 1) / 2; - - Vector3DInt32 satLowerCorner = m_regSrc.getLowerCorner() - Vector3DInt32(border, border, border); - Vector3DInt32 satUpperCorner = m_regSrc.getUpperCorner() + Vector3DInt32(border, border, border); - - //Use floats for the SAT volume to ensure it works with negative - //densities and with both integral and floating point input volumes. - RawVolume satVolume(Region(satLowerCorner, satUpperCorner)); - - //Clear to zeros (necessary?) - //FIXME - use Volume::fill() method. Implemented in base class as below - //but with optimised implementations in subclasses? - for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) - { - for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) - { - for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) - { - satVolume.setVoxelAt(x,y,z,0); - } - } - } - - typename RawVolume::Sampler satVolumeIter(&satVolume); - - IteratorController::Sampler> satIterCont; - satIterCont.m_regValid = Region(satLowerCorner, satUpperCorner); - satIterCont.m_Iter = &satVolumeIter; - satIterCont.reset(); - - typename SrcVolumeType::Sampler srcVolumeIter(m_pVolSrc); - - IteratorController srcIterCont; - srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner); - srcIterCont.m_Iter = &srcVolumeIter; - srcIterCont.reset(); - - do - { - AccumulationType previousSum = static_cast(satVolumeIter.peekVoxel1nx0py0pz()); - AccumulationType currentVal = static_cast(srcVolumeIter.getVoxel()); - - satVolumeIter.setVoxel(previousSum + currentVal); - - srcIterCont.moveForward(); - - }while(satIterCont.moveForward()); - - //Build SAT in three passes - /*for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) - { - for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) - { - for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) - { - AccumulationType previousSum = static_cast(satVolume.getVoxelAt(x-1,y,z)); - AccumulationType currentVal = static_cast(m_pVolSrc->getVoxelAt(x,y,z)); - - satVolume.setVoxelAt(x,y,z,previousSum + currentVal); - } - } - }*/ - - for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) - { - for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) - { - for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) - { - AccumulationType previousSum = static_cast(satVolume.getVoxel(x,y-1,z, WrapModes::Border)); - AccumulationType currentSum = static_cast(satVolume.getVoxel(x,y,z, WrapModes::Border)); - - satVolume.setVoxelAt(x,y,z,previousSum + currentSum); - } - } - } - - for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) - { - for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) - { - for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) - { - AccumulationType previousSum = static_cast(satVolume.getVoxel(x,y,z-1, WrapModes::Border)); - AccumulationType currentSum = static_cast(satVolume.getVoxel(x,y,z, WrapModes::Border)); - - satVolume.setVoxelAt(x,y,z,previousSum + currentSum); - } - } - } - - //Now compute the average - const Vector3DInt32& v3dDstLowerCorner = m_regDst.getLowerCorner(); - const Vector3DInt32& v3dDstUpperCorner = m_regDst.getUpperCorner(); - - const Vector3DInt32& v3dSrcLowerCorner = m_regSrc.getLowerCorner(); - - for(int32_t iDstZ = v3dDstLowerCorner.getZ(), iSrcZ = v3dSrcLowerCorner.getZ(); iDstZ <= v3dDstUpperCorner.getZ(); iDstZ++, iSrcZ++) - { - for(int32_t iDstY = v3dDstLowerCorner.getY(), iSrcY = v3dSrcLowerCorner.getY(); iDstY <= v3dDstUpperCorner.getY(); iDstY++, iSrcY++) - { - for(int32_t iDstX = v3dDstLowerCorner.getX(), iSrcX = v3dSrcLowerCorner.getX(); iDstX <= v3dDstUpperCorner.getX(); iDstX++, iSrcX++) - { - int32_t satLowerX = iSrcX - border - 1; - int32_t satLowerY = iSrcY - border - 1; - int32_t satLowerZ = iSrcZ - border - 1; - - int32_t satUpperX = iSrcX + border; - int32_t satUpperY = iSrcY + border; - int32_t satUpperZ = iSrcZ + border; - - AccumulationType a = satVolume.getVoxel(satLowerX,satLowerY,satLowerZ, WrapModes::Border); - AccumulationType b = satVolume.getVoxel(satUpperX,satLowerY,satLowerZ, WrapModes::Border); - AccumulationType c = satVolume.getVoxel(satLowerX,satUpperY,satLowerZ, WrapModes::Border); - AccumulationType d = satVolume.getVoxel(satUpperX,satUpperY,satLowerZ, WrapModes::Border); - AccumulationType e = satVolume.getVoxel(satLowerX,satLowerY,satUpperZ, WrapModes::Border); - AccumulationType f = satVolume.getVoxel(satUpperX,satLowerY,satUpperZ, WrapModes::Border); - AccumulationType g = satVolume.getVoxel(satLowerX,satUpperY,satUpperZ, WrapModes::Border); - AccumulationType h = satVolume.getVoxel(satUpperX,satUpperY,satUpperZ, WrapModes::Border); - - AccumulationType sum = h+c-d-g-f-a+b+e; - uint32_t sideLength = border * 2 + 1; - AccumulationType average = sum / (sideLength*sideLength*sideLength); - - m_pVolDst->setVoxelAt(iDstX, iDstY, iDstZ, static_cast(average)); - } - } - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + /** + * \param pVolSrc + * \param regSrc + * \param[out] pVolDst + * \param regDst + * \param uKernelSize + */ + template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> + LowPassFilter::LowPassFilter(SrcVolumeType* pVolSrc, Region regSrc, DstVolumeType* pVolDst, Region regDst, uint32_t uKernelSize) + :m_pVolSrc(pVolSrc) + ,m_regSrc(regSrc) + ,m_pVolDst(pVolDst) + ,m_regDst(regDst) + ,m_uKernelSize(uKernelSize) + { + //Kernel size must be at least three + if(m_uKernelSize < 3) + { + POLYVOX_THROW(std::invalid_argument, "Kernel size must be at least three"); + } + + //Kernel size must be odd + if(m_uKernelSize % 2 == 0) + { + POLYVOX_THROW(std::invalid_argument, "Kernel size must be odd"); + } + } + + template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> + void LowPassFilter::execute() + { + int32_t iSrcMinX = m_regSrc.getLowerX(); + int32_t iSrcMinY = m_regSrc.getLowerY(); + int32_t iSrcMinZ = m_regSrc.getLowerZ(); + + int32_t iSrcMaxX = m_regSrc.getUpperX(); + int32_t iSrcMaxY = m_regSrc.getUpperY(); + int32_t iSrcMaxZ = m_regSrc.getUpperZ(); + + int32_t iDstMinX = m_regDst.getLowerX(); + int32_t iDstMinY = m_regDst.getLowerY(); + int32_t iDstMinZ = m_regDst.getLowerZ(); + + //int32_t iDstMaxX = m_regDst.getUpperX(); + //int32_t iDstMaxY = m_regDst.getUpperY(); + //int32_t iDstMaxZ = m_regDst.getUpperZ(); + + typename SrcVolumeType::Sampler srcSampler(m_pVolSrc); + + for(int32_t iSrcZ = iSrcMinZ, iDstZ = iDstMinZ; iSrcZ <= iSrcMaxZ; iSrcZ++, iDstZ++) + { + for(int32_t iSrcY = iSrcMinY, iDstY = iDstMinY; iSrcY <= iSrcMaxY; iSrcY++, iDstY++) + { + for(int32_t iSrcX = iSrcMinX, iDstX = iDstMinX; iSrcX <= iSrcMaxX; iSrcX++, iDstX++) + { + AccumulationType tSrcVoxel(0); + srcSampler.setPosition(iSrcX, iSrcY, iSrcZ); + + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1ny1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx0py1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1nx1py1pz()); + + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1ny1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px0py1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel0px1py1pz()); + + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1ny1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px0py1pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py1nz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py0pz()); + tSrcVoxel += static_cast(srcSampler.peekVoxel1px1py1pz()); + + tSrcVoxel /= 27; + + //tSrcVoxel.setDensity(uDensity); + m_pVolDst->setVoxelAt(iSrcX, iSrcY, iSrcZ, static_cast(tSrcVoxel)); + } + } + } + } + + template< typename SrcVolumeType, typename DstVolumeType, typename AccumulationType> + void LowPassFilter::executeSAT() + { + const uint32_t border = (m_uKernelSize - 1) / 2; + + Vector3DInt32 satLowerCorner = m_regSrc.getLowerCorner() - Vector3DInt32(border, border, border); + Vector3DInt32 satUpperCorner = m_regSrc.getUpperCorner() + Vector3DInt32(border, border, border); + + //Use floats for the SAT volume to ensure it works with negative + //densities and with both integral and floating point input volumes. + RawVolume satVolume(Region(satLowerCorner, satUpperCorner)); + + //Clear to zeros (necessary?) + //FIXME - use Volume::fill() method. Implemented in base class as below + //but with optimised implementations in subclasses? + for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) + { + for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) + { + for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) + { + satVolume.setVoxelAt(x,y,z,0); + } + } + } + + typename RawVolume::Sampler satVolumeIter(&satVolume); + + IteratorController::Sampler> satIterCont; + satIterCont.m_regValid = Region(satLowerCorner, satUpperCorner); + satIterCont.m_Iter = &satVolumeIter; + satIterCont.reset(); + + typename SrcVolumeType::Sampler srcVolumeIter(m_pVolSrc); + + IteratorController srcIterCont; + srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner); + srcIterCont.m_Iter = &srcVolumeIter; + srcIterCont.reset(); + + do + { + AccumulationType previousSum = static_cast(satVolumeIter.peekVoxel1nx0py0pz()); + AccumulationType currentVal = static_cast(srcVolumeIter.getVoxel()); + + satVolumeIter.setVoxel(previousSum + currentVal); + + srcIterCont.moveForward(); + + }while(satIterCont.moveForward()); + + //Build SAT in three passes + /*for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) + { + for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) + { + for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) + { + AccumulationType previousSum = static_cast(satVolume.getVoxelAt(x-1,y,z)); + AccumulationType currentVal = static_cast(m_pVolSrc->getVoxelAt(x,y,z)); + + satVolume.setVoxelAt(x,y,z,previousSum + currentVal); + } + } + }*/ + + for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) + { + for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) + { + for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) + { + AccumulationType previousSum = static_cast(satVolume.getVoxel(x,y-1,z, WrapModes::Border)); + AccumulationType currentSum = static_cast(satVolume.getVoxel(x,y,z, WrapModes::Border)); + + satVolume.setVoxelAt(x,y,z,previousSum + currentSum); + } + } + } + + for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++) + { + for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++) + { + for(int32_t x = satLowerCorner.getX(); x <= satUpperCorner.getX(); x++) + { + AccumulationType previousSum = static_cast(satVolume.getVoxel(x,y,z-1, WrapModes::Border)); + AccumulationType currentSum = static_cast(satVolume.getVoxel(x,y,z, WrapModes::Border)); + + satVolume.setVoxelAt(x,y,z,previousSum + currentSum); + } + } + } + + //Now compute the average + const Vector3DInt32& v3dDstLowerCorner = m_regDst.getLowerCorner(); + const Vector3DInt32& v3dDstUpperCorner = m_regDst.getUpperCorner(); + + const Vector3DInt32& v3dSrcLowerCorner = m_regSrc.getLowerCorner(); + + for(int32_t iDstZ = v3dDstLowerCorner.getZ(), iSrcZ = v3dSrcLowerCorner.getZ(); iDstZ <= v3dDstUpperCorner.getZ(); iDstZ++, iSrcZ++) + { + for(int32_t iDstY = v3dDstLowerCorner.getY(), iSrcY = v3dSrcLowerCorner.getY(); iDstY <= v3dDstUpperCorner.getY(); iDstY++, iSrcY++) + { + for(int32_t iDstX = v3dDstLowerCorner.getX(), iSrcX = v3dSrcLowerCorner.getX(); iDstX <= v3dDstUpperCorner.getX(); iDstX++, iSrcX++) + { + int32_t satLowerX = iSrcX - border - 1; + int32_t satLowerY = iSrcY - border - 1; + int32_t satLowerZ = iSrcZ - border - 1; + + int32_t satUpperX = iSrcX + border; + int32_t satUpperY = iSrcY + border; + int32_t satUpperZ = iSrcZ + border; + + AccumulationType a = satVolume.getVoxel(satLowerX,satLowerY,satLowerZ, WrapModes::Border); + AccumulationType b = satVolume.getVoxel(satUpperX,satLowerY,satLowerZ, WrapModes::Border); + AccumulationType c = satVolume.getVoxel(satLowerX,satUpperY,satLowerZ, WrapModes::Border); + AccumulationType d = satVolume.getVoxel(satUpperX,satUpperY,satLowerZ, WrapModes::Border); + AccumulationType e = satVolume.getVoxel(satLowerX,satLowerY,satUpperZ, WrapModes::Border); + AccumulationType f = satVolume.getVoxel(satUpperX,satLowerY,satUpperZ, WrapModes::Border); + AccumulationType g = satVolume.getVoxel(satLowerX,satUpperY,satUpperZ, WrapModes::Border); + AccumulationType h = satVolume.getVoxel(satUpperX,satUpperY,satUpperZ, WrapModes::Border); + + AccumulationType sum = h+c-d-g-f-a+b+e; + uint32_t sideLength = border * 2 + 1; + AccumulationType average = sum / (sideLength*sideLength*sideLength); + + m_pVolDst->setVoxelAt(iDstX, iDstY, iDstZ, static_cast(average)); + } + } + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index cf42800e..d1702f22 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -35,121 +35,121 @@ freely, subject to the following restrictions: namespace PolyVox { -#ifdef SWIG - struct MarchingCubesVertex -#else - template - struct POLYVOX_API MarchingCubesVertex -#endif - { - typedef _DataType DataType; - - // Each component of the position is stored using 8.8 fixed-point encoding. - Vector3DUint16 encodedPosition; - - // The normal is encoded as a 16-bit unsigned integer using the 'oct16' - // encoding described here: http://jcgt.org/published/0003/02/01/ - uint16_t encodedNormal; - - // User data - DataType data; - }; - - // Convienient shorthand for declaring a mesh of marching cubes vertices - // Currently disabled because it requires GCC 4.7 - //template - //using MarchingCubesMesh = Mesh< MarchingCubesVertex, IndexType >; - - /// Decodes a position from a MarchingCubesVertex - inline Vector3DFloat decodePosition(const Vector3DUint16& encodedPosition) - { - Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); - result *= (1.0f / 256.0f); // Division is compile-time constant - return result; - } - - inline uint16_t encodeNormal(const Vector3DFloat& normal) - { - // The first part of this function is based off the code in Listing 1 of http://jcgt.org/published/0003/02/01/ - // It was rewritten in C++ and is restructued for the CPU rather than the GPU. - - // Get the input components - float vx = normal.getX(); - float vy = normal.getY(); - float vz = normal.getZ(); - - // Project the sphere onto the octahedron, and then onto the xy plane - float px = vx * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); - float py = vy * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); - - // Reflect the folds of the lower hemisphere over the diagonals. - if (vz <= 0.0f) - { - float refx = ((1.0f - std::abs(py)) * (px >= 0.0f ? +1.0f : -1.0f)); - float refy = ((1.0f - std::abs(px)) * (py >= 0.0f ? +1.0f : -1.0f)); - px = refx; - py = refy; - } - - // The next part was not given in the paper. We map our two - // floats into two bytes and store them in a single uint16_t - - // Move from range [-1.0f, 1.0f] to [0.0f, 255.0f] - px = (px + 1.0f) * 127.5f; - py = (py + 1.0f) * 127.5f; - - // Convert to uints - uint16_t resultX = static_cast(px + 0.5f); - uint16_t resultY = static_cast(py + 0.5f); - - // Make sure only the lower bits are set. Probably - // not necessary but we're just being careful really. - resultX &= 0xFF; - resultY &= 0xFF; - - // Contatenate the bytes and return the result. - return (resultX << 8) | resultY; - } - - inline Vector3DFloat decodeNormal(const uint16_t& encodedNormal) - { - // Extract the two bytes from the uint16_t. - uint16_t ux = (encodedNormal >> 8) & 0xFF; - uint16_t uy = (encodedNormal ) & 0xFF; - - // Convert to floats in the range [-1.0f, +1.0f]. - float ex = ux / 127.5f - 1.0f; - float ey = uy / 127.5f - 1.0f; - - // Reconstruct the origninal vector. This is a C++ implementation - // of Listing 2 of http://jcgt.org/published/0003/02/01/ - float vx = ex; - float vy = ey; - float vz = 1.0f - std::abs(ex) - std::abs(ey); - - if (vz < 0.0f) - { - float refX = ((1.0f - std::abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f)); - float refY = ((1.0f - std::abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f)); - vx = refX; - vy = refY; - } - - // Normalise and return the result. - Vector3DFloat v(vx, vy, vz); - v.normalise(); - return v; - } - - /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. - template - Vertex decodeVertex(const MarchingCubesVertex& marchingCubesVertex) - { - Vertex result; - result.position = decodePosition(marchingCubesVertex.encodedPosition); - result.normal = decodeNormal(marchingCubesVertex.encodedNormal); - result.data = marchingCubesVertex.data; // Data is not encoded - return result; +#ifdef SWIG + struct MarchingCubesVertex +#else + template + struct POLYVOX_API MarchingCubesVertex +#endif + { + typedef _DataType DataType; + + // Each component of the position is stored using 8.8 fixed-point encoding. + Vector3DUint16 encodedPosition; + + // The normal is encoded as a 16-bit unsigned integer using the 'oct16' + // encoding described here: http://jcgt.org/published/0003/02/01/ + uint16_t encodedNormal; + + // User data + DataType data; + }; + + // Convienient shorthand for declaring a mesh of marching cubes vertices + // Currently disabled because it requires GCC 4.7 + //template + //using MarchingCubesMesh = Mesh< MarchingCubesVertex, IndexType >; + + /// Decodes a position from a MarchingCubesVertex + inline Vector3DFloat decodePosition(const Vector3DUint16& encodedPosition) + { + Vector3DFloat result(encodedPosition.getX(), encodedPosition.getY(), encodedPosition.getZ()); + result *= (1.0f / 256.0f); // Division is compile-time constant + return result; + } + + inline uint16_t encodeNormal(const Vector3DFloat& normal) + { + // The first part of this function is based off the code in Listing 1 of http://jcgt.org/published/0003/02/01/ + // It was rewritten in C++ and is restructued for the CPU rather than the GPU. + + // Get the input components + float vx = normal.getX(); + float vy = normal.getY(); + float vz = normal.getZ(); + + // Project the sphere onto the octahedron, and then onto the xy plane + float px = vx * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); + float py = vy * (1.0f / (std::abs(vx) + std::abs(vy) + std::abs(vz))); + + // Reflect the folds of the lower hemisphere over the diagonals. + if (vz <= 0.0f) + { + float refx = ((1.0f - std::abs(py)) * (px >= 0.0f ? +1.0f : -1.0f)); + float refy = ((1.0f - std::abs(px)) * (py >= 0.0f ? +1.0f : -1.0f)); + px = refx; + py = refy; + } + + // The next part was not given in the paper. We map our two + // floats into two bytes and store them in a single uint16_t + + // Move from range [-1.0f, 1.0f] to [0.0f, 255.0f] + px = (px + 1.0f) * 127.5f; + py = (py + 1.0f) * 127.5f; + + // Convert to uints + uint16_t resultX = static_cast(px + 0.5f); + uint16_t resultY = static_cast(py + 0.5f); + + // Make sure only the lower bits are set. Probably + // not necessary but we're just being careful really. + resultX &= 0xFF; + resultY &= 0xFF; + + // Contatenate the bytes and return the result. + return (resultX << 8) | resultY; + } + + inline Vector3DFloat decodeNormal(const uint16_t& encodedNormal) + { + // Extract the two bytes from the uint16_t. + uint16_t ux = (encodedNormal >> 8) & 0xFF; + uint16_t uy = (encodedNormal ) & 0xFF; + + // Convert to floats in the range [-1.0f, +1.0f]. + float ex = ux / 127.5f - 1.0f; + float ey = uy / 127.5f - 1.0f; + + // Reconstruct the origninal vector. This is a C++ implementation + // of Listing 2 of http://jcgt.org/published/0003/02/01/ + float vx = ex; + float vy = ey; + float vz = 1.0f - std::abs(ex) - std::abs(ey); + + if (vz < 0.0f) + { + float refX = ((1.0f - std::abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f)); + float refY = ((1.0f - std::abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f)); + vx = refX; + vy = refY; + } + + // Normalise and return the result. + Vector3DFloat v(vx, vy, vz); + v.normalise(); + return v; + } + + /// Decodes a MarchingCubesVertex by converting it into a regular Vertex which can then be directly used for rendering. + template + Vertex decodeVertex(const MarchingCubesVertex& marchingCubesVertex) + { + Vertex result; + result.position = decodePosition(marchingCubesVertex.encodedPosition); + result.normal = decodeNormal(marchingCubesVertex.encodedNormal); + result.data = marchingCubesVertex.data; // Data is not encoded + return result; } /// Do not use this class directly. Use the 'extractMarchingCubesSurface' function instead (see examples). diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl index 4c2402cf..cf8dcf67 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl @@ -1,637 +1,637 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Timer.h" - -namespace PolyVox -{ - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue) - :m_volData(volData) - ,m_sampVolume(volData) - ,m_meshCurrent(result) - ,m_regSizeInVoxels(region) - ,m_controller(controller) - ,m_tThreshold(m_controller.getThreshold()) - { - POLYVOX_THROW_IF(m_meshCurrent == nullptr, std::invalid_argument, "Provided mesh cannot be null"); - //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); - m_regSizeInCells = m_regSizeInVoxels; - m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); - - m_sampVolume.setWrapMode(eWrapMode, tBorderValue); - } - - template - void MarchingCubesSurfaceExtractor::execute() - { - Timer timer; - m_meshCurrent->clear(); - - const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; - const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; - - //For edge indices - Array2DInt32 m_pPreviousVertexIndicesX(uArrayWidth, uArrayHeight); - Array2DInt32 m_pPreviousVertexIndicesY(uArrayWidth, uArrayHeight); - Array2DInt32 m_pPreviousVertexIndicesZ(uArrayWidth, uArrayHeight); - Array2DInt32 m_pCurrentVertexIndicesX(uArrayWidth, uArrayHeight); - Array2DInt32 m_pCurrentVertexIndicesY(uArrayWidth, uArrayHeight); - Array2DInt32 m_pCurrentVertexIndicesZ(uArrayWidth, uArrayHeight); - - Array2DUint8 pPreviousBitmask(uArrayWidth, uArrayHeight); - Array2DUint8 pCurrentBitmask(uArrayWidth, uArrayHeight); - - //Create a region corresponding to the first slice - m_regSlicePrevious = m_regSizeInVoxels; - Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); - v3dUpperCorner.setZ(m_regSlicePrevious.getLowerZ()); //Set the upper z to the lower z to make it one slice thick. - m_regSlicePrevious.setUpperCorner(v3dUpperCorner); - m_regSliceCurrent = m_regSlicePrevious; - - uint32_t uNoOfNonEmptyCellsForSlice0 = 0; - uint32_t uNoOfNonEmptyCellsForSlice1 = 0; - - //Process the first slice (previous slice not available) - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - - //Process the other slices (previous slice is available) - for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ(); uSlice++) - { - computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); - uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; - - if(uNoOfNonEmptyCellsForSlice1 != 0) - { - memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); - memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); - generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); - } - - if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) - { - generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); - } - - std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); - pPreviousBitmask.swap(pCurrentBitmask); - m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); - m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); - m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); - - m_regSlicePrevious = m_regSliceCurrent; - m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); - } - - m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); - - POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds() - << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() - << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); - } - - template - template - uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) - { - m_uNoOfOccupiedCells = 0; - - const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperX(); - const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperY(); - - const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); - - //Process the lower left corner - int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); - int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); - - uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - - //Process the edge where x is minimal. - iXVolSpace = m_regSliceCurrent.getLowerX(); - m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerY(), iZVolSpace); - for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveY(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - - //Process the edge where y is minimal. - iYVolSpace = m_regSliceCurrent.getLowerY(); - m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - - //Process all remaining elemnents of the slice. In this case, previous x and y values are always available - for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) - { - m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); - for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) - { - uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - m_sampVolume.movePositiveX(); - - computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); - } - } - - return m_uNoOfOccupiedCells; - } - - template - template - void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) - { - uint8_t iCubeIndex = 0; - - typename VolumeType::VoxelType v000; - typename VolumeType::VoxelType v100; - typename VolumeType::VoxelType v010; - typename VolumeType::VoxelType v110; - typename VolumeType::VoxelType v001; - typename VolumeType::VoxelType v101; - typename VolumeType::VoxelType v011; - typename VolumeType::VoxelType v111; - - if(isPrevZAvail) - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); - iPreviousCubeIndexX &= 128; - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); - iPreviousCubeIndexZ >>= 4; - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); - iPreviousCubeIndexY &= 192; //192 = 128 + 64 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); - iPreviousCubeIndexZ >>= 4; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); - iPreviousCubeIndexX &= 160; //160 = 128+32 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; - - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //z - uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); - iCubeIndex = iPreviousCubeIndexZ >> 4; - - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - else //previous Z not available - { - if(isPrevYAvail) - { - if(isPrevXAvail) - { - v110 = m_sampVolume.peekVoxel1px1py0pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //y - uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); - iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 - iPreviousCubeIndexY >>= 2; - - iCubeIndex = iPreviousCubeIndexY; - - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - else //previous Y not available - { - if(isPrevXAvail) - { - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - //x - uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); - iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 - iPreviousCubeIndexX >>= 1; - - iCubeIndex = iPreviousCubeIndexX; - - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - else //previous X not available - { - v000 = m_sampVolume.getVoxel(); - v100 = m_sampVolume.peekVoxel1px0py0pz(); - v010 = m_sampVolume.peekVoxel0px1py0pz(); - v110 = m_sampVolume.peekVoxel1px1py0pz(); - - v001 = m_sampVolume.peekVoxel0px0py1pz(); - v101 = m_sampVolume.peekVoxel1px0py1pz(); - v011 = m_sampVolume.peekVoxel0px1py1pz(); - v111 = m_sampVolume.peekVoxel1px1py1pz(); - - if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; - if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; - if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; - if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; - if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; - if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; - if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; - if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; - } - } - } - - //Save the bitmask - pCurrentBitmask(uXRegSpace, uYRegSpace) = iCubeIndex; - - if(edgeTable[iCubeIndex] != 0) - { - ++m_uNoOfOccupiedCells; - } - } - - template - void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, - Array2DInt32& m_pCurrentVertexIndicesX, - Array2DInt32& m_pCurrentVertexIndicesY, - Array2DInt32& m_pCurrentVertexIndicesZ) - { - const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); - - //Iterate over each cell in the region - for(int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); iYVolSpace <= m_regSliceCurrent.getUpperY(); iYVolSpace++) - { - const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); - - for(int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); iXVolSpace <= m_regSliceCurrent.getUpperX(); iXVolSpace++) - { - //Current position - const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pCurrentBitmask(uXRegSpace, uYRegSpace); - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - //Check whether the generated vertex will lie on the edge of the region - - - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); - const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - m_sampVolume.movePositiveX(); - const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v100, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); - const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); - - Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); - - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); - - MarchingCubesVertex surfaceVertex; - surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodeNormal(v3dNormal); - surfaceVertex.data = uMaterial; - - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesX(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; - - m_sampVolume.moveNegativeX(); - } - if (edgeTable[iCubeIndex] & 8) - { - m_sampVolume.movePositiveY(); - const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v010, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); - const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); - - Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); - - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); - - MarchingCubesVertex surfaceVertex; - surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodeNormal(v3dNormal); - surfaceVertex.data = uMaterial; - - uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesY(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; - - m_sampVolume.moveNegativeY(); - } - if (edgeTable[iCubeIndex] & 256) - { - m_sampVolume.movePositiveZ(); - const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); - POLYVOX_ASSERT(v000 != v001, "Attempting to insert vertex between two voxels with the same value"); - const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); - - const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); - - const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); - const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); - - Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); - // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so - // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). - if(v3dNormal.lengthSquared() > 0.000001f) - { - v3dNormal.normalise(); - } - - // Allow the controller to decide how the material should be derived from the voxels. - const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); - - MarchingCubesVertex surfaceVertex; - surfaceVertex.encodedPosition = v3dScaledPosition; - surfaceVertex.encodedNormal = encodeNormal(v3dNormal); - surfaceVertex.data = uMaterial; - - const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); - m_pCurrentVertexIndicesZ(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; - - m_sampVolume.moveNegativeZ(); - } - }//For each cell - } - } - - template - void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, - const Array2DInt32& m_pPreviousVertexIndicesX, - const Array2DInt32& m_pPreviousVertexIndicesY, - const Array2DInt32& m_pPreviousVertexIndicesZ, - const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY) - { - int32_t indlist[12]; - for(int i = 0; i < 12; i++) - { - indlist[i] = -1; - } - - const int32_t iZVolSpace = m_regSlicePrevious.getLowerZ(); - - for(int32_t iYVolSpace = m_regSlicePrevious.getLowerY(); iYVolSpace <= m_regSizeInCells.getUpperY(); iYVolSpace++) - { - for(int32_t iXVolSpace = m_regSlicePrevious.getLowerX(); iXVolSpace <= m_regSizeInCells.getUpperX(); iXVolSpace++) - { - m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); - - //Current position - const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerX(); - const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); - - //Determine the index into the edge table which tells us which vertices are inside of the surface - const uint8_t iCubeIndex = pPreviousBitmask(uXRegSpace, uYRegSpace); - - /* Cube is entirely in/out of the surface */ - if (edgeTable[iCubeIndex] == 0) - { - continue; - } - - /* Find the vertices where the surface intersects the cube */ - if (edgeTable[iCubeIndex] & 1) - { - indlist[0] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 2) - { - indlist[1] = m_pPreviousVertexIndicesY(uXRegSpace + 1, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 4) - { - indlist[2] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace + 1); - } - if (edgeTable[iCubeIndex] & 8) - { - indlist[3] = m_pPreviousVertexIndicesY(uXRegSpace, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 16) - { - indlist[4] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 32) - { - indlist[5] = m_pCurrentVertexIndicesY(uXRegSpace + 1, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 64) - { - indlist[6] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace + 1); - } - if (edgeTable[iCubeIndex] & 128) - { - indlist[7] = m_pCurrentVertexIndicesY(uXRegSpace, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 256) - { - indlist[8] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 512) - { - indlist[9] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace); - } - if (edgeTable[iCubeIndex] & 1024) - { - indlist[10] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace + 1); - } - if (edgeTable[iCubeIndex] & 2048) - { - indlist[11] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace + 1); - } - - for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) - { - const int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - const int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - const int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; - - if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) - { - m_meshCurrent->addTriangle(ind0, ind1, ind2); - } - }//For each triangle - }//For each cell - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Impl/Timer.h" + +namespace PolyVox +{ + template + MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, MeshType* result, ControllerType controller, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue) + :m_volData(volData) + ,m_sampVolume(volData) + ,m_meshCurrent(result) + ,m_regSizeInVoxels(region) + ,m_controller(controller) + ,m_tThreshold(m_controller.getThreshold()) + { + POLYVOX_THROW_IF(m_meshCurrent == nullptr, std::invalid_argument, "Provided mesh cannot be null"); + //m_regSizeInVoxels.cropTo(m_volData->getEnclosingRegion()); + m_regSizeInCells = m_regSizeInVoxels; + m_regSizeInCells.setUpperCorner(m_regSizeInCells.getUpperCorner() - Vector3DInt32(1,1,1)); + + m_sampVolume.setWrapMode(eWrapMode, tBorderValue); + } + + template + void MarchingCubesSurfaceExtractor::execute() + { + Timer timer; + m_meshCurrent->clear(); + + const uint32_t uArrayWidth = m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 1; + const uint32_t uArrayHeight = m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 1; + + //For edge indices + Array2DInt32 m_pPreviousVertexIndicesX(uArrayWidth, uArrayHeight); + Array2DInt32 m_pPreviousVertexIndicesY(uArrayWidth, uArrayHeight); + Array2DInt32 m_pPreviousVertexIndicesZ(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesX(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesY(uArrayWidth, uArrayHeight); + Array2DInt32 m_pCurrentVertexIndicesZ(uArrayWidth, uArrayHeight); + + Array2DUint8 pPreviousBitmask(uArrayWidth, uArrayHeight); + Array2DUint8 pCurrentBitmask(uArrayWidth, uArrayHeight); + + //Create a region corresponding to the first slice + m_regSlicePrevious = m_regSizeInVoxels; + Vector3DInt32 v3dUpperCorner = m_regSlicePrevious.getUpperCorner(); + v3dUpperCorner.setZ(m_regSlicePrevious.getLowerZ()); //Set the upper z to the lower z to make it one slice thick. + m_regSlicePrevious.setUpperCorner(v3dUpperCorner); + m_regSliceCurrent = m_regSlicePrevious; + + uint32_t uNoOfNonEmptyCellsForSlice0 = 0; + uint32_t uNoOfNonEmptyCellsForSlice1 = 0; + + //Process the first slice (previous slice not available) + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + + //Process the other slices (previous slice is available) + for(int32_t uSlice = 1; uSlice <= m_regSizeInVoxels.getUpperZ() - m_regSizeInVoxels.getLowerZ(); uSlice++) + { + computeBitmaskForSlice(pPreviousBitmask, pCurrentBitmask); + uNoOfNonEmptyCellsForSlice1 = m_uNoOfOccupiedCells; + + if(uNoOfNonEmptyCellsForSlice1 != 0) + { + memset(m_pCurrentVertexIndicesX.getRawData(), 0xff, m_pCurrentVertexIndicesX.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesY.getRawData(), 0xff, m_pCurrentVertexIndicesY.getNoOfElements() * 4); + memset(m_pCurrentVertexIndicesZ.getRawData(), 0xff, m_pCurrentVertexIndicesZ.getNoOfElements() * 4); + generateVerticesForSlice(pCurrentBitmask, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); + } + + if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) + { + generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY); + } + + std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); + pPreviousBitmask.swap(pCurrentBitmask); + m_pPreviousVertexIndicesX.swap(m_pCurrentVertexIndicesX); + m_pPreviousVertexIndicesY.swap(m_pCurrentVertexIndicesY); + m_pPreviousVertexIndicesZ.swap(m_pCurrentVertexIndicesZ); + + m_regSlicePrevious = m_regSliceCurrent; + m_regSliceCurrent.shift(Vector3DInt32(0,0,1)); + } + + m_meshCurrent->setOffset(m_regSizeInVoxels.getLowerCorner()); + + POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds() + << "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels() + << "x" << m_regSizeInVoxels.getDepthInVoxels() << ")"); + } + + template + template + uint32_t MarchingCubesSurfaceExtractor::computeBitmaskForSlice(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask) + { + m_uNoOfOccupiedCells = 0; + + const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperX(); + const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperY(); + + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); + + //Process the lower left corner + int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); + int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); + + uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + + //Process the edge where x is minimal. + iXVolSpace = m_regSliceCurrent.getLowerX(); + m_sampVolume.setPosition(iXVolSpace, m_regSliceCurrent.getLowerY(), iZVolSpace); + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveY(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + + //Process the edge where y is minimal. + iYVolSpace = m_regSliceCurrent.getLowerY(); + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + + //Process all remaining elemnents of the slice. In this case, previous x and y values are always available + for(iYVolSpace = m_regSliceCurrent.getLowerY() + 1; iYVolSpace <= iMaxYVolSpace; iYVolSpace++) + { + m_sampVolume.setPosition(m_regSliceCurrent.getLowerX(), iYVolSpace, iZVolSpace); + for(iXVolSpace = m_regSliceCurrent.getLowerX() + 1; iXVolSpace <= iMaxXVolSpace; iXVolSpace++) + { + uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + m_sampVolume.movePositiveX(); + + computeBitmaskForCell(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace); + } + } + + return m_uNoOfOccupiedCells; + } + + template + template + void MarchingCubesSurfaceExtractor::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace) + { + uint8_t iCubeIndex = 0; + + typename VolumeType::VoxelType v000; + typename VolumeType::VoxelType v100; + typename VolumeType::VoxelType v010; + typename VolumeType::VoxelType v110; + typename VolumeType::VoxelType v001; + typename VolumeType::VoxelType v101; + typename VolumeType::VoxelType v011; + typename VolumeType::VoxelType v111; + + if(isPrevZAvail) + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); + iPreviousCubeIndexX &= 128; + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); + iPreviousCubeIndexZ >>= 4; + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); + iPreviousCubeIndexY &= 192; //192 = 128 + 64 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); + iPreviousCubeIndexZ >>= 4; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); + iPreviousCubeIndexX &= 160; //160 = 128+32 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ; + + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //z + uint8_t iPreviousCubeIndexZ = pPreviousBitmask(uXRegSpace, uYRegSpace); + iCubeIndex = iPreviousCubeIndexZ >> 4; + + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + else //previous Z not available + { + if(isPrevYAvail) + { + if(isPrevXAvail) + { + v110 = m_sampVolume.peekVoxel1px1py0pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //y + uint8_t iPreviousCubeIndexY = pCurrentBitmask(uXRegSpace, uYRegSpace - 1); + iPreviousCubeIndexY &= 204; //204 = 128+64+8+4 + iPreviousCubeIndexY >>= 2; + + iCubeIndex = iPreviousCubeIndexY; + + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + else //previous Y not available + { + if(isPrevXAvail) + { + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + //x + uint8_t iPreviousCubeIndexX = pCurrentBitmask(uXRegSpace - 1, uYRegSpace); + iPreviousCubeIndexX &= 170; //170 = 128+32+8+2 + iPreviousCubeIndexX >>= 1; + + iCubeIndex = iPreviousCubeIndexX; + + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + else //previous X not available + { + v000 = m_sampVolume.getVoxel(); + v100 = m_sampVolume.peekVoxel1px0py0pz(); + v010 = m_sampVolume.peekVoxel0px1py0pz(); + v110 = m_sampVolume.peekVoxel1px1py0pz(); + + v001 = m_sampVolume.peekVoxel0px0py1pz(); + v101 = m_sampVolume.peekVoxel1px0py1pz(); + v011 = m_sampVolume.peekVoxel0px1py1pz(); + v111 = m_sampVolume.peekVoxel1px1py1pz(); + + if (m_controller.convertToDensity(v000) < m_tThreshold) iCubeIndex |= 1; + if (m_controller.convertToDensity(v100) < m_tThreshold) iCubeIndex |= 2; + if (m_controller.convertToDensity(v010) < m_tThreshold) iCubeIndex |= 4; + if (m_controller.convertToDensity(v110) < m_tThreshold) iCubeIndex |= 8; + if (m_controller.convertToDensity(v001) < m_tThreshold) iCubeIndex |= 16; + if (m_controller.convertToDensity(v101) < m_tThreshold) iCubeIndex |= 32; + if (m_controller.convertToDensity(v011) < m_tThreshold) iCubeIndex |= 64; + if (m_controller.convertToDensity(v111) < m_tThreshold) iCubeIndex |= 128; + } + } + } + + //Save the bitmask + pCurrentBitmask(uXRegSpace, uYRegSpace) = iCubeIndex; + + if(edgeTable[iCubeIndex] != 0) + { + ++m_uNoOfOccupiedCells; + } + } + + template + void MarchingCubesSurfaceExtractor::generateVerticesForSlice(const Array2DUint8& pCurrentBitmask, + Array2DInt32& m_pCurrentVertexIndicesX, + Array2DInt32& m_pCurrentVertexIndicesY, + Array2DInt32& m_pCurrentVertexIndicesZ) + { + const int32_t iZVolSpace = m_regSliceCurrent.getLowerZ(); + + //Iterate over each cell in the region + for(int32_t iYVolSpace = m_regSliceCurrent.getLowerY(); iYVolSpace <= m_regSliceCurrent.getUpperY(); iYVolSpace++) + { + const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY(); + + for(int32_t iXVolSpace = m_regSliceCurrent.getLowerX(); iXVolSpace <= m_regSliceCurrent.getUpperX(); iXVolSpace++) + { + //Current position + const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + const uint8_t iCubeIndex = pCurrentBitmask(uXRegSpace, uYRegSpace); + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + //Check whether the generated vertex will lie on the edge of the region + + + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); + const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + m_sampVolume.movePositiveX(); + const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v100, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v100) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()) + fInterp, static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInCells.getLowerZ())); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + + Vector3DFloat v3dNormal = (n100*fInterp) + (n000*(1-fInterp)); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v100, fInterp); + + MarchingCubesVertex surfaceVertex; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); + surfaceVertex.data = uMaterial; + + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesX(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; + + m_sampVolume.moveNegativeX(); + } + if (edgeTable[iCubeIndex] & 8) + { + m_sampVolume.movePositiveY(); + const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v010, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v010) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()) + fInterp, static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ())); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + + Vector3DFloat v3dNormal = (n010*fInterp) + (n000*(1-fInterp)); + + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v010, fInterp); + + MarchingCubesVertex surfaceVertex; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); + surfaceVertex.data = uMaterial; + + uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesY(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; + + m_sampVolume.moveNegativeY(); + } + if (edgeTable[iCubeIndex] & 256) + { + m_sampVolume.movePositiveZ(); + const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); + POLYVOX_ASSERT(v000 != v001, "Attempting to insert vertex between two voxels with the same value"); + const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); + + const float fInterp = static_cast(m_tThreshold - m_controller.convertToDensity(v000)) / static_cast(m_controller.convertToDensity(v001) - m_controller.convertToDensity(v000)); + + const Vector3DFloat v3dPosition(static_cast(iXVolSpace - m_regSizeInVoxels.getLowerX()), static_cast(iYVolSpace - m_regSizeInVoxels.getLowerY()), static_cast(iZVolSpace - m_regSizeInVoxels.getLowerZ()) + fInterp); + const Vector3DUint16 v3dScaledPosition(static_cast(v3dPosition.getX() * 256.0f), static_cast(v3dPosition.getY() * 256.0f), static_cast(v3dPosition.getZ() * 256.0f)); + + Vector3DFloat v3dNormal = (n001*fInterp) + (n000*(1-fInterp)); + // The gradient for a voxel can be zero (e.g. solid voxel surrounded by empty ones) and so + // the interpolated normal can also be zero (e.g. a grid of alternating solid and empty voxels). + if(v3dNormal.lengthSquared() > 0.000001f) + { + v3dNormal.normalise(); + } + + // Allow the controller to decide how the material should be derived from the voxels. + const typename VolumeType::VoxelType uMaterial = m_controller.blendMaterials(v000, v001, fInterp); + + MarchingCubesVertex surfaceVertex; + surfaceVertex.encodedPosition = v3dScaledPosition; + surfaceVertex.encodedNormal = encodeNormal(v3dNormal); + surfaceVertex.data = uMaterial; + + const uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); + m_pCurrentVertexIndicesZ(iXVolSpace - m_regSizeInVoxels.getLowerX(), iYVolSpace - m_regSizeInVoxels.getLowerY()) = uLastVertexIndex; + + m_sampVolume.moveNegativeZ(); + } + }//For each cell + } + } + + template + void MarchingCubesSurfaceExtractor::generateIndicesForSlice(const Array2DUint8& pPreviousBitmask, + const Array2DInt32& m_pPreviousVertexIndicesX, + const Array2DInt32& m_pPreviousVertexIndicesY, + const Array2DInt32& m_pPreviousVertexIndicesZ, + const Array2DInt32& m_pCurrentVertexIndicesX, + const Array2DInt32& m_pCurrentVertexIndicesY) + { + int32_t indlist[12]; + for(int i = 0; i < 12; i++) + { + indlist[i] = -1; + } + + const int32_t iZVolSpace = m_regSlicePrevious.getLowerZ(); + + for(int32_t iYVolSpace = m_regSlicePrevious.getLowerY(); iYVolSpace <= m_regSizeInCells.getUpperY(); iYVolSpace++) + { + for(int32_t iXVolSpace = m_regSlicePrevious.getLowerX(); iXVolSpace <= m_regSizeInCells.getUpperX(); iXVolSpace++) + { + m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); + + //Current position + const uint32_t uXRegSpace = m_sampVolume.getPosition().getX() - m_regSizeInVoxels.getLowerX(); + const uint32_t uYRegSpace = m_sampVolume.getPosition().getY() - m_regSizeInVoxels.getLowerY(); + + //Determine the index into the edge table which tells us which vertices are inside of the surface + const uint8_t iCubeIndex = pPreviousBitmask(uXRegSpace, uYRegSpace); + + /* Cube is entirely in/out of the surface */ + if (edgeTable[iCubeIndex] == 0) + { + continue; + } + + /* Find the vertices where the surface intersects the cube */ + if (edgeTable[iCubeIndex] & 1) + { + indlist[0] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 2) + { + indlist[1] = m_pPreviousVertexIndicesY(uXRegSpace + 1, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 4) + { + indlist[2] = m_pPreviousVertexIndicesX(uXRegSpace, uYRegSpace + 1); + } + if (edgeTable[iCubeIndex] & 8) + { + indlist[3] = m_pPreviousVertexIndicesY(uXRegSpace, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 16) + { + indlist[4] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 32) + { + indlist[5] = m_pCurrentVertexIndicesY(uXRegSpace + 1, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 64) + { + indlist[6] = m_pCurrentVertexIndicesX(uXRegSpace, uYRegSpace + 1); + } + if (edgeTable[iCubeIndex] & 128) + { + indlist[7] = m_pCurrentVertexIndicesY(uXRegSpace, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 256) + { + indlist[8] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 512) + { + indlist[9] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace); + } + if (edgeTable[iCubeIndex] & 1024) + { + indlist[10] = m_pPreviousVertexIndicesZ(uXRegSpace + 1, uYRegSpace + 1); + } + if (edgeTable[iCubeIndex] & 2048) + { + indlist[11] = m_pPreviousVertexIndicesZ(uXRegSpace, uYRegSpace + 1); + } + + for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) + { + const int32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + const int32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + const int32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + + if((ind0 != -1) && (ind1 != -1) && (ind2 != -1)) + { + m_meshCurrent->addTriangle(ind0, ind1, ind2); + } + }//For each triangle + }//For each cell + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/library/PolyVoxCore/include/PolyVoxCore/Material.h index 1e4857c3..2958d7e5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Material.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Material.h @@ -1,91 +1,91 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Material_H__ -#define __PolyVox_Material_H__ - -#include "Impl/TypeDef.h" - -#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type - -namespace PolyVox -{ - ///This class represents a voxel storing only a material. - //////////////////////////////////////////////////////////////////////////////// - /// Detailed description... - /// - /// \sa Density, MaterialDensityPair - //////////////////////////////////////////////////////////////////////////////// - template - class Material - { - public: - Material() : m_uMaterial(0) {} - Material(Type uMaterial) : m_uMaterial(uMaterial) {} - - bool operator==(const Material& rhs) const - { - return (m_uMaterial == rhs.m_uMaterial); - }; - - bool operator!=(const Material& rhs) const - { - return !(*this == rhs); - } - - /// \return The current material value of the voxel - Type getMaterial() const { return m_uMaterial; } - /** - * Set the material value of the voxel - * - * \param uMaterial The material to set to - */ - void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } - - private: - Type m_uMaterial; - }; - - typedef Material Material8; - typedef Material Material16; - - template - class DefaultIsQuadNeeded< Material > - { - public: - bool operator()(Material back, Material front, Material& materialToUse) - { - if((back.getMaterial() > 0) && (front.getMaterial() == 0)) - { - materialToUse = back; - return true; - } - else - { - return false; - } - } - }; -} - -#endif //__PolyVox_Material_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Material_H__ +#define __PolyVox_Material_H__ + +#include "Impl/TypeDef.h" + +#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type + +namespace PolyVox +{ + ///This class represents a voxel storing only a material. + //////////////////////////////////////////////////////////////////////////////// + /// Detailed description... + /// + /// \sa Density, MaterialDensityPair + //////////////////////////////////////////////////////////////////////////////// + template + class Material + { + public: + Material() : m_uMaterial(0) {} + Material(Type uMaterial) : m_uMaterial(uMaterial) {} + + bool operator==(const Material& rhs) const + { + return (m_uMaterial == rhs.m_uMaterial); + }; + + bool operator!=(const Material& rhs) const + { + return !(*this == rhs); + } + + /// \return The current material value of the voxel + Type getMaterial() const { return m_uMaterial; } + /** + * Set the material value of the voxel + * + * \param uMaterial The material to set to + */ + void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } + + private: + Type m_uMaterial; + }; + + typedef Material Material8; + typedef Material Material16; + + template + class DefaultIsQuadNeeded< Material > + { + public: + bool operator()(Material back, Material front, Material& materialToUse) + { + if((back.getMaterial() > 0) && (front.getMaterial() == 0)) + { + materialToUse = back; + return true; + } + else + { + return false; + } + } + }; +} + +#endif //__PolyVox_Material_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h index f8374d9d..83cc1739 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h @@ -1,165 +1,165 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_MaterialDensityPair_H__ -#define __PolyVox_MaterialDensityPair_H__ - -#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type -#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here - -#include "Impl/TypeDef.h" - -namespace PolyVox -{ - /// This class represents a voxel storing only a density. - //////////////////////////////////////////////////////////////////////////////// - /// Detailed description... - /// - /// \sa Density, Material - //////////////////////////////////////////////////////////////////////////////// - template - class MaterialDensityPair - { - public: - MaterialDensityPair() : m_uMaterial(0), m_uDensity(0) {} - MaterialDensityPair(Type uMaterial, Type uDensity) : m_uMaterial(uMaterial), m_uDensity(uDensity) {} - - bool operator==(const MaterialDensityPair& rhs) const - { - return (m_uMaterial == rhs.m_uMaterial) && (m_uDensity == rhs.m_uDensity); - }; - - bool operator!=(const MaterialDensityPair& rhs) const - { - return !(*this == rhs); - } - - MaterialDensityPair& operator+=(const MaterialDensityPair& rhs) - { - m_uDensity += rhs.m_uDensity; - - // What should we do with the material? Conceptually the idea of adding materials makes no sense, but for our - // purposes we consider the 'sum' of two materials to just be the max. At least this way it is commutative. - m_uMaterial = (std::max)(m_uMaterial, rhs.m_uMaterial); - - return *this; - } - - MaterialDensityPair& operator/=(uint32_t rhs) - { - // There's nothing sensible we can do with the material, so this function only affects the density. - m_uDensity /= rhs; - return *this; - } - - Type getDensity() const { return m_uDensity; } - Type getMaterial() const { return m_uMaterial; } - - void setDensity(Type uDensity) { m_uDensity = uDensity; } - void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } - - static Type getMaxDensity() { return (0x01 << NoOfDensityBits) - 1; } - static Type getMinDensity() { return 0; } - - private: - Type m_uMaterial : NoOfMaterialBits; - Type m_uDensity : NoOfDensityBits; - }; - - template - class DefaultIsQuadNeeded< MaterialDensityPair > - { - public: - bool operator()(MaterialDensityPair back, MaterialDensityPair front, MaterialDensityPair& materialToUse) - { - if((back.getMaterial() > 0) && (front.getMaterial() == 0)) - { - materialToUse = back; - return true; - } - else - { - return false; - } - } - }; - - template - class DefaultMarchingCubesController< MaterialDensityPair > - { - public: - typedef Type DensityType; - typedef Type MaterialType; - - DefaultMarchingCubesController(void) - { - // Default to a threshold value halfway between the min and max possible values. - m_tThreshold = (MaterialDensityPair::getMinDensity() + MaterialDensityPair::getMaxDensity()) / 2; - } - - DefaultMarchingCubesController(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - DensityType convertToDensity(MaterialDensityPair voxel) - { - return voxel.getDensity(); - } - - MaterialType convertToMaterial(MaterialDensityPair voxel) - { - return voxel.getMaterial(); - } - - MaterialDensityPair blendMaterials(MaterialDensityPair a, MaterialDensityPair b, float /*weight*/) - { - if(convertToDensity(a) > convertToDensity(b)) - { - return a; - } - else - { - return b; - } - } - - DensityType getThreshold(void) - { - return m_tThreshold; - } - - void setThreshold(DensityType tThreshold) - { - m_tThreshold = tThreshold; - } - - private: - DensityType m_tThreshold; - }; - - typedef MaterialDensityPair MaterialDensityPair44; - typedef MaterialDensityPair MaterialDensityPair88; -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_MaterialDensityPair_H__ +#define __PolyVox_MaterialDensityPair_H__ + +#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type +#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here + +#include "Impl/TypeDef.h" + +namespace PolyVox +{ + /// This class represents a voxel storing only a density. + //////////////////////////////////////////////////////////////////////////////// + /// Detailed description... + /// + /// \sa Density, Material + //////////////////////////////////////////////////////////////////////////////// + template + class MaterialDensityPair + { + public: + MaterialDensityPair() : m_uMaterial(0), m_uDensity(0) {} + MaterialDensityPair(Type uMaterial, Type uDensity) : m_uMaterial(uMaterial), m_uDensity(uDensity) {} + + bool operator==(const MaterialDensityPair& rhs) const + { + return (m_uMaterial == rhs.m_uMaterial) && (m_uDensity == rhs.m_uDensity); + }; + + bool operator!=(const MaterialDensityPair& rhs) const + { + return !(*this == rhs); + } + + MaterialDensityPair& operator+=(const MaterialDensityPair& rhs) + { + m_uDensity += rhs.m_uDensity; + + // What should we do with the material? Conceptually the idea of adding materials makes no sense, but for our + // purposes we consider the 'sum' of two materials to just be the max. At least this way it is commutative. + m_uMaterial = (std::max)(m_uMaterial, rhs.m_uMaterial); + + return *this; + } + + MaterialDensityPair& operator/=(uint32_t rhs) + { + // There's nothing sensible we can do with the material, so this function only affects the density. + m_uDensity /= rhs; + return *this; + } + + Type getDensity() const { return m_uDensity; } + Type getMaterial() const { return m_uMaterial; } + + void setDensity(Type uDensity) { m_uDensity = uDensity; } + void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } + + static Type getMaxDensity() { return (0x01 << NoOfDensityBits) - 1; } + static Type getMinDensity() { return 0; } + + private: + Type m_uMaterial : NoOfMaterialBits; + Type m_uDensity : NoOfDensityBits; + }; + + template + class DefaultIsQuadNeeded< MaterialDensityPair > + { + public: + bool operator()(MaterialDensityPair back, MaterialDensityPair front, MaterialDensityPair& materialToUse) + { + if((back.getMaterial() > 0) && (front.getMaterial() == 0)) + { + materialToUse = back; + return true; + } + else + { + return false; + } + } + }; + + template + class DefaultMarchingCubesController< MaterialDensityPair > + { + public: + typedef Type DensityType; + typedef Type MaterialType; + + DefaultMarchingCubesController(void) + { + // Default to a threshold value halfway between the min and max possible values. + m_tThreshold = (MaterialDensityPair::getMinDensity() + MaterialDensityPair::getMaxDensity()) / 2; + } + + DefaultMarchingCubesController(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + DensityType convertToDensity(MaterialDensityPair voxel) + { + return voxel.getDensity(); + } + + MaterialType convertToMaterial(MaterialDensityPair voxel) + { + return voxel.getMaterial(); + } + + MaterialDensityPair blendMaterials(MaterialDensityPair a, MaterialDensityPair b, float /*weight*/) + { + if(convertToDensity(a) > convertToDensity(b)) + { + return a; + } + else + { + return b; + } + } + + DensityType getThreshold(void) + { + return m_tThreshold; + } + + void setThreshold(DensityType tThreshold) + { + m_tThreshold = tThreshold; + } + + private: + DensityType m_tThreshold; + }; + + typedef MaterialDensityPair MaterialDensityPair44; + typedef MaterialDensityPair MaterialDensityPair88; +} + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 58aceae2..791baba2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -1,195 +1,195 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_ForwardDeclarations_H__ -#define __PolyVox_ForwardDeclarations_H__ - -#include "Impl/TypeDef.h" - -#include - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - // Array - //////////////////////////////////////////////////////////////////////////////// - /*template class Array; - - typedef Array<1,float> Array1DFloat; - typedef Array<1,double> Array1DDouble; - typedef Array<1,int8_t> Array1DInt8; - typedef Array<1,uint8_t> Array1DUint8; - typedef Array<1,int16_t> Array1DInt16; - typedef Array<1,uint16_t> Array1DUint16; - typedef Array<1,int32_t> Array1DInt32; - typedef Array<1,uint32_t> Array1DUint32;*/ - - /*typedef Array<2,float> Array2DFloat; - typedef Array<2,double> Array2DDouble; - typedef Array<2,int8_t> Array2DInt8; - typedef Array<2,uint8_t> Array2DUint8; - typedef Array<2,int16_t> Array2DInt16; - typedef Array<2,uint16_t> Array2DUint16; - typedef Array<2,int32_t> Array2DInt32; - typedef Array<2,uint32_t> Array2DUint32;*/ - - /*typedef Array<3,float> Array3DFloat; - typedef Array<3,double> Array3DDouble; - typedef Array<3,int8_t> Array3DInt8; - typedef Array<3,uint8_t> Array3DUint8; - typedef Array<3,int16_t> Array3DInt16; - typedef Array<3,uint16_t> Array3DUint16; - typedef Array<3,int32_t> Array3DInt32; - typedef Array<3,uint32_t> Array3DUint32;*/ - - //////////////////////////////////////////////////////////////////////////////// - // Compressor - //////////////////////////////////////////////////////////////////////////////// - class Compressor; - - //////////////////////////////////////////////////////////////////////////////// - // CubicSurfaceExtractor - //////////////////////////////////////////////////////////////////////////////// - template class DefaultIsQuadNeeded; - template > class CubicSurfaceExtractor; - - //////////////////////////////////////////////////////////////////////////////// - // CubicVertex - //////////////////////////////////////////////////////////////////////////////// - template struct CubicVertex; - - //////////////////////////////////////////////////////////////////////////////// - // Density - //////////////////////////////////////////////////////////////////////////////// - template class Density; - - typedef Density DensityI8; - typedef Density DensityU8; - typedef Density DensityI16; - typedef Density DensityU16; - typedef Density DensityFloat; - typedef Density DensityDouble; - - typedef DensityU8 Density8; //Backwards compatibility - typedef DensityU16 Density16; //Backwards compatibility - - //////////////////////////////////////////////////////////////////////////////// - // FilePager - //////////////////////////////////////////////////////////////////////////////// - template class FilePager; - - //////////////////////////////////////////////////////////////////////////////// - // MarchingCubesSurfaceExtractor - //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; - - //////////////////////////////////////////////////////////////////////////////// - // MarchingCubesVertex - //////////////////////////////////////////////////////////////////////////////// - template struct MarchingCubesVertex; - - //////////////////////////////////////////////////////////////////////////////// - // Material - //////////////////////////////////////////////////////////////////////////////// - template class Material; - - typedef Material MaterialU8; - typedef Material MaterialU16; - typedef Material MaterialU32; - - typedef MaterialU8 Material8; - typedef MaterialU16 Material16; - typedef MaterialU32 Material32; - - //////////////////////////////////////////////////////////////////////////////// - // MaterialDensityPair - //////////////////////////////////////////////////////////////////////////////// - template class MaterialDensityPair; - - typedef MaterialDensityPair MaterialDensityPair44; - typedef MaterialDensityPair MaterialDensityPair88; - - //////////////////////////////////////////////////////////////////////////////// - // Mesh - //////////////////////////////////////////////////////////////////////////////// - typedef uint32_t DefaultIndexType; - template class Mesh; - - //////////////////////////////////////////////////////////////////////////////// - // PagedVolume - //////////////////////////////////////////////////////////////////////////////// - template class PagedVolume; - template - using LargeVolume = PagedVolume; - template - using SimpleVolume = PagedVolume; - - //////////////////////////////////////////////////////////////////////////////// - // Pager - //////////////////////////////////////////////////////////////////////////////// - template class Pager; - - //////////////////////////////////////////////////////////////////////////////// - // RawVolume - //////////////////////////////////////////////////////////////////////////////// - template class RawVolume; - - //////////////////////////////////////////////////////////////////////////////// - // Region - //////////////////////////////////////////////////////////////////////////////// - class Region; - - //////////////////////////////////////////////////////////////////////////////// - // Vector - //////////////////////////////////////////////////////////////////////////////// - template class Vector; - - typedef Vector<2,float,float> Vector2DFloat; - typedef Vector<2,double,double> Vector2DDouble; - typedef Vector<2,int8_t,int32_t> Vector2DInt8; - typedef Vector<2,uint8_t,int32_t> Vector2DUint8; - typedef Vector<2,int16_t,int32_t> Vector2DInt16; - typedef Vector<2,uint16_t,int32_t> Vector2DUint16; - typedef Vector<2,int32_t,int32_t> Vector2DInt32; - typedef Vector<2,uint32_t,int32_t> Vector2DUint32; - - typedef Vector<3,float,float> Vector3DFloat; - typedef Vector<3,double,double> Vector3DDouble; - typedef Vector<3,int8_t,int32_t> Vector3DInt8; - typedef Vector<3,uint8_t,int32_t> Vector3DUint8; - typedef Vector<3,int16_t,int32_t> Vector3DInt16; - typedef Vector<3,uint16_t,int32_t> Vector3DUint16; - typedef Vector<3,int32_t,int32_t> Vector3DInt32; - typedef Vector<3,uint32_t,int32_t> Vector3DUint32; - - typedef Vector<4,float,float> Vector4DFloat; - typedef Vector<4,double,double> Vector4DDouble; - typedef Vector<4,int8_t,int32_t> Vector4DInt8; - typedef Vector<4,uint8_t,int32_t> Vector4DUint8; - typedef Vector<4,int16_t,int32_t> Vector4DInt16; - typedef Vector<4,uint16_t,int32_t> Vector4DUint16; - typedef Vector<4,int32_t,int32_t> Vector4DInt32; - typedef Vector<4,uint32_t,int32_t> Vector4DUint32; -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_ForwardDeclarations_H__ +#define __PolyVox_ForwardDeclarations_H__ + +#include "Impl/TypeDef.h" + +#include + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////// + // Array + //////////////////////////////////////////////////////////////////////////////// + /*template class Array; + + typedef Array<1,float> Array1DFloat; + typedef Array<1,double> Array1DDouble; + typedef Array<1,int8_t> Array1DInt8; + typedef Array<1,uint8_t> Array1DUint8; + typedef Array<1,int16_t> Array1DInt16; + typedef Array<1,uint16_t> Array1DUint16; + typedef Array<1,int32_t> Array1DInt32; + typedef Array<1,uint32_t> Array1DUint32;*/ + + /*typedef Array<2,float> Array2DFloat; + typedef Array<2,double> Array2DDouble; + typedef Array<2,int8_t> Array2DInt8; + typedef Array<2,uint8_t> Array2DUint8; + typedef Array<2,int16_t> Array2DInt16; + typedef Array<2,uint16_t> Array2DUint16; + typedef Array<2,int32_t> Array2DInt32; + typedef Array<2,uint32_t> Array2DUint32;*/ + + /*typedef Array<3,float> Array3DFloat; + typedef Array<3,double> Array3DDouble; + typedef Array<3,int8_t> Array3DInt8; + typedef Array<3,uint8_t> Array3DUint8; + typedef Array<3,int16_t> Array3DInt16; + typedef Array<3,uint16_t> Array3DUint16; + typedef Array<3,int32_t> Array3DInt32; + typedef Array<3,uint32_t> Array3DUint32;*/ + + //////////////////////////////////////////////////////////////////////////////// + // Compressor + //////////////////////////////////////////////////////////////////////////////// + class Compressor; + + //////////////////////////////////////////////////////////////////////////////// + // CubicSurfaceExtractor + //////////////////////////////////////////////////////////////////////////////// + template class DefaultIsQuadNeeded; + template > class CubicSurfaceExtractor; + + //////////////////////////////////////////////////////////////////////////////// + // CubicVertex + //////////////////////////////////////////////////////////////////////////////// + template struct CubicVertex; + + //////////////////////////////////////////////////////////////////////////////// + // Density + //////////////////////////////////////////////////////////////////////////////// + template class Density; + + typedef Density DensityI8; + typedef Density DensityU8; + typedef Density DensityI16; + typedef Density DensityU16; + typedef Density DensityFloat; + typedef Density DensityDouble; + + typedef DensityU8 Density8; //Backwards compatibility + typedef DensityU16 Density16; //Backwards compatibility + + //////////////////////////////////////////////////////////////////////////////// + // FilePager + //////////////////////////////////////////////////////////////////////////////// + template class FilePager; + + //////////////////////////////////////////////////////////////////////////////// + // MarchingCubesSurfaceExtractor + //////////////////////////////////////////////////////////////////////////////// + template class MarchingCubesSurfaceExtractor; + + //////////////////////////////////////////////////////////////////////////////// + // MarchingCubesVertex + //////////////////////////////////////////////////////////////////////////////// + template struct MarchingCubesVertex; + + //////////////////////////////////////////////////////////////////////////////// + // Material + //////////////////////////////////////////////////////////////////////////////// + template class Material; + + typedef Material MaterialU8; + typedef Material MaterialU16; + typedef Material MaterialU32; + + typedef MaterialU8 Material8; + typedef MaterialU16 Material16; + typedef MaterialU32 Material32; + + //////////////////////////////////////////////////////////////////////////////// + // MaterialDensityPair + //////////////////////////////////////////////////////////////////////////////// + template class MaterialDensityPair; + + typedef MaterialDensityPair MaterialDensityPair44; + typedef MaterialDensityPair MaterialDensityPair88; + + //////////////////////////////////////////////////////////////////////////////// + // Mesh + //////////////////////////////////////////////////////////////////////////////// + typedef uint32_t DefaultIndexType; + template class Mesh; + + //////////////////////////////////////////////////////////////////////////////// + // PagedVolume + //////////////////////////////////////////////////////////////////////////////// + template class PagedVolume; + template + using LargeVolume = PagedVolume; + template + using SimpleVolume = PagedVolume; + + //////////////////////////////////////////////////////////////////////////////// + // Pager + //////////////////////////////////////////////////////////////////////////////// + template class Pager; + + //////////////////////////////////////////////////////////////////////////////// + // RawVolume + //////////////////////////////////////////////////////////////////////////////// + template class RawVolume; + + //////////////////////////////////////////////////////////////////////////////// + // Region + //////////////////////////////////////////////////////////////////////////////// + class Region; + + //////////////////////////////////////////////////////////////////////////////// + // Vector + //////////////////////////////////////////////////////////////////////////////// + template class Vector; + + typedef Vector<2,float,float> Vector2DFloat; + typedef Vector<2,double,double> Vector2DDouble; + typedef Vector<2,int8_t,int32_t> Vector2DInt8; + typedef Vector<2,uint8_t,int32_t> Vector2DUint8; + typedef Vector<2,int16_t,int32_t> Vector2DInt16; + typedef Vector<2,uint16_t,int32_t> Vector2DUint16; + typedef Vector<2,int32_t,int32_t> Vector2DInt32; + typedef Vector<2,uint32_t,int32_t> Vector2DUint32; + + typedef Vector<3,float,float> Vector3DFloat; + typedef Vector<3,double,double> Vector3DDouble; + typedef Vector<3,int8_t,int32_t> Vector3DInt8; + typedef Vector<3,uint8_t,int32_t> Vector3DUint8; + typedef Vector<3,int16_t,int32_t> Vector3DInt16; + typedef Vector<3,uint16_t,int32_t> Vector3DUint16; + typedef Vector<3,int32_t,int32_t> Vector3DInt32; + typedef Vector<3,uint32_t,int32_t> Vector3DUint32; + + typedef Vector<4,float,float> Vector4DFloat; + typedef Vector<4,double,double> Vector4DDouble; + typedef Vector<4,int8_t,int32_t> Vector4DInt8; + typedef Vector<4,uint8_t,int32_t> Vector4DUint8; + typedef Vector<4,int16_t,int32_t> Vector4DInt16; + typedef Vector<4,uint16_t,int32_t> Vector4DUint16; + typedef Vector<4,int32_t,int32_t> Vector4DInt32; + typedef Vector<4,uint32_t,int32_t> Vector4DUint32; +} + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index 7c24e023..3201bb8a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -1,173 +1,173 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_RawVolume_H__ -#define __PolyVox_RawVolume_H__ - -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" - -#include //For abort() -#include -#include -#include //For invalid_argument - -namespace PolyVox -{ - template - class RawVolume : public BaseVolume - { - public: - #ifndef SWIG - //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. - //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but - //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler - //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated - //in the future - //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. - //class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume > -#if defined(_MSC_VER) - class Sampler : public BaseVolume::Sampler< RawVolume > //This line works on VS2010 -#else - class Sampler : public BaseVolume::template Sampler< RawVolume > //This line works on GCC -#endif - { - public: - Sampler(RawVolume* volume); - ~Sampler(); - - inline VoxelType getVoxel(void) const; - - void setPosition(const Vector3DInt32& v3dNewPos); - void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); - inline bool setVoxel(VoxelType tValue); - - void movePositiveX(void); - void movePositiveY(void); - void movePositiveZ(void); - - void moveNegativeX(void); - void moveNegativeY(void); - void moveNegativeZ(void); - - inline VoxelType peekVoxel1nx1ny1nz(void) const; - inline VoxelType peekVoxel1nx1ny0pz(void) const; - inline VoxelType peekVoxel1nx1ny1pz(void) const; - inline VoxelType peekVoxel1nx0py1nz(void) const; - inline VoxelType peekVoxel1nx0py0pz(void) const; - inline VoxelType peekVoxel1nx0py1pz(void) const; - inline VoxelType peekVoxel1nx1py1nz(void) const; - inline VoxelType peekVoxel1nx1py0pz(void) const; - inline VoxelType peekVoxel1nx1py1pz(void) const; - - inline VoxelType peekVoxel0px1ny1nz(void) const; - inline VoxelType peekVoxel0px1ny0pz(void) const; - inline VoxelType peekVoxel0px1ny1pz(void) const; - inline VoxelType peekVoxel0px0py1nz(void) const; - inline VoxelType peekVoxel0px0py0pz(void) const; - inline VoxelType peekVoxel0px0py1pz(void) const; - inline VoxelType peekVoxel0px1py1nz(void) const; - inline VoxelType peekVoxel0px1py0pz(void) const; - inline VoxelType peekVoxel0px1py1pz(void) const; - - inline VoxelType peekVoxel1px1ny1nz(void) const; - inline VoxelType peekVoxel1px1ny0pz(void) const; - inline VoxelType peekVoxel1px1ny1pz(void) const; - inline VoxelType peekVoxel1px0py1nz(void) const; - inline VoxelType peekVoxel1px0py0pz(void) const; - inline VoxelType peekVoxel1px0py1pz(void) const; - inline VoxelType peekVoxel1px1py1nz(void) const; - inline VoxelType peekVoxel1px1py0pz(void) const; - inline VoxelType peekVoxel1px1py1pz(void) const; - - private: - - //Other current position information - VoxelType* mCurrentVoxel; - }; - #endif - - public: - /// Constructor for creating a fixed size volume. - RawVolume(const Region& regValid); - - /// Destructor - ~RawVolume(); - - /// Gets a voxel at the position given by x,y,z coordinates - template - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - template - VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - /// Gets a voxel at the position given by a 3D vector - VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; - - /// Gets a voxel at the position given by x,y,z coordinates - POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - /// Gets a voxel at the position given by a 3D vector - POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; - - /// Sets the voxel at the position given by x,y,z coordinates - void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by a 3D vector - void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); - - /// Calculates approximatly how many bytes of memory the volume is currently using. - uint32_t calculateSizeInBytes(void); - - protected: - /// Copy constructor - RawVolume(const RawVolume& rhs); - - /// Assignment operator - RawVolume& operator=(const RawVolume& rhs); - - private: - void initialise(const Region& regValidRegion); - - // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 - template - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - - //The voxel data - VoxelType* m_pData; - }; -} - -#include "PolyVoxCore/RawVolume.inl" -#include "PolyVoxCore/RawVolumeSampler.inl" - -#endif //__PolyVox_RawVolume_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_RawVolume_H__ +#define __PolyVox_RawVolume_H__ + +#include "PolyVoxCore/BaseVolume.h" +#include "PolyVoxCore/Region.h" +#include "PolyVoxCore/Vector.h" + +#include //For abort() +#include +#include +#include //For invalid_argument + +namespace PolyVox +{ + template + class RawVolume : public BaseVolume + { + public: + #ifndef SWIG + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. + //class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume > +#if defined(_MSC_VER) + class Sampler : public BaseVolume::Sampler< RawVolume > //This line works on VS2010 +#else + class Sampler : public BaseVolume::template Sampler< RawVolume > //This line works on GCC +#endif + { + public: + Sampler(RawVolume* volume); + ~Sampler(); + + inline VoxelType getVoxel(void) const; + + void setPosition(const Vector3DInt32& v3dNewPos); + void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); + inline bool setVoxel(VoxelType tValue); + + void movePositiveX(void); + void movePositiveY(void); + void movePositiveZ(void); + + void moveNegativeX(void); + void moveNegativeY(void); + void moveNegativeZ(void); + + inline VoxelType peekVoxel1nx1ny1nz(void) const; + inline VoxelType peekVoxel1nx1ny0pz(void) const; + inline VoxelType peekVoxel1nx1ny1pz(void) const; + inline VoxelType peekVoxel1nx0py1nz(void) const; + inline VoxelType peekVoxel1nx0py0pz(void) const; + inline VoxelType peekVoxel1nx0py1pz(void) const; + inline VoxelType peekVoxel1nx1py1nz(void) const; + inline VoxelType peekVoxel1nx1py0pz(void) const; + inline VoxelType peekVoxel1nx1py1pz(void) const; + + inline VoxelType peekVoxel0px1ny1nz(void) const; + inline VoxelType peekVoxel0px1ny0pz(void) const; + inline VoxelType peekVoxel0px1ny1pz(void) const; + inline VoxelType peekVoxel0px0py1nz(void) const; + inline VoxelType peekVoxel0px0py0pz(void) const; + inline VoxelType peekVoxel0px0py1pz(void) const; + inline VoxelType peekVoxel0px1py1nz(void) const; + inline VoxelType peekVoxel0px1py0pz(void) const; + inline VoxelType peekVoxel0px1py1pz(void) const; + + inline VoxelType peekVoxel1px1ny1nz(void) const; + inline VoxelType peekVoxel1px1ny0pz(void) const; + inline VoxelType peekVoxel1px1ny1pz(void) const; + inline VoxelType peekVoxel1px0py1nz(void) const; + inline VoxelType peekVoxel1px0py0pz(void) const; + inline VoxelType peekVoxel1px0py1pz(void) const; + inline VoxelType peekVoxel1px1py1nz(void) const; + inline VoxelType peekVoxel1px1py0pz(void) const; + inline VoxelType peekVoxel1px1py1pz(void) const; + + private: + + //Other current position information + VoxelType* mCurrentVoxel; + }; + #endif + + public: + /// Constructor for creating a fixed size volume. + RawVolume(const Region& regValid); + + /// Destructor + ~RawVolume(); + + /// Gets a voxel at the position given by x,y,z coordinates + template + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + template + VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + /// Gets a voxel at the position given by a 3D vector + VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const; + + /// Gets a voxel at the position given by x,y,z coordinates + POLYVOX_DEPRECATED VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; + /// Gets a voxel at the position given by a 3D vector + POLYVOX_DEPRECATED VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const; + + /// Sets the voxel at the position given by x,y,z coordinates + void setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by a 3D vector + void setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode = WrapModes::Validate); + /// Sets the voxel at the position given by x,y,z coordinates + bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue); + /// Sets the voxel at the position given by a 3D vector + bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue); + + /// Calculates approximatly how many bytes of memory the volume is currently using. + uint32_t calculateSizeInBytes(void); + + protected: + /// Copy constructor + RawVolume(const RawVolume& rhs); + + /// Assignment operator + RawVolume& operator=(const RawVolume& rhs); + + private: + void initialise(const Region& regValidRegion); + + // A trick to implement specialization of template member functions in template classes. See http://stackoverflow.com/a/4951057 + template + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + + //The voxel data + VoxelType* m_pData; + }; +} + +#include "PolyVoxCore/RawVolume.inl" +#include "PolyVoxCore/RawVolumeSampler.inl" + +#endif //__PolyVox_RawVolume_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index 3505528b..3dd0ef5d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -1,390 +1,390 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - //////////////////////////////////////////////////////////////////////////////// - /// This constructor creates a volume with a fixed size which is specified as a parameter. - /// \param regValid Specifies the minimum and maximum valid voxel positions. - //////////////////////////////////////////////////////////////////////////////// - template - RawVolume::RawVolume(const Region& regValid) - :BaseVolume(regValid) - { - this->setBorderValue(VoxelType()); - - //Create a volume of the right size. - initialise(regValid); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the Volumeresampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - RawVolume::RawVolume(const RawVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Destroys the volume - //////////////////////////////////////////////////////////////////////////////// - template - RawVolume::~RawVolume() - { - delete[] m_pData; - m_pData = 0; - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing - /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to - /// make a copy of a volume and in this case you should look at the Volumeresampler. - /// - /// \sa VolumeResampler - //////////////////////////////////////////////////////////////////////////////// - template - RawVolume& RawVolume::operator=(const RawVolume& /*rhs*/) - { - POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType RawVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function requires the wrap mode to be specified as a - /// template parameter, which can provide better performance. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - template - VoxelType RawVolume::getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder) const - { - // Simply call through to the real implementation - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType RawVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode, VoxelType tBorder) const - { - switch(eWrapMode) - { - case WrapModes::Validate: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Clamp: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::Border: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - case WrapModes::AssumeValid: - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); - default: - // Should never happen - POLYVOX_ASSERT(false, "Invalid wrap mode"); - return VoxelType(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// This version of the function is provided so that the wrap mode does not need - /// to be specified as a template parameter, as it may be confusing to some users. - /// \param v3dPos The 3D position of the voxel - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// \param tBorder The border value to use if the wrap mode is set to 'Border'. - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType RawVolume::getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode, VoxelType tBorder) const - { - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos The \c x position of the voxel - /// \param uYPos The \c y position of the voxel - /// \param uZPos The \c z position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType RawVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); - int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); - int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); - int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); - - return m_pData - [ - iLocalXPos + - iLocalYPos * this->getWidth() + - iLocalZPos * this->getWidth() * this->getHeight() - ]; - } - else - { - return this->getBorderValue(); - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos The 3D position of the voxel - /// \return The voxel value - //////////////////////////////////////////////////////////////////////////////// - template - VoxelType RawVolume::getVoxelAt(const Vector3DInt32& v3dPos) const - { - return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void RawVolume::setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode) - { - if((eWrapMode != WrapModes::Validate) && (eWrapMode != WrapModes::AssumeValid)) - { - POLYVOX_THROW(std::invalid_argument, "Invalid wrap mode in call to setVoxel(). It must be 'None' or 'DontCheck'."); - } - - // This validation is skipped if the wrap mode is 'DontCheck' - if(eWrapMode == WrapModes::Validate) - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - } - - const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); - int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); - int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); - int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); - - m_pData - [ - iLocalXPos + - iLocalYPos * this->getWidth() + - iLocalZPos * this->getWidth() * this->getHeight() - ] = tValue; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. - /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. - //////////////////////////////////////////////////////////////////////////////// - template - void RawVolume::setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode) - { - setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param uXPos the \c x position of the voxel - /// \param uYPos the \c y position of the voxel - /// \param uZPos the \c z position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool RawVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); - int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); - int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); - int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); - - m_pData - [ - iLocalXPos + - iLocalYPos * this->getWidth() + - iLocalZPos * this->getWidth() * this->getHeight() - ] = tValue; - - //Return true to indicate that we modified a voxel. - return true; - } - else - { - return false; - } - } - - //////////////////////////////////////////////////////////////////////////////// - /// \param v3dPos the 3D position of the voxel - /// \param tValue the value to which the voxel will be set - /// \return whether the requested position is inside the volume - //////////////////////////////////////////////////////////////////////////////// - template - bool RawVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) - { - return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); - } - - //////////////////////////////////////////////////////////////////////////////// - /// This function should probably be made internal... - //////////////////////////////////////////////////////////////////////////////// - template - void RawVolume::initialise(const Region& regValidRegion) - { - this->m_regValidRegion = regValidRegion; - - if(this->getWidth() <= 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume width must be greater than zero."); - } - if(this->getHeight() <= 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume height must be greater than zero."); - } - if(this->getDepth() <= 0) - { - POLYVOX_THROW(std::invalid_argument, "Volume depth must be greater than zero."); - } - - //Create the data - m_pData = new VoxelType[this->getWidth() * this->getHeight()* this->getDepth()]; - - //Other properties we might find useful later - this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Note: This function needs reviewing for accuracy... - //////////////////////////////////////////////////////////////////////////////// - template - uint32_t RawVolume::calculateSizeInBytes(void) - { - return this->getWidth() * this->getHeight() * this->getDepth() * sizeof(VoxelType); - } - - template - template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - // This function should never be called because one of the specialisations should always match. - POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); - } - - template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - //Perform clamping - uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); - uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); - uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); - uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); - uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); - uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - - template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const - { - if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) - { - return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. - } - else - { - return tBorder; - } - } - - template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const - { - const Region& regValidRegion = this->m_regValidRegion; - int32_t iLocalXPos = uXPos - regValidRegion.getLowerX(); - int32_t iLocalYPos = uYPos - regValidRegion.getLowerY(); - int32_t iLocalZPos = uZPos - regValidRegion.getLowerZ(); - - return m_pData - [ - iLocalXPos + - iLocalYPos * this->getWidth() + - iLocalZPos * this->getWidth() * this->getHeight() - ]; - } -} - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + //////////////////////////////////////////////////////////////////////////////// + /// This constructor creates a volume with a fixed size which is specified as a parameter. + /// \param regValid Specifies the minimum and maximum valid voxel positions. + //////////////////////////////////////////////////////////////////////////////// + template + RawVolume::RawVolume(const Region& regValid) + :BaseVolume(regValid) + { + this->setBorderValue(VoxelType()); + + //Create a volume of the right size. + initialise(regValid); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the Volumeresampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + RawVolume::RawVolume(const RawVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Destroys the volume + //////////////////////////////////////////////////////////////////////////////// + template + RawVolume::~RawVolume() + { + delete[] m_pData; + m_pData = 0; + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing + /// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to + /// make a copy of a volume and in this case you should look at the Volumeresampler. + /// + /// \sa VolumeResampler + //////////////////////////////////////////////////////////////////////////////// + template + RawVolume& RawVolume::operator=(const RawVolume& /*rhs*/) + { + POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType RawVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const + { + // Simply call through to the real implementation + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function requires the wrap mode to be specified as a + /// template parameter, which can provide better performance. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \tparam eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + template + VoxelType RawVolume::getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder) const + { + // Simply call through to the real implementation + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType RawVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode, VoxelType tBorder) const + { + switch(eWrapMode) + { + case WrapModes::Validate: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::Clamp: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::Border: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + case WrapModes::AssumeValid: + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); + default: + // Should never happen + POLYVOX_ASSERT(false, "Invalid wrap mode"); + return VoxelType(); + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// This version of the function is provided so that the wrap mode does not need + /// to be specified as a template parameter, as it may be confusing to some users. + /// \param v3dPos The 3D position of the voxel + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// \param tBorder The border value to use if the wrap mode is set to 'Border'. + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType RawVolume::getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode, VoxelType tBorder) const + { + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos The \c x position of the voxel + /// \param uYPos The \c y position of the voxel + /// \param uZPos The \c z position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType RawVolume::getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) + { + const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); + int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); + int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); + int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); + + return m_pData + [ + iLocalXPos + + iLocalYPos * this->getWidth() + + iLocalZPos * this->getWidth() * this->getHeight() + ]; + } + else + { + return this->getBorderValue(); + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos The 3D position of the voxel + /// \return The voxel value + //////////////////////////////////////////////////////////////////////////////// + template + VoxelType RawVolume::getVoxelAt(const Vector3DInt32& v3dPos) const + { + return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. + //////////////////////////////////////////////////////////////////////////////// + template + void RawVolume::setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue, WrapMode eWrapMode) + { + if((eWrapMode != WrapModes::Validate) && (eWrapMode != WrapModes::AssumeValid)) + { + POLYVOX_THROW(std::invalid_argument, "Invalid wrap mode in call to setVoxel(). It must be 'None' or 'DontCheck'."); + } + + // This validation is skipped if the wrap mode is 'DontCheck' + if(eWrapMode == WrapModes::Validate) + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) + { + POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); + } + } + + const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); + int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); + int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); + int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); + + m_pData + [ + iLocalXPos + + iLocalYPos * this->getWidth() + + iLocalZPos * this->getWidth() * this->getHeight() + ] = tValue; + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \param eWrapMode Specifies the behaviour when the requested position is outside of the volume. + /// This must be set to 'None' or 'DontCheck'. Other wrap modes cannot be used when writing to volume data. + //////////////////////////////////////////////////////////////////////////////// + template + void RawVolume::setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue, WrapMode eWrapMode) + { + setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue, eWrapMode); + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param uXPos the \c x position of the voxel + /// \param uYPos the \c y position of the voxel + /// \param uZPos the \c z position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool RawVolume::setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) + { + const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); + int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); + int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); + int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); + + m_pData + [ + iLocalXPos + + iLocalYPos * this->getWidth() + + iLocalZPos * this->getWidth() * this->getHeight() + ] = tValue; + + //Return true to indicate that we modified a voxel. + return true; + } + else + { + return false; + } + } + + //////////////////////////////////////////////////////////////////////////////// + /// \param v3dPos the 3D position of the voxel + /// \param tValue the value to which the voxel will be set + /// \return whether the requested position is inside the volume + //////////////////////////////////////////////////////////////////////////////// + template + bool RawVolume::setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) + { + return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); + } + + //////////////////////////////////////////////////////////////////////////////// + /// This function should probably be made internal... + //////////////////////////////////////////////////////////////////////////////// + template + void RawVolume::initialise(const Region& regValidRegion) + { + this->m_regValidRegion = regValidRegion; + + if(this->getWidth() <= 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume width must be greater than zero."); + } + if(this->getHeight() <= 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume height must be greater than zero."); + } + if(this->getDepth() <= 0) + { + POLYVOX_THROW(std::invalid_argument, "Volume depth must be greater than zero."); + } + + //Create the data + m_pData = new VoxelType[this->getWidth() * this->getHeight()* this->getDepth()]; + + //Other properties we might find useful later + this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); + this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); + this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); + } + + //////////////////////////////////////////////////////////////////////////////// + /// Note: This function needs reviewing for accuracy... + //////////////////////////////////////////////////////////////////////////////// + template + uint32_t RawVolume::calculateSizeInBytes(void) + { + return this->getWidth() * this->getHeight() * this->getDepth() * sizeof(VoxelType); + } + + template + template + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + // This function should never be called because one of the specialisations should always match. + POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); + } + + template + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) + { + POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); + } + + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + + template + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + //Perform clamping + uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); + uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); + uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); + uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); + uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); + uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); + + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + + template + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const + { + if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) + { + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No wrapping as we've just validated the position. + } + else + { + return tBorder; + } + } + + template + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType /*tBorder*/) const + { + const Region& regValidRegion = this->m_regValidRegion; + int32_t iLocalXPos = uXPos - regValidRegion.getLowerX(); + int32_t iLocalYPos = uYPos - regValidRegion.getLowerY(); + int32_t iLocalZPos = uZPos - regValidRegion.getLowerZ(); + + return m_pData + [ + iLocalXPos + + iLocalYPos * this->getWidth() + + iLocalZPos * this->getWidth() * this->getHeight() + ]; + } +} + diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl index 7460c19c..9da44077 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl @@ -1,505 +1,505 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#define CAN_GO_NEG_X(val) (val > this->mVolume->getEnclosingRegion().getLowerX()) -#define CAN_GO_POS_X(val) (val < this->mVolume->getEnclosingRegion().getUpperX()) -#define CAN_GO_NEG_Y(val) (val > this->mVolume->getEnclosingRegion().getLowerY()) -#define CAN_GO_POS_Y(val) (val < this->mVolume->getEnclosingRegion().getUpperY()) -#define CAN_GO_NEG_Z(val) (val > this->mVolume->getEnclosingRegion().getLowerZ()) -#define CAN_GO_POS_Z(val) (val < this->mVolume->getEnclosingRegion().getUpperZ()) - -namespace PolyVox -{ - template - RawVolume::Sampler::Sampler(RawVolume* volume) - :BaseVolume::template Sampler< RawVolume >(volume) - ,mCurrentVoxel(0) - { - } - - template - RawVolume::Sampler::~Sampler() - { - } - - template - VoxelType RawVolume::Sampler::getVoxel(void) const - { - if(this->isCurrentPositionValid()) - { - return *mCurrentVoxel; - } - else - { - return this->getVoxelImpl(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) - { - setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); - } - - template - void RawVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) - { - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::setPosition(xPos, yPos, zPos); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid()) - { - const Vector3DInt32& v3dLowerCorner = this->mVolume->m_regValidRegion.getLowerCorner(); - int32_t iLocalXPos = xPos - v3dLowerCorner.getX(); - int32_t iLocalYPos = yPos - v3dLowerCorner.getY(); - int32_t iLocalZPos = zPos - v3dLowerCorner.getZ(); - - const int32_t uVoxelIndex = iLocalXPos + - iLocalYPos * this->mVolume->getWidth() + - iLocalZPos * this->mVolume->getWidth() * this->mVolume->getHeight(); - - mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex; - } - else - { - mCurrentVoxel = 0; - } - } - - template - bool RawVolume::Sampler::setVoxel(VoxelType tValue) - { - //return m_bIsCurrentPositionValid ? *mCurrentVoxel : this->mVolume->getBorderValue(); - if(this->m_bIsCurrentPositionValidInX && this->m_bIsCurrentPositionValidInY && this->m_bIsCurrentPositionValidInZ) - { - *mCurrentVoxel = tValue; - return true; - } - else - { - return false; - } - } - - template - void RawVolume::Sampler::movePositiveX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::movePositiveX(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - ++mCurrentVoxel; - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::movePositiveY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::movePositiveY(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - mCurrentVoxel += this->mVolume->getWidth(); - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::movePositiveZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::movePositiveZ(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - mCurrentVoxel += this->mVolume->getWidth() * this->mVolume->getHeight(); - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::moveNegativeX(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::moveNegativeX(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - --mCurrentVoxel; - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::moveNegativeY(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::moveNegativeY(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - mCurrentVoxel -= this->mVolume->getWidth(); - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - void RawVolume::Sampler::moveNegativeZ(void) - { - // We'll need this in a moment... - bool bIsOldPositionValid = this->isCurrentPositionValid(); - - // Base version updates position and validity flags. - BaseVolume::template Sampler< RawVolume >::moveNegativeZ(); - - // Then we update the voxel pointer - if(this->isCurrentPositionValid() && bIsOldPositionValid ) - { - mCurrentVoxel -= this->mVolume->getWidth() * this->mVolume->getHeight(); - } - else - { - setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); - } - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel - 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1nx1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType RawVolume::Sampler::peekVoxel0px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px0py0pz(void) const - { - if((this->isCurrentPositionValid())) - { - return *mCurrentVoxel; - } - return this->mVolume->getVoxel(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel0px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - ////////////////////////////////////////////////////////////////////////// - - template - VoxelType RawVolume::Sampler::peekVoxel1px1ny1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px1ny0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px1ny1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px0py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px0py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) ) - { - return *(mCurrentVoxel + 1); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px0py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px1py1nz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px1py0pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->getWidth()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); - } - - template - VoxelType RawVolume::Sampler::peekVoxel1px1py1pz(void) const - { - if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) - { - return *(mCurrentVoxel + 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); - } - return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); - } -} - -#undef CAN_GO_NEG_X -#undef CAN_GO_POS_X -#undef CAN_GO_NEG_Y -#undef CAN_GO_POS_Y -#undef CAN_GO_NEG_Z -#undef CAN_GO_POS_Z +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#define CAN_GO_NEG_X(val) (val > this->mVolume->getEnclosingRegion().getLowerX()) +#define CAN_GO_POS_X(val) (val < this->mVolume->getEnclosingRegion().getUpperX()) +#define CAN_GO_NEG_Y(val) (val > this->mVolume->getEnclosingRegion().getLowerY()) +#define CAN_GO_POS_Y(val) (val < this->mVolume->getEnclosingRegion().getUpperY()) +#define CAN_GO_NEG_Z(val) (val > this->mVolume->getEnclosingRegion().getLowerZ()) +#define CAN_GO_POS_Z(val) (val < this->mVolume->getEnclosingRegion().getUpperZ()) + +namespace PolyVox +{ + template + RawVolume::Sampler::Sampler(RawVolume* volume) + :BaseVolume::template Sampler< RawVolume >(volume) + ,mCurrentVoxel(0) + { + } + + template + RawVolume::Sampler::~Sampler() + { + } + + template + VoxelType RawVolume::Sampler::getVoxel(void) const + { + if(this->isCurrentPositionValid()) + { + return *mCurrentVoxel; + } + else + { + return this->getVoxelImpl(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) + { + setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); + } + + template + void RawVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) + { + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::setPosition(xPos, yPos, zPos); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid()) + { + const Vector3DInt32& v3dLowerCorner = this->mVolume->m_regValidRegion.getLowerCorner(); + int32_t iLocalXPos = xPos - v3dLowerCorner.getX(); + int32_t iLocalYPos = yPos - v3dLowerCorner.getY(); + int32_t iLocalZPos = zPos - v3dLowerCorner.getZ(); + + const int32_t uVoxelIndex = iLocalXPos + + iLocalYPos * this->mVolume->getWidth() + + iLocalZPos * this->mVolume->getWidth() * this->mVolume->getHeight(); + + mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex; + } + else + { + mCurrentVoxel = 0; + } + } + + template + bool RawVolume::Sampler::setVoxel(VoxelType tValue) + { + //return m_bIsCurrentPositionValid ? *mCurrentVoxel : this->mVolume->getBorderValue(); + if(this->m_bIsCurrentPositionValidInX && this->m_bIsCurrentPositionValidInY && this->m_bIsCurrentPositionValidInZ) + { + *mCurrentVoxel = tValue; + return true; + } + else + { + return false; + } + } + + template + void RawVolume::Sampler::movePositiveX(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::movePositiveX(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + ++mCurrentVoxel; + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::movePositiveY(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::movePositiveY(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + mCurrentVoxel += this->mVolume->getWidth(); + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::movePositiveZ(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::movePositiveZ(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + mCurrentVoxel += this->mVolume->getWidth() * this->mVolume->getHeight(); + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::moveNegativeX(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::moveNegativeX(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + --mCurrentVoxel; + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::moveNegativeY(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::moveNegativeY(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + mCurrentVoxel -= this->mVolume->getWidth(); + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + void RawVolume::Sampler::moveNegativeZ(void) + { + // We'll need this in a moment... + bool bIsOldPositionValid = this->isCurrentPositionValid(); + + // Base version updates position and validity flags. + BaseVolume::template Sampler< RawVolume >::moveNegativeZ(); + + // Then we update the voxel pointer + if(this->isCurrentPositionValid() && bIsOldPositionValid ) + { + mCurrentVoxel -= this->mVolume->getWidth() * this->mVolume->getHeight(); + } + else + { + setPosition(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume); + } + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx0py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) ) + { + return *(mCurrentVoxel - 1); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1nx1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + ////////////////////////////////////////////////////////////////////////// + + template + VoxelType RawVolume::Sampler::peekVoxel0px1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px0py0pz(void) const + { + if((this->isCurrentPositionValid())) + { + return *mCurrentVoxel; + } + return this->mVolume->getVoxel(this->mXPosInVolume, this->mYPosInVolume, this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel0px1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + ////////////////////////////////////////////////////////////////////////// + + template + VoxelType RawVolume::Sampler::peekVoxel1px1ny1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px1ny0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px1ny1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px0py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px0py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) ) + { + return *(mCurrentVoxel + 1); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px0py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px1py1nz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_NEG_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px1py0pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->getWidth()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume,this->m_eWrapMode, this->m_tBorder); + } + + template + VoxelType RawVolume::Sampler::peekVoxel1px1py1pz(void) const + { + if((this->isCurrentPositionValid()) && CAN_GO_POS_X(this->mXPosInVolume) && CAN_GO_POS_Y(this->mYPosInVolume) && CAN_GO_POS_Z(this->mZPosInVolume) ) + { + return *(mCurrentVoxel + 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight()); + } + return this->mVolume->getVoxel(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1,this->m_eWrapMode, this->m_tBorder); + } +} + +#undef CAN_GO_NEG_X +#undef CAN_GO_POS_X +#undef CAN_GO_NEG_Y +#undef CAN_GO_POS_Y +#undef CAN_GO_NEG_Z +#undef CAN_GO_POS_Z diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h index 104792c2..3adb28c4 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h @@ -1,103 +1,103 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Raycast_H__ -#define __PolyVox_Raycast_H__ - -#include "PolyVoxCore/Vector.h" - -namespace PolyVox -{ - namespace RaycastResults - { - /** - * The results of a raycast - */ - enum RaycastResult - { - Completed, ///< If the ray passed through the volume without being interupted - Interupted ///< If the ray was interupted while travelling - }; - } - typedef RaycastResults::RaycastResult RaycastResult; - - /// OUT OF DATE SINCE UNCLASSING - //////////////////////////////////////////////////////////////////////////////// - /// \file Raycast.h - /// - /// The principle behind raycasting is to fire a 'ray' through the volume and determine - /// what (if anything) that ray hits. This simple test can be used for the purpose of - /// picking, visibility checks, lighting calculations, or numerous other applications. - /// - /// A ray is a stright line in space define by a start point and a direction vector. - /// The length of the direction vector represents the length of the ray. When you call a - /// Raycast object's execute() method it will iterate over each voxel which lies on the ray, - /// starting from the defined start point. It will examine each voxel and terminate - /// either when it encounters a solid voxel or when it reaches the end of the ray. If a - /// solid voxel is encountered then its position is stored in the intersectionVoxel field - /// of the RaycastResult structure and the intersectionFound flag is set to true, otherwise - /// the intersectionFound flag is set to false. - /// - /// **Important Note:** These has been confusion in the past with people not realising - /// that the length of the direction vector is important. Most graphics API can provide - /// a camera position and view direction for picking purposes, but the view direction is - /// usually normalised (i.e. of length one). If you use this view direction directly you - /// will only iterate over a single voxel and won't find what you are looking for. Instead - /// you must scale the direction vector so that it's length represents the maximum distance - /// over which you want the ray to be cast. - /// - /// The following code snippet shows how the class is used: - /// \code - /// Vector3DFloat start(rayOrigin.x(), rayOrigin.y(), rayOrigin.z()); - /// Vector3DFloat direction(rayDir.x(), rayDir.y(), rayDir.z()); - /// direction.normalise(); - /// direction *= 1000.0f; //Casts ray of length 1000 - /// - /// RaycastResult raycastResult; - /// Raycast raycast(m_pPolyVoxVolume, start, direction, raycastResult); - /// raycast.execute(); - /// - /// if(raycastResult.foundIntersection) - /// { - /// //... - /// } - /// \endcode - /// - /// Some further notes, the Raycast uses full 26-connectivity, which basically means it - /// will examine every voxel the ray touches, even if it just passes through the corner. - /// Also, it peforms a simple binary test against a voxel's threshold, rather than making - /// use of it's density. Therefore it will work best in conjunction with one of the 'cubic' - /// surace extractors. It's behaviour with the Marching Cubes surface extractor has not - /// been tested yet. - //////////////////////////////////////////////////////////////////////////////// - - template - RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback); - - template - RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback); -} - -#include "PolyVoxCore/Raycast.inl" - -#endif //__PolyVox_Raycast_H__ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Raycast_H__ +#define __PolyVox_Raycast_H__ + +#include "PolyVoxCore/Vector.h" + +namespace PolyVox +{ + namespace RaycastResults + { + /** + * The results of a raycast + */ + enum RaycastResult + { + Completed, ///< If the ray passed through the volume without being interupted + Interupted ///< If the ray was interupted while travelling + }; + } + typedef RaycastResults::RaycastResult RaycastResult; + + /// OUT OF DATE SINCE UNCLASSING + //////////////////////////////////////////////////////////////////////////////// + /// \file Raycast.h + /// + /// The principle behind raycasting is to fire a 'ray' through the volume and determine + /// what (if anything) that ray hits. This simple test can be used for the purpose of + /// picking, visibility checks, lighting calculations, or numerous other applications. + /// + /// A ray is a stright line in space define by a start point and a direction vector. + /// The length of the direction vector represents the length of the ray. When you call a + /// Raycast object's execute() method it will iterate over each voxel which lies on the ray, + /// starting from the defined start point. It will examine each voxel and terminate + /// either when it encounters a solid voxel or when it reaches the end of the ray. If a + /// solid voxel is encountered then its position is stored in the intersectionVoxel field + /// of the RaycastResult structure and the intersectionFound flag is set to true, otherwise + /// the intersectionFound flag is set to false. + /// + /// **Important Note:** These has been confusion in the past with people not realising + /// that the length of the direction vector is important. Most graphics API can provide + /// a camera position and view direction for picking purposes, but the view direction is + /// usually normalised (i.e. of length one). If you use this view direction directly you + /// will only iterate over a single voxel and won't find what you are looking for. Instead + /// you must scale the direction vector so that it's length represents the maximum distance + /// over which you want the ray to be cast. + /// + /// The following code snippet shows how the class is used: + /// \code + /// Vector3DFloat start(rayOrigin.x(), rayOrigin.y(), rayOrigin.z()); + /// Vector3DFloat direction(rayDir.x(), rayDir.y(), rayDir.z()); + /// direction.normalise(); + /// direction *= 1000.0f; //Casts ray of length 1000 + /// + /// RaycastResult raycastResult; + /// Raycast raycast(m_pPolyVoxVolume, start, direction, raycastResult); + /// raycast.execute(); + /// + /// if(raycastResult.foundIntersection) + /// { + /// //... + /// } + /// \endcode + /// + /// Some further notes, the Raycast uses full 26-connectivity, which basically means it + /// will examine every voxel the ray touches, even if it just passes through the corner. + /// Also, it peforms a simple binary test against a voxel's threshold, rather than making + /// use of it's density. Therefore it will work best in conjunction with one of the 'cubic' + /// surace extractors. It's behaviour with the Marching Cubes surface extractor has not + /// been tested yet. + //////////////////////////////////////////////////////////////////////////////// + + template + RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback); + + template + RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback); +} + +#include "PolyVoxCore/Raycast.inl" + +#endif //__PolyVox_Raycast_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl index 8c4b66bb..89d5bf63 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl @@ -1,178 +1,178 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - // This function is based on Christer Ericson's code and description of the 'Uniform Grid Intersection Test' in - // 'Real Time Collision Detection'. The following information from the errata on the book website is also relevent: - // - // pages 326-327. In the function VisitCellsOverlapped() the two lines calculating tx and ty are incorrect. - // The less-than sign in each line should be a greater-than sign. That is, the two lines should read: - // - // float tx = ((x1 > x2) ? (x1 - minx) : (maxx - x1)) / Abs(x2 - x1); - // float ty = ((y1 > y2) ? (y1 - miny) : (maxy - y1)) / Abs(y2 - y1); - // - // Thanks to Jetro Lauha of Fathammer in Helsinki, Finland for reporting this error. - // - // Jetro also points out that the computations of i, j, iend, and jend are incorrectly rounded if the line - // coordinates are allowed to go negative. While that was not really the intent of the code -- that is, I - // assumed grids to be numbered from (0, 0) to (m, n) -- I'm at fault for not making my assumption clear. - // Where it is important to handle negative line coordinates the computation of these variables should be - // changed to something like this: - // - // // Determine start grid cell coordinates (i, j) - // int i = (int)floorf(x1 / CELL_SIDE); - // int j = (int)floorf(y1 / CELL_SIDE); - // - // // Determine end grid cell coordinates (iend, jend) - // int iend = (int)floorf(x2 / CELL_SIDE); - // int jend = (int)floorf(y2 / CELL_SIDE); - // - // page 328. The if-statement that reads "if (ty <= tx && ty <= tz)" has a superfluous condition. - // It should simply read "if (ty <= tz)". - // - // This error was reported by Joey Hammer (PixelActive). - - /** - * Cast a ray through a volume by specifying the start and end positions - * - * The ray will move from \a v3dStart to \a v3dEnd, calling \a callback for each - * voxel it passes through until \a callback returns \a false. In this case it - * returns a RaycastResults::Interupted. If it passes from start to end - * without \a callback returning \a false, it returns RaycastResults::Completed. - * - * \param volData The volume to pass the ray though - * \param v3dStart The start position in the volume - * \param v3dEnd The end position in the volume - * \param callback The callback to call for each voxel - * - * \return A RaycastResults designating whether the ray hit anything or not - */ - template - RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback) - { - typename VolumeType::Sampler sampler(volData); - - //The doRaycast function is assuming that it is iterating over the areas defined between - //voxels. We actually want to define the areas as being centered on voxels (as this is - //what the CubicSurfaceExtractor generates). We add 0.5 here to adjust for this. - const float x1 = v3dStart.getX() + 0.5f; - const float y1 = v3dStart.getY() + 0.5f; - const float z1 = v3dStart.getZ() + 0.5f; - const float x2 = v3dEnd.getX() + 0.5f; - const float y2 = v3dEnd.getY() + 0.5f; - const float z2 = v3dEnd.getZ() + 0.5f; - - int i = (int)floorf(x1); - int j = (int)floorf(y1); - int k = (int)floorf(z1); - - const int iend = (int)floorf(x2); - const int jend = (int)floorf(y2); - const int kend = (int)floorf(z2); - - const int di = ((x1 < x2) ? 1 : ((x1 > x2) ? -1 : 0)); - const int dj = ((y1 < y2) ? 1 : ((y1 > y2) ? -1 : 0)); - const int dk = ((z1 < z2) ? 1 : ((z1 > z2) ? -1 : 0)); - - const float deltatx = 1.0f / std::abs(x2 - x1); - const float deltaty = 1.0f / std::abs(y2 - y1); - const float deltatz = 1.0f / std::abs(z2 - z1); - - const float minx = floorf(x1), maxx = minx + 1.0f; - float tx = ((x1 > x2) ? (x1 - minx) : (maxx - x1)) * deltatx; - const float miny = floorf(y1), maxy = miny + 1.0f; - float ty = ((y1 > y2) ? (y1 - miny) : (maxy - y1)) * deltaty; - const float minz = floorf(z1), maxz = minz + 1.0f; - float tz = ((z1 > z2) ? (z1 - minz) : (maxz - z1)) * deltatz; - - sampler.setPosition(i,j,k); - - for(;;) - { - if(!callback(sampler)) - { - return RaycastResults::Interupted; - } - - if(tx <= ty && tx <= tz) - { - if(i == iend) break; - tx += deltatx; - i += di; - - if(di == 1) sampler.movePositiveX(); - if(di == -1) sampler.moveNegativeX(); - } else if (ty <= tz) - { - if(j == jend) break; - ty += deltaty; - j += dj; - - if(dj == 1) sampler.movePositiveY(); - if(dj == -1) sampler.moveNegativeY(); - } else - { - if(k == kend) break; - tz += deltatz; - k += dk; - - if(dk == 1) sampler.movePositiveZ(); - if(dk == -1) sampler.moveNegativeZ(); - } - } - - return RaycastResults::Completed; - } - - /** - * Cast a ray through a volume by specifying the start and a direction - * - * The ray will move from \a v3dStart along \a v3dDirectionAndLength, calling - * \a callback for each voxel it passes through until \a callback returns - * \a false. In this case it returns a RaycastResults::Interupted. If it - * passes from start to end without \a callback returning \a false, it - * returns RaycastResults::Completed. - * - * \note These has been confusion in the past with people not realising - * that the length of the direction vector is important. Most graphics API can provide - * a camera position and view direction for picking purposes, but the view direction is - * usually normalised (i.e. of length one). If you use this view direction directly you - * will only iterate over a single voxel and won't find what you are looking for. Instead - * you must scale the direction vector so that it's length represents the maximum distance - * over which you want the ray to be cast. - * - * \param volData The volume to pass the ray though - * \param v3dStart The start position in the volume - * \param v3dDirectionAndLength The direction and length of the ray - * \param callback The callback to call for each voxel - * - * \return A RaycastResults designating whether the ray hit anything or not - */ - template - RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback) - { - Vector3DFloat v3dEnd = v3dStart + v3dDirectionAndLength; - return raycastWithEndpoints(volData, v3dStart, v3dEnd, callback); - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + // This function is based on Christer Ericson's code and description of the 'Uniform Grid Intersection Test' in + // 'Real Time Collision Detection'. The following information from the errata on the book website is also relevent: + // + // pages 326-327. In the function VisitCellsOverlapped() the two lines calculating tx and ty are incorrect. + // The less-than sign in each line should be a greater-than sign. That is, the two lines should read: + // + // float tx = ((x1 > x2) ? (x1 - minx) : (maxx - x1)) / Abs(x2 - x1); + // float ty = ((y1 > y2) ? (y1 - miny) : (maxy - y1)) / Abs(y2 - y1); + // + // Thanks to Jetro Lauha of Fathammer in Helsinki, Finland for reporting this error. + // + // Jetro also points out that the computations of i, j, iend, and jend are incorrectly rounded if the line + // coordinates are allowed to go negative. While that was not really the intent of the code -- that is, I + // assumed grids to be numbered from (0, 0) to (m, n) -- I'm at fault for not making my assumption clear. + // Where it is important to handle negative line coordinates the computation of these variables should be + // changed to something like this: + // + // // Determine start grid cell coordinates (i, j) + // int i = (int)floorf(x1 / CELL_SIDE); + // int j = (int)floorf(y1 / CELL_SIDE); + // + // // Determine end grid cell coordinates (iend, jend) + // int iend = (int)floorf(x2 / CELL_SIDE); + // int jend = (int)floorf(y2 / CELL_SIDE); + // + // page 328. The if-statement that reads "if (ty <= tx && ty <= tz)" has a superfluous condition. + // It should simply read "if (ty <= tz)". + // + // This error was reported by Joey Hammer (PixelActive). + + /** + * Cast a ray through a volume by specifying the start and end positions + * + * The ray will move from \a v3dStart to \a v3dEnd, calling \a callback for each + * voxel it passes through until \a callback returns \a false. In this case it + * returns a RaycastResults::Interupted. If it passes from start to end + * without \a callback returning \a false, it returns RaycastResults::Completed. + * + * \param volData The volume to pass the ray though + * \param v3dStart The start position in the volume + * \param v3dEnd The end position in the volume + * \param callback The callback to call for each voxel + * + * \return A RaycastResults designating whether the ray hit anything or not + */ + template + RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback) + { + typename VolumeType::Sampler sampler(volData); + + //The doRaycast function is assuming that it is iterating over the areas defined between + //voxels. We actually want to define the areas as being centered on voxels (as this is + //what the CubicSurfaceExtractor generates). We add 0.5 here to adjust for this. + const float x1 = v3dStart.getX() + 0.5f; + const float y1 = v3dStart.getY() + 0.5f; + const float z1 = v3dStart.getZ() + 0.5f; + const float x2 = v3dEnd.getX() + 0.5f; + const float y2 = v3dEnd.getY() + 0.5f; + const float z2 = v3dEnd.getZ() + 0.5f; + + int i = (int)floorf(x1); + int j = (int)floorf(y1); + int k = (int)floorf(z1); + + const int iend = (int)floorf(x2); + const int jend = (int)floorf(y2); + const int kend = (int)floorf(z2); + + const int di = ((x1 < x2) ? 1 : ((x1 > x2) ? -1 : 0)); + const int dj = ((y1 < y2) ? 1 : ((y1 > y2) ? -1 : 0)); + const int dk = ((z1 < z2) ? 1 : ((z1 > z2) ? -1 : 0)); + + const float deltatx = 1.0f / std::abs(x2 - x1); + const float deltaty = 1.0f / std::abs(y2 - y1); + const float deltatz = 1.0f / std::abs(z2 - z1); + + const float minx = floorf(x1), maxx = minx + 1.0f; + float tx = ((x1 > x2) ? (x1 - minx) : (maxx - x1)) * deltatx; + const float miny = floorf(y1), maxy = miny + 1.0f; + float ty = ((y1 > y2) ? (y1 - miny) : (maxy - y1)) * deltaty; + const float minz = floorf(z1), maxz = minz + 1.0f; + float tz = ((z1 > z2) ? (z1 - minz) : (maxz - z1)) * deltatz; + + sampler.setPosition(i,j,k); + + for(;;) + { + if(!callback(sampler)) + { + return RaycastResults::Interupted; + } + + if(tx <= ty && tx <= tz) + { + if(i == iend) break; + tx += deltatx; + i += di; + + if(di == 1) sampler.movePositiveX(); + if(di == -1) sampler.moveNegativeX(); + } else if (ty <= tz) + { + if(j == jend) break; + ty += deltaty; + j += dj; + + if(dj == 1) sampler.movePositiveY(); + if(dj == -1) sampler.moveNegativeY(); + } else + { + if(k == kend) break; + tz += deltatz; + k += dk; + + if(dk == 1) sampler.movePositiveZ(); + if(dk == -1) sampler.moveNegativeZ(); + } + } + + return RaycastResults::Completed; + } + + /** + * Cast a ray through a volume by specifying the start and a direction + * + * The ray will move from \a v3dStart along \a v3dDirectionAndLength, calling + * \a callback for each voxel it passes through until \a callback returns + * \a false. In this case it returns a RaycastResults::Interupted. If it + * passes from start to end without \a callback returning \a false, it + * returns RaycastResults::Completed. + * + * \note These has been confusion in the past with people not realising + * that the length of the direction vector is important. Most graphics API can provide + * a camera position and view direction for picking purposes, but the view direction is + * usually normalised (i.e. of length one). If you use this view direction directly you + * will only iterate over a single voxel and won't find what you are looking for. Instead + * you must scale the direction vector so that it's length represents the maximum distance + * over which you want the ray to be cast. + * + * \param volData The volume to pass the ray though + * \param v3dStart The start position in the volume + * \param v3dDirectionAndLength The direction and length of the ray + * \param callback The callback to call for each voxel + * + * \return A RaycastResults designating whether the ray hit anything or not + */ + template + RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback) + { + Vector3DFloat v3dEnd = v3dStart + v3dDirectionAndLength; + return raycastWithEndpoints(volData, v3dStart, v3dEnd, callback); + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 8d654cd0..2e8d113b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -1,461 +1,461 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Region_H__ -#define __PolyVox_Region_H__ - -#include "Impl/TypeDef.h" - -#include "PolyVoxCore/Vector.h" - -namespace PolyVox -{ - /** Represents a part of a Volume. - * - * Many operations in PolyVox are constrained to only part of a volume. For example, when running the surface extractors - * it is unlikely that you will want to run it on the whole volume at once, as this will give a very large mesh which may - * be too much to render. Instead you will probably want to run a surface extractor a number of times on different parts - * of the volume, there by giving a number of meshes which can be culled and rendered seperately. - * - * The Region class is used to define these parts (regions) of the volume. Essentially it consists of an upper and lower - * bound which specify the range of voxels positions considered to be part of the region. Note that these bounds are - * inclusive. - * - * As well as the expected set of getters and setters, this class also provide utility functions for increasing and decresing - * the size of the Region, shifting the Region in 3D space, testing whether it contains a given position, enlarging it so that - * it does contain a given position, croppng it to another Region, and various other utility functions. - * - * \Note The dimensions of a region can be measured either in voxels or in cells. See the manual for more information - * about these definitions. - * - */ -#ifdef SWIG - class Region -#else - class POLYVOX_API Region -#endif - { - public: - - /// A Region with the lower corner set as low as possible and the upper corner set as high as possible. - static const Region MaxRegion; - /// A Region with the lower corner set as high as possible and the upper corner set as low as possible. - static const Region InvertedRegion; - - /// Constructor - Region(); - /// Constructor - Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner); - /// Constructor - Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ); - - /// Equality Operator. - bool operator==(const Region& rhs) const; - /// Inequality Operator. - bool operator!=(const Region& rhs) const; - - /// Gets the 'x' position of the centre. - int32_t getCentreX(void) const; - /// Gets the 'y' position of the centre. - int32_t getCentreY(void) const; - /// Gets the 'z' position of the centrer. - int32_t getCentreZ(void) const; - /// Gets the 'x' position of the lower corner. - int32_t getLowerX(void) const; - /// Gets the 'y' position of the lower corner. - int32_t getLowerY(void) const; - /// Gets the 'z' position of the lower corner. - int32_t getLowerZ(void) const; - /// Gets the 'x' position of the upper corner. - int32_t getUpperX(void) const; - /// Gets the 'y' position of the upper corner. - int32_t getUpperY(void) const; - /// Gets the 'z' position of the upper corner. - int32_t getUpperZ(void) const; - - /// Gets the centre of the region - Vector3DInt32 getCentre(void) const; - /// Gets the position of the lower corner. - Vector3DInt32 getLowerCorner(void) const; - /// Gets the position of the upper corner. - Vector3DInt32 getUpperCorner(void) const; - - /// Gets the width of the region measured in voxels. - int32_t getWidthInVoxels(void) const; - /// Gets the height of the region measured in voxels. - int32_t getHeightInVoxels(void) const; - /// Gets the depth of the region measured in voxels. - int32_t getDepthInVoxels(void) const; - /// Gets the dimensions of the region measured in voxels. - Vector3DInt32 getDimensionsInVoxels(void) const; - - /// Gets the width of the region measured in cells. - int32_t getWidthInCells(void) const; - /// Gets the height of the region measured in cells. - int32_t getHeightInCells(void) const; - /// Gets the depth of the region measured in cells. - int32_t getDepthInCells(void) const; - /// Gets the dimensions of the region measured in cells. - Vector3DInt32 getDimensionsInCells(void) const; - - /// Sets the 'x' position of the lower corner. - void setLowerX(int32_t iX); - /// Sets the 'y' position of the lower corner. - void setLowerY(int32_t iY); - /// Sets the 'z' position of the lower corner. - void setLowerZ(int32_t iZ); - /// Sets the 'x' position of the upper corner. - void setUpperX(int32_t iX); - /// Sets the 'y' position of the upper corner. - void setUpperY(int32_t iY); - /// Sets the 'z' position of the upper corner. - void setUpperZ(int32_t iZ); - - /// Sets the position of the lower corner. - void setLowerCorner(const Vector3DInt32& v3dLowerCorner); - /// Sets the position of the upper corner. - void setUpperCorner(const Vector3DInt32& v3dUpperCorner); - - /// Tests whether the given point is contained in this Region. - bool containsPoint(float fX, float fY, float fZ, float boundary = 0.0f) const; - /// Tests whether the given point is contained in this Region. - bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const; - /// Tests whether the given point is contained in this Region. - bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const; - /// Tests whether the given point is contained in this Region. - bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const; - /// Tests whether the given position is contained in the 'x' range of this Region. - bool containsPointInX(float pos, float boundary = 0.0f) const; - /// Tests whether the given position is contained in the 'x' range of this Region. - bool containsPointInX(int32_t pos, uint8_t boundary = 0) const; - /// Tests whether the given position is contained in the 'y' range of this Region. - bool containsPointInY(float pos, float boundary = 0.0f) const; - /// Tests whether the given position is contained in the 'y' range of this Region. - bool containsPointInY(int32_t pos, uint8_t boundary = 0) const; - /// Tests whether the given position is contained in the 'z' range of this Region. - bool containsPointInZ(float pos, float boundary = 0.0f) const; - /// Tests whether the given position is contained in the 'z' range of this Region. - bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const; - - /// Tests whether the given Region is contained in this Region. - bool containsRegion(const Region& reg, uint8_t boundary = 0) const; - - /// Enlarges the Region so that it contains the specified position. - void accumulate(int32_t iX, int32_t iY, int32_t iZ); - /// Enlarges the Region so that it contains the specified position. - void accumulate(const Vector3DInt32& v3dPos); - /// Enlarges the Region so that it contains the specified Region. - void accumulate(const Region& reg); - - /// Crops the extents of this Region accoring to another Region. - void cropTo(const Region& other); - - /// Grows this region by the amount specified. - void grow(int32_t iAmount); - /// Grows this region by the amounts specified. - void grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Grows this region by the amounts specified. - void grow(const Vector3DInt32& v3dAmount); - - /// Tests whether all components of the upper corner are at least - /// as great as the corresponding components of the lower corner. - bool isValid(void) const; - - /// Moves the Region by the amount specified. - void shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Moves the Region by the amount specified. - void shift(const Vector3DInt32& v3dAmount); - /// Moves the lower corner of the Region by the amount specified. - void shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Moves the lower corner of the Region by the amount specified. - void shiftLowerCorner(const Vector3DInt32& v3dAmount); - /// Moves the upper corner of the Region by the amount specified. - void shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Moves the upper corner of the Region by the amount specified. - void shiftUpperCorner(const Vector3DInt32& v3dAmount); - - /// Shrinks this region by the amount specified. - void shrink(int32_t iAmount); - /// Shrinks this region by the amounts specified. - void shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Shrinks this region by the amounts specified. - void shrink(const Vector3DInt32& v3dAmount); - - private: - int32_t m_iLowerX; - int32_t m_iLowerY; - int32_t m_iLowerZ; - int32_t m_iUpperX; - int32_t m_iUpperY; - int32_t m_iUpperZ; - }; - - // Non-member functions - bool intersects(const Region& a, const Region& b); - - // Non-member overloaded operators. - /// Stream insertion operator. - std::ostream& operator<<(std::ostream& os, const Region& region); - - // Functions to be inlined to to be in the header rather than the .cpp. - // 'inline' keyword is used for the definition rather than the declaration. - // See also http://www.parashift.com/c++-faq-lite/inline-functions.html - - /** - * \return The 'x' position of the centre. - */ - inline int32_t Region::getCentreX(void) const - { - return (m_iLowerX + m_iUpperX) / 2; - } - - /** - * \return The 'y' position of the centre. - */ - inline int32_t Region::getCentreY(void) const - { - return (m_iLowerY + m_iUpperY) / 2; - } - - /** - * \return The 'z' position of the centre. - */ - inline int32_t Region::getCentreZ(void) const - { - return (m_iLowerZ + m_iUpperZ) / 2; - } - - /** - * \return The 'x' position of the lower corner. - */ - inline int32_t Region::getLowerX(void) const - { - return m_iLowerX; - } - - /** - * \return The 'y' position of the lower corner. - */ - inline int32_t Region::getLowerY(void) const - { - return m_iLowerY; - } - - /** - * \return The 'z' position of the lower corner. - */ - inline int32_t Region::getLowerZ(void) const - { - return m_iLowerZ; - } - - /** - * \return The 'x' position of the upper corner. - */ - inline int32_t Region::getUpperX(void) const - { - return m_iUpperX; - } - - /** - * \return The 'y' position of the upper corner. - */ - inline int32_t Region::getUpperY(void) const - { - return m_iUpperY; - } - - /** - * \return The 'z' position of the upper corner. - */ - inline int32_t Region::getUpperZ(void) const - { - return m_iUpperZ; - } - - /** - * \return The position of the lower corner. - */ - inline Vector3DInt32 Region::getCentre(void) const - { - return Vector3DInt32(getCentreX(), getCentreY(), getCentreZ()); - } - - /** - * \return The position of the lower corner. - */ - inline Vector3DInt32 Region::getLowerCorner(void) const - { - return Vector3DInt32(m_iLowerX, m_iLowerY, m_iLowerZ); - } - - /** - * \return The position of the upper corner. - */ - inline Vector3DInt32 Region::getUpperCorner(void) const - { - return Vector3DInt32(m_iUpperX, m_iUpperY, m_iUpperZ); - } - - /** - * \return The width of the region measured in voxels. - * \sa getWidthInCells() - */ - inline int32_t Region::getWidthInVoxels(void) const - { - return getWidthInCells() + 1; - } - - /** - * \return The height of the region measured in voxels. - * \sa getHeightInCells() - */ - inline int32_t Region::getHeightInVoxels(void) const - { - return getHeightInCells() + 1; - } - - /** - * \return The depth of the region measured in voxels. - * \sa getDepthInCells() - */ - inline int32_t Region::getDepthInVoxels(void) const - { - return getDepthInCells() + 1; - } - - /** - * \return The dimensions of the region measured in voxels. - * \sa getDimensionsInCells() - */ - inline Vector3DInt32 Region::getDimensionsInVoxels(void) const - { - return getDimensionsInCells() + Vector3DInt32(1, 1, 1); - } - - /** - * \return The width of the region measured in cells. - * \sa getWidthInVoxels() - */ - inline int32_t Region::getWidthInCells(void) const - { - return m_iUpperX - m_iLowerX; - } - - /** - * \return The height of the region measured in cells. - * \sa getHeightInVoxels() - */ - inline int32_t Region::getHeightInCells(void) const - { - return m_iUpperY - m_iLowerY; - } - - /** - * \return The depth of the region measured in cells. - * \sa getDepthInVoxels() - */ - inline int32_t Region::getDepthInCells(void) const - { - return m_iUpperZ - m_iLowerZ; - } - - /** - * \return The dimensions of the region measured in cells. - * \sa getDimensionsInVoxels() - */ - inline Vector3DInt32 Region::getDimensionsInCells(void) const - { - return Vector3DInt32(getWidthInCells(), getHeightInCells(), getDepthInCells()); - } - - /** - * \param iX The new 'x' position of the lower corner. - */ - inline void Region::setLowerX(int32_t iX) - { - m_iLowerX = iX; - } - - /** - * \param iY The new 'y' position of the lower corner. - */ - inline void Region::setLowerY(int32_t iY) - { - m_iLowerY = iY; - } - - /** - * \param iZ The new 'z' position of the lower corner. - */ - inline void Region::setLowerZ(int32_t iZ) - { - m_iLowerZ = iZ; - } - - /** - * \param iX The new 'x' position of the upper corner. - */ - inline void Region::setUpperX(int32_t iX) - { - m_iUpperX = iX; - } - - /** - * \param iY The new 'y' position of the upper corner. - */ - inline void Region::setUpperY(int32_t iY) - { - m_iUpperY = iY; - } - - /** - * \param iZ The new 'z' position of the upper corner. - */ - inline void Region::setUpperZ(int32_t iZ) - { - m_iUpperZ = iZ; - } - - /** - * \param v3dLowerCorner The new position of the lower corner. - */ - inline void Region::setLowerCorner(const Vector3DInt32& v3dLowerCorner) - { - m_iLowerX = v3dLowerCorner.getX(); - m_iLowerY = v3dLowerCorner.getY(); - m_iLowerZ = v3dLowerCorner.getZ(); - } - - /** - * \param v3dUpperCorner The new position of the upper corner. - */ - inline void Region::setUpperCorner(const Vector3DInt32& v3dUpperCorner) - { - m_iUpperX = v3dUpperCorner.getX(); - m_iUpperY = v3dUpperCorner.getY(); - m_iUpperZ = v3dUpperCorner.getZ(); - } -} - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Region_H__ +#define __PolyVox_Region_H__ + +#include "Impl/TypeDef.h" + +#include "PolyVoxCore/Vector.h" + +namespace PolyVox +{ + /** Represents a part of a Volume. + * + * Many operations in PolyVox are constrained to only part of a volume. For example, when running the surface extractors + * it is unlikely that you will want to run it on the whole volume at once, as this will give a very large mesh which may + * be too much to render. Instead you will probably want to run a surface extractor a number of times on different parts + * of the volume, there by giving a number of meshes which can be culled and rendered seperately. + * + * The Region class is used to define these parts (regions) of the volume. Essentially it consists of an upper and lower + * bound which specify the range of voxels positions considered to be part of the region. Note that these bounds are + * inclusive. + * + * As well as the expected set of getters and setters, this class also provide utility functions for increasing and decresing + * the size of the Region, shifting the Region in 3D space, testing whether it contains a given position, enlarging it so that + * it does contain a given position, croppng it to another Region, and various other utility functions. + * + * \Note The dimensions of a region can be measured either in voxels or in cells. See the manual for more information + * about these definitions. + * + */ +#ifdef SWIG + class Region +#else + class POLYVOX_API Region +#endif + { + public: + + /// A Region with the lower corner set as low as possible and the upper corner set as high as possible. + static const Region MaxRegion; + /// A Region with the lower corner set as high as possible and the upper corner set as low as possible. + static const Region InvertedRegion; + + /// Constructor + Region(); + /// Constructor + Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner); + /// Constructor + Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ); + + /// Equality Operator. + bool operator==(const Region& rhs) const; + /// Inequality Operator. + bool operator!=(const Region& rhs) const; + + /// Gets the 'x' position of the centre. + int32_t getCentreX(void) const; + /// Gets the 'y' position of the centre. + int32_t getCentreY(void) const; + /// Gets the 'z' position of the centrer. + int32_t getCentreZ(void) const; + /// Gets the 'x' position of the lower corner. + int32_t getLowerX(void) const; + /// Gets the 'y' position of the lower corner. + int32_t getLowerY(void) const; + /// Gets the 'z' position of the lower corner. + int32_t getLowerZ(void) const; + /// Gets the 'x' position of the upper corner. + int32_t getUpperX(void) const; + /// Gets the 'y' position of the upper corner. + int32_t getUpperY(void) const; + /// Gets the 'z' position of the upper corner. + int32_t getUpperZ(void) const; + + /// Gets the centre of the region + Vector3DInt32 getCentre(void) const; + /// Gets the position of the lower corner. + Vector3DInt32 getLowerCorner(void) const; + /// Gets the position of the upper corner. + Vector3DInt32 getUpperCorner(void) const; + + /// Gets the width of the region measured in voxels. + int32_t getWidthInVoxels(void) const; + /// Gets the height of the region measured in voxels. + int32_t getHeightInVoxels(void) const; + /// Gets the depth of the region measured in voxels. + int32_t getDepthInVoxels(void) const; + /// Gets the dimensions of the region measured in voxels. + Vector3DInt32 getDimensionsInVoxels(void) const; + + /// Gets the width of the region measured in cells. + int32_t getWidthInCells(void) const; + /// Gets the height of the region measured in cells. + int32_t getHeightInCells(void) const; + /// Gets the depth of the region measured in cells. + int32_t getDepthInCells(void) const; + /// Gets the dimensions of the region measured in cells. + Vector3DInt32 getDimensionsInCells(void) const; + + /// Sets the 'x' position of the lower corner. + void setLowerX(int32_t iX); + /// Sets the 'y' position of the lower corner. + void setLowerY(int32_t iY); + /// Sets the 'z' position of the lower corner. + void setLowerZ(int32_t iZ); + /// Sets the 'x' position of the upper corner. + void setUpperX(int32_t iX); + /// Sets the 'y' position of the upper corner. + void setUpperY(int32_t iY); + /// Sets the 'z' position of the upper corner. + void setUpperZ(int32_t iZ); + + /// Sets the position of the lower corner. + void setLowerCorner(const Vector3DInt32& v3dLowerCorner); + /// Sets the position of the upper corner. + void setUpperCorner(const Vector3DInt32& v3dUpperCorner); + + /// Tests whether the given point is contained in this Region. + bool containsPoint(float fX, float fY, float fZ, float boundary = 0.0f) const; + /// Tests whether the given point is contained in this Region. + bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const; + /// Tests whether the given point is contained in this Region. + bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const; + /// Tests whether the given point is contained in this Region. + bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const; + /// Tests whether the given position is contained in the 'x' range of this Region. + bool containsPointInX(float pos, float boundary = 0.0f) const; + /// Tests whether the given position is contained in the 'x' range of this Region. + bool containsPointInX(int32_t pos, uint8_t boundary = 0) const; + /// Tests whether the given position is contained in the 'y' range of this Region. + bool containsPointInY(float pos, float boundary = 0.0f) const; + /// Tests whether the given position is contained in the 'y' range of this Region. + bool containsPointInY(int32_t pos, uint8_t boundary = 0) const; + /// Tests whether the given position is contained in the 'z' range of this Region. + bool containsPointInZ(float pos, float boundary = 0.0f) const; + /// Tests whether the given position is contained in the 'z' range of this Region. + bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const; + + /// Tests whether the given Region is contained in this Region. + bool containsRegion(const Region& reg, uint8_t boundary = 0) const; + + /// Enlarges the Region so that it contains the specified position. + void accumulate(int32_t iX, int32_t iY, int32_t iZ); + /// Enlarges the Region so that it contains the specified position. + void accumulate(const Vector3DInt32& v3dPos); + /// Enlarges the Region so that it contains the specified Region. + void accumulate(const Region& reg); + + /// Crops the extents of this Region accoring to another Region. + void cropTo(const Region& other); + + /// Grows this region by the amount specified. + void grow(int32_t iAmount); + /// Grows this region by the amounts specified. + void grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Grows this region by the amounts specified. + void grow(const Vector3DInt32& v3dAmount); + + /// Tests whether all components of the upper corner are at least + /// as great as the corresponding components of the lower corner. + bool isValid(void) const; + + /// Moves the Region by the amount specified. + void shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Moves the Region by the amount specified. + void shift(const Vector3DInt32& v3dAmount); + /// Moves the lower corner of the Region by the amount specified. + void shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Moves the lower corner of the Region by the amount specified. + void shiftLowerCorner(const Vector3DInt32& v3dAmount); + /// Moves the upper corner of the Region by the amount specified. + void shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Moves the upper corner of the Region by the amount specified. + void shiftUpperCorner(const Vector3DInt32& v3dAmount); + + /// Shrinks this region by the amount specified. + void shrink(int32_t iAmount); + /// Shrinks this region by the amounts specified. + void shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Shrinks this region by the amounts specified. + void shrink(const Vector3DInt32& v3dAmount); + + private: + int32_t m_iLowerX; + int32_t m_iLowerY; + int32_t m_iLowerZ; + int32_t m_iUpperX; + int32_t m_iUpperY; + int32_t m_iUpperZ; + }; + + // Non-member functions + bool intersects(const Region& a, const Region& b); + + // Non-member overloaded operators. + /// Stream insertion operator. + std::ostream& operator<<(std::ostream& os, const Region& region); + + // Functions to be inlined to to be in the header rather than the .cpp. + // 'inline' keyword is used for the definition rather than the declaration. + // See also http://www.parashift.com/c++-faq-lite/inline-functions.html + + /** + * \return The 'x' position of the centre. + */ + inline int32_t Region::getCentreX(void) const + { + return (m_iLowerX + m_iUpperX) / 2; + } + + /** + * \return The 'y' position of the centre. + */ + inline int32_t Region::getCentreY(void) const + { + return (m_iLowerY + m_iUpperY) / 2; + } + + /** + * \return The 'z' position of the centre. + */ + inline int32_t Region::getCentreZ(void) const + { + return (m_iLowerZ + m_iUpperZ) / 2; + } + + /** + * \return The 'x' position of the lower corner. + */ + inline int32_t Region::getLowerX(void) const + { + return m_iLowerX; + } + + /** + * \return The 'y' position of the lower corner. + */ + inline int32_t Region::getLowerY(void) const + { + return m_iLowerY; + } + + /** + * \return The 'z' position of the lower corner. + */ + inline int32_t Region::getLowerZ(void) const + { + return m_iLowerZ; + } + + /** + * \return The 'x' position of the upper corner. + */ + inline int32_t Region::getUpperX(void) const + { + return m_iUpperX; + } + + /** + * \return The 'y' position of the upper corner. + */ + inline int32_t Region::getUpperY(void) const + { + return m_iUpperY; + } + + /** + * \return The 'z' position of the upper corner. + */ + inline int32_t Region::getUpperZ(void) const + { + return m_iUpperZ; + } + + /** + * \return The position of the lower corner. + */ + inline Vector3DInt32 Region::getCentre(void) const + { + return Vector3DInt32(getCentreX(), getCentreY(), getCentreZ()); + } + + /** + * \return The position of the lower corner. + */ + inline Vector3DInt32 Region::getLowerCorner(void) const + { + return Vector3DInt32(m_iLowerX, m_iLowerY, m_iLowerZ); + } + + /** + * \return The position of the upper corner. + */ + inline Vector3DInt32 Region::getUpperCorner(void) const + { + return Vector3DInt32(m_iUpperX, m_iUpperY, m_iUpperZ); + } + + /** + * \return The width of the region measured in voxels. + * \sa getWidthInCells() + */ + inline int32_t Region::getWidthInVoxels(void) const + { + return getWidthInCells() + 1; + } + + /** + * \return The height of the region measured in voxels. + * \sa getHeightInCells() + */ + inline int32_t Region::getHeightInVoxels(void) const + { + return getHeightInCells() + 1; + } + + /** + * \return The depth of the region measured in voxels. + * \sa getDepthInCells() + */ + inline int32_t Region::getDepthInVoxels(void) const + { + return getDepthInCells() + 1; + } + + /** + * \return The dimensions of the region measured in voxels. + * \sa getDimensionsInCells() + */ + inline Vector3DInt32 Region::getDimensionsInVoxels(void) const + { + return getDimensionsInCells() + Vector3DInt32(1, 1, 1); + } + + /** + * \return The width of the region measured in cells. + * \sa getWidthInVoxels() + */ + inline int32_t Region::getWidthInCells(void) const + { + return m_iUpperX - m_iLowerX; + } + + /** + * \return The height of the region measured in cells. + * \sa getHeightInVoxels() + */ + inline int32_t Region::getHeightInCells(void) const + { + return m_iUpperY - m_iLowerY; + } + + /** + * \return The depth of the region measured in cells. + * \sa getDepthInVoxels() + */ + inline int32_t Region::getDepthInCells(void) const + { + return m_iUpperZ - m_iLowerZ; + } + + /** + * \return The dimensions of the region measured in cells. + * \sa getDimensionsInVoxels() + */ + inline Vector3DInt32 Region::getDimensionsInCells(void) const + { + return Vector3DInt32(getWidthInCells(), getHeightInCells(), getDepthInCells()); + } + + /** + * \param iX The new 'x' position of the lower corner. + */ + inline void Region::setLowerX(int32_t iX) + { + m_iLowerX = iX; + } + + /** + * \param iY The new 'y' position of the lower corner. + */ + inline void Region::setLowerY(int32_t iY) + { + m_iLowerY = iY; + } + + /** + * \param iZ The new 'z' position of the lower corner. + */ + inline void Region::setLowerZ(int32_t iZ) + { + m_iLowerZ = iZ; + } + + /** + * \param iX The new 'x' position of the upper corner. + */ + inline void Region::setUpperX(int32_t iX) + { + m_iUpperX = iX; + } + + /** + * \param iY The new 'y' position of the upper corner. + */ + inline void Region::setUpperY(int32_t iY) + { + m_iUpperY = iY; + } + + /** + * \param iZ The new 'z' position of the upper corner. + */ + inline void Region::setUpperZ(int32_t iZ) + { + m_iUpperZ = iZ; + } + + /** + * \param v3dLowerCorner The new position of the lower corner. + */ + inline void Region::setLowerCorner(const Vector3DInt32& v3dLowerCorner) + { + m_iLowerX = v3dLowerCorner.getX(); + m_iLowerY = v3dLowerCorner.getY(); + m_iLowerZ = v3dLowerCorner.getZ(); + } + + /** + * \param v3dUpperCorner The new position of the upper corner. + */ + inline void Region::setUpperCorner(const Vector3DInt32& v3dUpperCorner) + { + m_iUpperX = v3dUpperCorner.getX(); + m_iUpperY = v3dUpperCorner.getY(); + m_iUpperZ = v3dUpperCorner.getZ(); + } +} + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index a97c7be3..359ff6a7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -1,9 +1,9 @@ -#ifndef __PolyVox_SimpleVolume_H__ -#define __PolyVox_SimpleVolume_H__ - -#pragma message("WARNING - The SimpleVolume class has been replaced by PagedVolume. Please use that instead.") - -#include "PagedVolume.h" -#include "PolyVoxForwardDeclarations.h" - +#ifndef __PolyVox_SimpleVolume_H__ +#define __PolyVox_SimpleVolume_H__ + +#pragma message("WARNING - The SimpleVolume class has been replaced by PagedVolume. Please use that instead.") + +#include "PagedVolume.h" +#include "PolyVoxForwardDeclarations.h" + #endif //__PolyVox_SimpleVolume_H__ \ No newline at end of file diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.h b/library/PolyVoxCore/include/PolyVoxCore/Vector.h index 7a7ff7ed..416158ed 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.h @@ -1,248 +1,248 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_Vector_H__ -#define __PolyVox_Vector_H__ - -#include "Impl/ErrorHandling.h" -#include "Impl/TypeDef.h" - -#include "PolyVoxForwardDeclarations.h" - -#include -#include -#include -#include - -namespace PolyVox -{ - /** - * Represents a vector in space. - * - * This is a generl purpose vector class designed to represent both positions and directions. It is templatised - * on both size and data type but note that some of the operations do not make sense with integer types. For - * example it does not make conceptual sense to try and normalise an integer Vector. - * - * Every Vector must have at at least two elements, and the first four elements of any vector are known as the - * X, Y, Z and W elements. Note that W is last even though it comes before X in the alphabet. These elements can - * be accessed through getX(), setX(), getY(), setY(), getZ(), setZ(), getW() and setW(), while other elements - * can be accessed through getElemen() and setElement(). - * - * This class includes a number of common mathematical operations (addition, subtraction, etc) as well as vector - * specific operations such as the dot and cross products. Note that this class is also templatised on an - * OperationType which is used for many internal calculations and some results. For example, the square of a - * vector's length will always be an integer if all the elements are integers, but the value might be outside - * that which can be represented by the StorageType. You don't need to worry about this as long as you are using - * the built in typedefs for common configurations. - * - * Typedefs are provided for 2, 3 and 4 dimensional vector with int8_t, uint8_t, int16_t, uint6_t, int32_t, - * uint32_t, float and double types. These typedefs are used as follows: - * - * \code - * Vector2DInt32 test(1,2); //Declares a 2 dimensional Vector of type int32_t. - * \endcode - */ - template - class Vector - { - public: - /// Constructor - Vector(void); - /// Constructor. - Vector(StorageType tFillValue); - /// Constructor. - Vector(StorageType x, StorageType y); - /// Constructor. - Vector(StorageType x, StorageType y, StorageType z); - /// Constructor. - Vector(StorageType x, StorageType y, StorageType z, StorageType w); - /// Copy Constructor. - Vector(const Vector& vector); - /// Copy Constructor which performs casting. - template explicit Vector(const Vector& vector); - /// Destructor. - ~Vector(void); - - /// Assignment Operator. - Vector& operator=(const Vector& rhs); - /// Equality Operator. - bool operator==(const Vector& rhs) const; - /// Inequality Operator. - bool operator!=(const Vector& rhs) const; - /// Comparison Operator. - POLYVOX_DEPRECATED bool operator<(const Vector& rhs) const; - /// Addition and Assignment Operator. - Vector& operator+=(const Vector &rhs); - /// Subtraction and Assignment Operator. - Vector& operator-=(const Vector &rhs); - /// Multiplication and Assignment Operator. - Vector& operator*=(const Vector &rhs); - /// Division and Assignment Operator. - Vector& operator/=(const Vector &rhs); - /// Multiplication and Assignment Operator. - Vector& operator*=(const StorageType& rhs); - /// Division and Assignment Operator. - Vector& operator/=(const StorageType& rhs); - - /// Element Access. - StorageType getElement(uint32_t index) const; - /// Get the x component of the vector. - StorageType getX(void) const; - /// Get the y component of the vector. - StorageType getY(void) const; - /// Get the z component of the vector. - StorageType getZ(void) const; - /// Get the w component of the vector. - StorageType getW(void) const; - - /// Element Access. - void setElement(uint32_t index, StorageType tValue); - /// Element Access. - void setElements(StorageType x, StorageType y); - /// Element Access. - void setElements(StorageType x, StorageType y, StorageType z); - /// Element Access. - void setElements(StorageType x, StorageType y, StorageType z, StorageType w); - /// Set the x component of the vector. - void setX(StorageType tX); - /// Set the y component of the vector. - void setY(StorageType tY); - /// Set the z component of the vector. - void setZ(StorageType tZ); - /// Set the w component of the vector. - void setW(StorageType tW); - - /// Get the length of the vector. - float length(void) const; - /// Get the squared length of the vector. - OperationType lengthSquared(void) const; - /// Find the angle between this vector and that which is passed as a parameter. - float angleTo(const Vector& vector) const; - /// Find the cross product between this vector and the vector passed as a parameter. - Vector cross(const Vector& vector) const; - /// Find the dot product between this vector and the vector passed as a parameter. - OperationType dot(const Vector& rhs) const; - /// Normalise the vector. - void normalise(void); - - private: - // Values for the vector - StorageType m_tElements[Size]; - }; - - // Non-member overloaded operators. - /// Addition operator. - template - Vector operator+(const Vector& lhs, const Vector& rhs); - /// Subtraction operator. - template - Vector operator-(const Vector& lhs, const Vector& rhs); - /// Multiplication operator. - template - Vector operator*(const Vector& lhs, const Vector& rhs); - /// Division operator. - template - Vector operator/(const Vector& lhs, const Vector& rhs); - /// Multiplication operator. - template - Vector operator*(const Vector& lhs, const StorageType& rhs); - /// Division operator. - template - Vector operator/(const Vector& lhs, const StorageType& rhs); - /// Stream insertion operator. - template - std::ostream& operator<<(std::ostream& os, const Vector& vector); - - //Some handy typedefs - - /// A 2D Vector of floats. - typedef Vector<2,float,float> Vector2DFloat; - /// A 2D Vector of doubles. - typedef Vector<2,double,double> Vector2DDouble; - /// A 2D Vector of signed 8-bit values. - typedef Vector<2,int8_t,int32_t> Vector2DInt8; - /// A 2D Vector of unsigned 8-bit values. - typedef Vector<2,uint8_t,int32_t> Vector2DUint8; - /// A 2D Vector of signed 16-bit values. - typedef Vector<2,int16_t,int32_t> Vector2DInt16; - /// A 2D Vector of unsigned 16-bit values. - typedef Vector<2,uint16_t,int32_t> Vector2DUint16; - /// A 2D Vector of signed 32-bit values. - typedef Vector<2,int32_t,int32_t> Vector2DInt32; - /// A 2D Vector of unsigned 32-bit values. - typedef Vector<2,uint32_t,int32_t> Vector2DUint32; - - /// A 3D Vector of floats. - typedef Vector<3,float,float> Vector3DFloat; - /// A 3D Vector of doubles. - typedef Vector<3,double,double> Vector3DDouble; - /// A 3D Vector of signed 8-bit values. - typedef Vector<3,int8_t,int32_t> Vector3DInt8; - /// A 3D Vector of unsigned 8-bit values. - typedef Vector<3,uint8_t,int32_t> Vector3DUint8; - /// A 3D Vector of signed 16-bit values. - typedef Vector<3,int16_t,int32_t> Vector3DInt16; - /// A 3D Vector of unsigned 16-bit values. - typedef Vector<3,uint16_t,int32_t> Vector3DUint16; - /// A 3D Vector of signed 32-bit values. - typedef Vector<3,int32_t,int32_t> Vector3DInt32; - /// A 3D Vector of unsigned 32-bit values. - typedef Vector<3,uint32_t,int32_t> Vector3DUint32; - - /// A 4D Vector of floats. - typedef Vector<4,float,float> Vector4DFloat; - /// A 4D Vector of doubles. - typedef Vector<4,double,double> Vector4DDouble; - /// A 4D Vector of signed 8-bit values. - typedef Vector<4,int8_t,int32_t> Vector4DInt8; - /// A 4D Vector of unsigned 8-bit values. - typedef Vector<4,uint8_t,int32_t> Vector4DUint8; - /// A 4D Vector of signed 16-bit values. - typedef Vector<4,int16_t,int32_t> Vector4DInt16; - /// A 4D Vector of unsigned 16-bit values. - typedef Vector<4,uint16_t,int32_t> Vector4DUint16; - /// A 4D Vector of signed 32-bit values. - typedef Vector<4,int32_t,int32_t> Vector4DInt32; - /// A 4D Vector of unsigned 32-bit values. - typedef Vector<4,uint32_t,int32_t> Vector4DUint32; - - -}//namespace PolyVox - -namespace std -{ - template <> - struct hash - { - std::size_t operator()(const PolyVox::Vector3DInt32& vec) const - { - return ((vec.getX() & 0xFF)) | ((vec.getY() & 0xFF) << 8) | ((vec.getZ() & 0xFF) << 16); - } - }; -} - - -#include "PolyVoxCore/Vector.inl" - -#endif - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Vector_H__ +#define __PolyVox_Vector_H__ + +#include "Impl/ErrorHandling.h" +#include "Impl/TypeDef.h" + +#include "PolyVoxForwardDeclarations.h" + +#include +#include +#include +#include + +namespace PolyVox +{ + /** + * Represents a vector in space. + * + * This is a generl purpose vector class designed to represent both positions and directions. It is templatised + * on both size and data type but note that some of the operations do not make sense with integer types. For + * example it does not make conceptual sense to try and normalise an integer Vector. + * + * Every Vector must have at at least two elements, and the first four elements of any vector are known as the + * X, Y, Z and W elements. Note that W is last even though it comes before X in the alphabet. These elements can + * be accessed through getX(), setX(), getY(), setY(), getZ(), setZ(), getW() and setW(), while other elements + * can be accessed through getElemen() and setElement(). + * + * This class includes a number of common mathematical operations (addition, subtraction, etc) as well as vector + * specific operations such as the dot and cross products. Note that this class is also templatised on an + * OperationType which is used for many internal calculations and some results. For example, the square of a + * vector's length will always be an integer if all the elements are integers, but the value might be outside + * that which can be represented by the StorageType. You don't need to worry about this as long as you are using + * the built in typedefs for common configurations. + * + * Typedefs are provided for 2, 3 and 4 dimensional vector with int8_t, uint8_t, int16_t, uint6_t, int32_t, + * uint32_t, float and double types. These typedefs are used as follows: + * + * \code + * Vector2DInt32 test(1,2); //Declares a 2 dimensional Vector of type int32_t. + * \endcode + */ + template + class Vector + { + public: + /// Constructor + Vector(void); + /// Constructor. + Vector(StorageType tFillValue); + /// Constructor. + Vector(StorageType x, StorageType y); + /// Constructor. + Vector(StorageType x, StorageType y, StorageType z); + /// Constructor. + Vector(StorageType x, StorageType y, StorageType z, StorageType w); + /// Copy Constructor. + Vector(const Vector& vector); + /// Copy Constructor which performs casting. + template explicit Vector(const Vector& vector); + /// Destructor. + ~Vector(void); + + /// Assignment Operator. + Vector& operator=(const Vector& rhs); + /// Equality Operator. + bool operator==(const Vector& rhs) const; + /// Inequality Operator. + bool operator!=(const Vector& rhs) const; + /// Comparison Operator. + POLYVOX_DEPRECATED bool operator<(const Vector& rhs) const; + /// Addition and Assignment Operator. + Vector& operator+=(const Vector &rhs); + /// Subtraction and Assignment Operator. + Vector& operator-=(const Vector &rhs); + /// Multiplication and Assignment Operator. + Vector& operator*=(const Vector &rhs); + /// Division and Assignment Operator. + Vector& operator/=(const Vector &rhs); + /// Multiplication and Assignment Operator. + Vector& operator*=(const StorageType& rhs); + /// Division and Assignment Operator. + Vector& operator/=(const StorageType& rhs); + + /// Element Access. + StorageType getElement(uint32_t index) const; + /// Get the x component of the vector. + StorageType getX(void) const; + /// Get the y component of the vector. + StorageType getY(void) const; + /// Get the z component of the vector. + StorageType getZ(void) const; + /// Get the w component of the vector. + StorageType getW(void) const; + + /// Element Access. + void setElement(uint32_t index, StorageType tValue); + /// Element Access. + void setElements(StorageType x, StorageType y); + /// Element Access. + void setElements(StorageType x, StorageType y, StorageType z); + /// Element Access. + void setElements(StorageType x, StorageType y, StorageType z, StorageType w); + /// Set the x component of the vector. + void setX(StorageType tX); + /// Set the y component of the vector. + void setY(StorageType tY); + /// Set the z component of the vector. + void setZ(StorageType tZ); + /// Set the w component of the vector. + void setW(StorageType tW); + + /// Get the length of the vector. + float length(void) const; + /// Get the squared length of the vector. + OperationType lengthSquared(void) const; + /// Find the angle between this vector and that which is passed as a parameter. + float angleTo(const Vector& vector) const; + /// Find the cross product between this vector and the vector passed as a parameter. + Vector cross(const Vector& vector) const; + /// Find the dot product between this vector and the vector passed as a parameter. + OperationType dot(const Vector& rhs) const; + /// Normalise the vector. + void normalise(void); + + private: + // Values for the vector + StorageType m_tElements[Size]; + }; + + // Non-member overloaded operators. + /// Addition operator. + template + Vector operator+(const Vector& lhs, const Vector& rhs); + /// Subtraction operator. + template + Vector operator-(const Vector& lhs, const Vector& rhs); + /// Multiplication operator. + template + Vector operator*(const Vector& lhs, const Vector& rhs); + /// Division operator. + template + Vector operator/(const Vector& lhs, const Vector& rhs); + /// Multiplication operator. + template + Vector operator*(const Vector& lhs, const StorageType& rhs); + /// Division operator. + template + Vector operator/(const Vector& lhs, const StorageType& rhs); + /// Stream insertion operator. + template + std::ostream& operator<<(std::ostream& os, const Vector& vector); + + //Some handy typedefs + + /// A 2D Vector of floats. + typedef Vector<2,float,float> Vector2DFloat; + /// A 2D Vector of doubles. + typedef Vector<2,double,double> Vector2DDouble; + /// A 2D Vector of signed 8-bit values. + typedef Vector<2,int8_t,int32_t> Vector2DInt8; + /// A 2D Vector of unsigned 8-bit values. + typedef Vector<2,uint8_t,int32_t> Vector2DUint8; + /// A 2D Vector of signed 16-bit values. + typedef Vector<2,int16_t,int32_t> Vector2DInt16; + /// A 2D Vector of unsigned 16-bit values. + typedef Vector<2,uint16_t,int32_t> Vector2DUint16; + /// A 2D Vector of signed 32-bit values. + typedef Vector<2,int32_t,int32_t> Vector2DInt32; + /// A 2D Vector of unsigned 32-bit values. + typedef Vector<2,uint32_t,int32_t> Vector2DUint32; + + /// A 3D Vector of floats. + typedef Vector<3,float,float> Vector3DFloat; + /// A 3D Vector of doubles. + typedef Vector<3,double,double> Vector3DDouble; + /// A 3D Vector of signed 8-bit values. + typedef Vector<3,int8_t,int32_t> Vector3DInt8; + /// A 3D Vector of unsigned 8-bit values. + typedef Vector<3,uint8_t,int32_t> Vector3DUint8; + /// A 3D Vector of signed 16-bit values. + typedef Vector<3,int16_t,int32_t> Vector3DInt16; + /// A 3D Vector of unsigned 16-bit values. + typedef Vector<3,uint16_t,int32_t> Vector3DUint16; + /// A 3D Vector of signed 32-bit values. + typedef Vector<3,int32_t,int32_t> Vector3DInt32; + /// A 3D Vector of unsigned 32-bit values. + typedef Vector<3,uint32_t,int32_t> Vector3DUint32; + + /// A 4D Vector of floats. + typedef Vector<4,float,float> Vector4DFloat; + /// A 4D Vector of doubles. + typedef Vector<4,double,double> Vector4DDouble; + /// A 4D Vector of signed 8-bit values. + typedef Vector<4,int8_t,int32_t> Vector4DInt8; + /// A 4D Vector of unsigned 8-bit values. + typedef Vector<4,uint8_t,int32_t> Vector4DUint8; + /// A 4D Vector of signed 16-bit values. + typedef Vector<4,int16_t,int32_t> Vector4DInt16; + /// A 4D Vector of unsigned 16-bit values. + typedef Vector<4,uint16_t,int32_t> Vector4DUint16; + /// A 4D Vector of signed 32-bit values. + typedef Vector<4,int32_t,int32_t> Vector4DInt32; + /// A 4D Vector of unsigned 32-bit values. + typedef Vector<4,uint32_t,int32_t> Vector4DUint32; + + +}//namespace PolyVox + +namespace std +{ + template <> + struct hash + { + std::size_t operator()(const PolyVox::Vector3DInt32& vec) const + { + return ((vec.getX() & 0xFF)) | ((vec.getY() & 0xFF) << 8) | ((vec.getZ() & 0xFF) << 16); + } + }; +} + + +#include "PolyVoxCore/Vector.inl" + +#endif + diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index e741b066..d03ae025 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -1,673 +1,673 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -namespace PolyVox -{ - //-------------------------- Constructors, etc --------------------------------- - /** - * Creates a Vector object but does not initialise it. - */ - template - Vector::Vector(void) - { - } - - /** - * Creates a Vector object and initialises all components with the given value. - * \param tFillValue The value to write to every component. - */ - template - Vector::Vector(StorageType tFillValue) - { - for(uint32_t ct = 0; ct < Size; ct++) - { - m_tElements[ct] = tFillValue; - } - } - - /** - * Creates a Vector object and initialises it with given values. - * \param x The X component to set. - * \param y The Y component to set. - */ - template - Vector::Vector(StorageType x, StorageType y) - { - static_assert(Size == 2, "This constructor should only be used for vectors with two elements."); - - m_tElements[0] = x; - m_tElements[1] = y; - } - - /** - * Creates a Vector3D object and initialises it with given values. - * \param x The X component to set. - * \param y The Y component to set. - * \param z the Z component to set. - */ - template - Vector::Vector(StorageType x, StorageType y, StorageType z) - { - static_assert(Size == 3, "This constructor should only be used for vectors with three elements."); - - m_tElements[0] = x; - m_tElements[1] = y; - m_tElements[2] = z; - - } - - /** - * Creates a Vector3D object and initialises it with given values. - * \param x The X component to set. - * \param y The Y component to set. - * \param z The Z component to set. - * \param w The W component to set. - */ - template - Vector::Vector(StorageType x, StorageType y, StorageType z, StorageType w) - { - static_assert(Size == 4, "This constructor should only be used for vectors with four elements."); - - m_tElements[0] = x; - m_tElements[1] = y; - m_tElements[2] = z; - m_tElements[3] = w; - } - - /** - * Copy constructor builds object based on object passed as parameter. - * \param vector A reference to the Vector to be copied. - */ - template - Vector::Vector(const Vector& vector) - { - std::memcpy(m_tElements, vector.m_tElements, sizeof(StorageType) * Size); - } - - /** - * This copy constructor allows casting between vectors with different data types. - * It makes it possible to use code such as: - * - * Vector3DDouble v3dDouble(1.0,2.0,3.0); - * Vector3DFloat v3dFloat = static_cast(v3dDouble); //Casting - * - * \param vector A reference to the Vector to be copied. - */ - template - template - Vector::Vector(const Vector& vector) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] = static_cast(vector.getElement(ct)); - } - } - - /** - * Destroys the Vector. - */ - template - Vector::~Vector(void) - { - // We put the static asserts in the destructor because there is one one of these, - // where as there are multiple constructors. - - // Force a vector to have a length greater than one. There is no need for a - // vector with one element, and supporting this would cause confusion over the - // behaviour of the constructor taking a single value, as this fills all elements - // to that value rather than just the first one. - static_assert(Size > 1, "Vector must have a length greater than one."); - } - - /** - * Assignment operator copies each element of first Vector to the second. - * \param rhs Vector to assign to. - * \return A reference to the result to allow chaining. - */ - template - Vector& Vector::operator=(const Vector& rhs) - { - if(this == &rhs) - { - return *this; - } - std::memcpy(m_tElements, rhs.m_tElements, sizeof(StorageType) * Size); - return *this; - } - - /** - * Checks whether two Vectors are equal. - * \param rhs The Vector to compare to. - * \return true if the Vectors match. - * \see operator!= - */ - template - inline bool Vector::operator==(const Vector &rhs) const - { - bool equal = true; - for(uint32_t ct = 0; ct < Size; ++ct) - { - if(m_tElements[ct] != rhs.m_tElements[ct]) - { - equal = false; - break; - } - } - return equal; - } - - /** - * Checks whether two Vectors are not equal. - * \param rhs The Vector to compare to. - * \return true if the Vectors do not match. - * \see operator== - */ - template - inline bool Vector::operator!=(const Vector &rhs) const - { - return !(*this == rhs); //Just call equality operator and invert the result. - } - - /** - * Checks whether this vector is less than the parameter. The metric is - * meaningless but it allows Vectors to me used as key in sdt::map, etc. - * This function is deprecated. You should specify a seperate comparator to the std:map if you need one. - * \param rhs The Vector to compare to. - * \return true if this is less than the parameter - * \see operator!= - * \deprecated - */ - template - inline bool Vector::operator<(const Vector &rhs) const - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - if (m_tElements[ct] < rhs.m_tElements[ct]) - return true; - if (rhs.m_tElements[ct] < m_tElements[ct]) - return false; - } - return false; - } - - /** - * Addition operator adds corresponding elements of the two Vectors. - * \param rhs The Vector to add - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator+=(const Vector& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] += rhs.m_tElements[ct]; - } - return *this; - } - - /** - * Subtraction operator subtracts corresponding elements of one Vector from the other. - * \param rhs The Vector to subtract - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator-=(const Vector& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] -= rhs.m_tElements[ct]; - } - return *this; - } - - /** - * Multiplication operator multiplies corresponding elements of the two Vectors. - * \param rhs The Vector to multiply by - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator*=(const Vector& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] *= rhs.m_tElements[ct]; - } - return *this; - } - - /** - * Division operator divides corresponding elements of one Vector by the other. - * \param rhs The Vector to divide by - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator/=(const Vector& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] /= rhs.m_tElements[ct]; - } - return *this; - } - - /** - * Multiplication operator multiplies each element of the Vector by a number. - * \param rhs The number the Vector is multiplied by. - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator*=(const StorageType& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] *= rhs; - } - return *this; - } - - /** - * Division operator divides each element of the Vector by a number. - * \param rhs The number the Vector is divided by. - * \return The resulting Vector. - */ - template - inline Vector& Vector::operator/=(const StorageType& rhs) - { - for(uint32_t ct = 0; ct < Size; ++ct) - { - m_tElements[ct] /= rhs; - } - return *this; - } - - /** - * Addition operator adds corresponding elements of the two Vectors. - * \param lhs The Vector to add to. - * \param rhs The Vector to add. - * \return The resulting Vector. - */ - template - Vector operator+(const Vector& lhs, const Vector& rhs) - { - Vector result = lhs; - result += rhs; - return result; - } - - /** - * Subtraction operator subtracts corresponding elements of one Vector from the other. - * \param lhs The Vector to subtract from. - * \param rhs The Vector to subtract. - * \return The resulting Vector. - */ - template - Vector operator-(const Vector& lhs, const Vector& rhs) - { - Vector result = lhs; - result -= rhs; - return result; - } - - /** - * Multiplication operator mulitplies corresponding elements of the two Vectors. - * \param lhs The Vector to multiply. - * \param rhs The Vector to multiply by. - * \return The resulting Vector. - */ - template - Vector operator*(const Vector& lhs, const Vector& rhs) - { - Vector result = lhs; - result *= rhs; - return result; - } - - /** - * Division operator divides corresponding elements of one Vector by the other. - * \param lhs The Vector to divide. - * \param rhs The Vector to divide by. - * \return The resulting Vector. - */ - template - Vector operator/(const Vector& lhs, const Vector& rhs) - { - Vector result = lhs; - result /= rhs; - return result; - } - - /** - * Multiplication operator multiplies each element of the Vector by a number. - * \param lhs The Vector to multiply. - * \param rhs The number the Vector is multiplied by. - * \return The resulting Vector. - */ - template - Vector operator*(const Vector& lhs, const StorageType& rhs) - { - Vector result = lhs; - result *= rhs; - return result; - } - - /** - * Division operator divides each element of the Vector by a number. - * \param lhs The Vector to divide. - * \param rhs The number the Vector is divided by. - * \return The resulting Vector. - */ - template - Vector operator/(const Vector& lhs, const StorageType& rhs) - { - Vector result = lhs; - result /= rhs; - return result; - } - - /** - * Enables the Vector to be used intuitively with output streams such as cout. - * \param os The output stream to write to. - * \param vector The Vector to write to the stream. - * \return A reference to the output stream to allow chaining. - */ - template - std::ostream& operator<<(std::ostream& os, const Vector& vector) - { - os << "("; - for(uint32_t ct = 0; ct < Size; ++ct) - { - os << vector.getElement(ct); - if(ct < (Size-1)) - { - os << ","; - } - } - os << ")"; - return os; - } - - /** - * Returns the element at the given position. - * \param index The index of the element to return. - * \return The element. - */ - template - inline StorageType Vector::getElement(uint32_t index) const - { - if(index >= Size) - { - POLYVOX_THROW(std::out_of_range, "Attempted to access invalid vector element."); - } - - return m_tElements[index]; - } - - /** - * \return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector. - */ - template - inline StorageType Vector::getX(void) const - { - return m_tElements[0]; // This is fine, a Vector always contains at least two elements. - } - - /** - * \return A const reference to the Y component of a 2, 3, or 4 dimensional Vector. - */ - template - inline StorageType Vector::getY(void) const - { - return m_tElements[1]; // This is fine, a Vector always contains at least two elements. - } - - /** - * \return A const reference to the Z component of a 3 or 4 dimensional Vector. - */ - template - inline StorageType Vector::getZ(void) const - { - static_assert(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); - - return m_tElements[2]; - } - - /** - * \return A const reference to the W component of a 4 dimensional Vector. - */ - template - inline StorageType Vector::getW(void) const - { - static_assert(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); - - return m_tElements[3]; - } - - /** - * \param index The index of the element to set. - * \param tValue The new value for the element. - */ - template - inline void Vector::setElement(uint32_t index, StorageType tValue) - { - if(index >= Size) - { - POLYVOX_THROW(std::out_of_range, "Attempted to access invalid vector element."); - } - - m_tElements[index] = tValue; - } - - /** - * Sets several elements of a vector at once. - * \param x The X component to set. - * \param y The Y component to set. - */ - template - inline void Vector::setElements(StorageType x, StorageType y) - { - // This is fine, a Vector always contains at least two elements. - m_tElements[0] = x; - m_tElements[1] = y; - } - - /** - * Sets several elements of a vector at once. - * \param x The X component to set. - * \param y The Y component to set. - * \param z The Z component to set. - */ - template - inline void Vector::setElements(StorageType x, StorageType y, StorageType z) - { - static_assert(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); - - m_tElements[0] = x; - m_tElements[1] = y; - m_tElements[2] = z; - } - - /** - * Sets several elements of a vector at once. - * \param x The X component to set. - * \param y The Y component to set. - * \param z The Z component to set. - * \param w The W component to set. - */ - template - inline void Vector::setElements(StorageType x, StorageType y, StorageType z, StorageType w) - { - static_assert(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); - - m_tElements[0] = x; - m_tElements[1] = y; - m_tElements[2] = z; - m_tElements[3] = w; - } - - /** - * \param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector. - */ - template - inline void Vector::setX(StorageType tX) - { - m_tElements[0] = tX; // This is fine, a Vector always contains at least two elements. - } - - /** - * \param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector. - */ - template - inline void Vector::setY(StorageType tY) - { - m_tElements[1] = tY; // This is fine, a Vector always contains at least two elements. - } - - /** - * \param tZ The new value for the Z component of a 3 or 4 dimensional Vector. - */ - template - inline void Vector::setZ(StorageType tZ) - { - static_assert(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); - - m_tElements[2] = tZ; - } - - /** - * \param tW The new value for the W component of a 4 dimensional Vector. - */ - template - inline void Vector::setW(StorageType tW) - { - static_assert(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); - - m_tElements[3] = tW; - } - - /** - * \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer. - * \return The length of the Vector. - */ - template - inline float Vector::length(void) const - { - return sqrt(static_cast(lengthSquared())); - } - - /** - * \return The squared length of the Vector. - */ - template - inline OperationType Vector::lengthSquared(void) const - { - OperationType tLengthSquared = static_cast(0); - for(uint32_t ct = 0; ct < Size; ++ct) - { - tLengthSquared += static_cast(m_tElements[ct]) * static_cast(m_tElements[ct]); - } - return tLengthSquared; - } - - /** - * This function is commutative, such that a.angleTo(b) == b.angleTo(a). The angle - * returned is in radians and varies between 0 and 3.14(pi). It is always positive. - * - * \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer. - * - * \param vector The Vector to find the angle to. - * \return The angle between them in radians. - */ - template - inline float Vector::angleTo(const Vector& vector) const - { - return acos(static_cast(dot(vector)) / (vector.length() * this->length())); - } - - /** - * This function is used to calculate the cross product of two Vectors. - * The cross product is the Vector which is perpendicular to the two - * given Vectors. It is worth remembering that, unlike the dot product, - * it is not commutative. E.g a.b != b.a. The cross product obeys the - * right-hand rule such that if the two vectors are given by the index - * finger and middle finger respectively then the cross product is given - * by the thumb. - * \param vector The vector to cross with this - * \return The value of the cross product. - * \see dot() - */ - template - inline Vector Vector::cross(const Vector& vector) const - { - StorageType i = vector.getZ() * this->getY() - vector.getY() * this->getZ(); - StorageType j = vector.getX() * this->getZ() - vector.getZ() * this->getX(); - StorageType k = vector.getY() * this->getX() - vector.getX() * this->getY(); - return Vector(i,j,k); - } - - /** - * Calculates the dot product of the Vector and the parameter. - * This function is commutative, such that a.dot(b) == b.dot(a). - * \param rhs The Vector to find the dot product with. - * \return The value of the dot product. - * \see cross() - */ - template - inline OperationType Vector::dot(const Vector& rhs) const - { - OperationType dotProduct = static_cast(0); - for(uint32_t ct = 0; ct < Size; ++ct) - { - dotProduct += static_cast(m_tElements[ct]) * static_cast(rhs.m_tElements[ct]); - } - return dotProduct; - } - - /** - * Divides the i, j, and k components by the length to give a Vector of length 1.0. If the vector is - * very short (or zero) then a divide by zero may cause elements to take on invalid values. You may - * want to check for this before normalising. - * - * \note You should not attempt to normalise a vector whose StorageType is an integer. - */ - template - inline void Vector::normalise(void) - { - float fLength = this->length(); - - // We could wait until the NAN occurs before throwing, but then we'd have to add some roll-back code. - // This seems like a lot of overhead for a common operation which should rarely go wrong. - if(fLength <= 0.0001) - { - POLYVOX_THROW(invalid_operation, "Cannot normalise a vector with a length of zero"); - } - - for(uint32_t ct = 0; ct < Size; ++ct) - { - // Standard float rules apply for divide-by-zero - m_tElements[ct] /= fLength; - - //This shouldn't happen as we had the length check earlier. So it's probably a bug if it does happen. - POLYVOX_ASSERT(m_tElements[ct] == m_tElements[ct], "Obtained NAN during vector normalisation. Perhaps the input vector was too short?"); - } - } -}//namespace PolyVox +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +namespace PolyVox +{ + //-------------------------- Constructors, etc --------------------------------- + /** + * Creates a Vector object but does not initialise it. + */ + template + Vector::Vector(void) + { + } + + /** + * Creates a Vector object and initialises all components with the given value. + * \param tFillValue The value to write to every component. + */ + template + Vector::Vector(StorageType tFillValue) + { + for(uint32_t ct = 0; ct < Size; ct++) + { + m_tElements[ct] = tFillValue; + } + } + + /** + * Creates a Vector object and initialises it with given values. + * \param x The X component to set. + * \param y The Y component to set. + */ + template + Vector::Vector(StorageType x, StorageType y) + { + static_assert(Size == 2, "This constructor should only be used for vectors with two elements."); + + m_tElements[0] = x; + m_tElements[1] = y; + } + + /** + * Creates a Vector3D object and initialises it with given values. + * \param x The X component to set. + * \param y The Y component to set. + * \param z the Z component to set. + */ + template + Vector::Vector(StorageType x, StorageType y, StorageType z) + { + static_assert(Size == 3, "This constructor should only be used for vectors with three elements."); + + m_tElements[0] = x; + m_tElements[1] = y; + m_tElements[2] = z; + + } + + /** + * Creates a Vector3D object and initialises it with given values. + * \param x The X component to set. + * \param y The Y component to set. + * \param z The Z component to set. + * \param w The W component to set. + */ + template + Vector::Vector(StorageType x, StorageType y, StorageType z, StorageType w) + { + static_assert(Size == 4, "This constructor should only be used for vectors with four elements."); + + m_tElements[0] = x; + m_tElements[1] = y; + m_tElements[2] = z; + m_tElements[3] = w; + } + + /** + * Copy constructor builds object based on object passed as parameter. + * \param vector A reference to the Vector to be copied. + */ + template + Vector::Vector(const Vector& vector) + { + std::memcpy(m_tElements, vector.m_tElements, sizeof(StorageType) * Size); + } + + /** + * This copy constructor allows casting between vectors with different data types. + * It makes it possible to use code such as: + * + * Vector3DDouble v3dDouble(1.0,2.0,3.0); + * Vector3DFloat v3dFloat = static_cast(v3dDouble); //Casting + * + * \param vector A reference to the Vector to be copied. + */ + template + template + Vector::Vector(const Vector& vector) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] = static_cast(vector.getElement(ct)); + } + } + + /** + * Destroys the Vector. + */ + template + Vector::~Vector(void) + { + // We put the static asserts in the destructor because there is one one of these, + // where as there are multiple constructors. + + // Force a vector to have a length greater than one. There is no need for a + // vector with one element, and supporting this would cause confusion over the + // behaviour of the constructor taking a single value, as this fills all elements + // to that value rather than just the first one. + static_assert(Size > 1, "Vector must have a length greater than one."); + } + + /** + * Assignment operator copies each element of first Vector to the second. + * \param rhs Vector to assign to. + * \return A reference to the result to allow chaining. + */ + template + Vector& Vector::operator=(const Vector& rhs) + { + if(this == &rhs) + { + return *this; + } + std::memcpy(m_tElements, rhs.m_tElements, sizeof(StorageType) * Size); + return *this; + } + + /** + * Checks whether two Vectors are equal. + * \param rhs The Vector to compare to. + * \return true if the Vectors match. + * \see operator!= + */ + template + inline bool Vector::operator==(const Vector &rhs) const + { + bool equal = true; + for(uint32_t ct = 0; ct < Size; ++ct) + { + if(m_tElements[ct] != rhs.m_tElements[ct]) + { + equal = false; + break; + } + } + return equal; + } + + /** + * Checks whether two Vectors are not equal. + * \param rhs The Vector to compare to. + * \return true if the Vectors do not match. + * \see operator== + */ + template + inline bool Vector::operator!=(const Vector &rhs) const + { + return !(*this == rhs); //Just call equality operator and invert the result. + } + + /** + * Checks whether this vector is less than the parameter. The metric is + * meaningless but it allows Vectors to me used as key in sdt::map, etc. + * This function is deprecated. You should specify a seperate comparator to the std:map if you need one. + * \param rhs The Vector to compare to. + * \return true if this is less than the parameter + * \see operator!= + * \deprecated + */ + template + inline bool Vector::operator<(const Vector &rhs) const + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + if (m_tElements[ct] < rhs.m_tElements[ct]) + return true; + if (rhs.m_tElements[ct] < m_tElements[ct]) + return false; + } + return false; + } + + /** + * Addition operator adds corresponding elements of the two Vectors. + * \param rhs The Vector to add + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator+=(const Vector& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] += rhs.m_tElements[ct]; + } + return *this; + } + + /** + * Subtraction operator subtracts corresponding elements of one Vector from the other. + * \param rhs The Vector to subtract + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator-=(const Vector& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] -= rhs.m_tElements[ct]; + } + return *this; + } + + /** + * Multiplication operator multiplies corresponding elements of the two Vectors. + * \param rhs The Vector to multiply by + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator*=(const Vector& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] *= rhs.m_tElements[ct]; + } + return *this; + } + + /** + * Division operator divides corresponding elements of one Vector by the other. + * \param rhs The Vector to divide by + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator/=(const Vector& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] /= rhs.m_tElements[ct]; + } + return *this; + } + + /** + * Multiplication operator multiplies each element of the Vector by a number. + * \param rhs The number the Vector is multiplied by. + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator*=(const StorageType& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] *= rhs; + } + return *this; + } + + /** + * Division operator divides each element of the Vector by a number. + * \param rhs The number the Vector is divided by. + * \return The resulting Vector. + */ + template + inline Vector& Vector::operator/=(const StorageType& rhs) + { + for(uint32_t ct = 0; ct < Size; ++ct) + { + m_tElements[ct] /= rhs; + } + return *this; + } + + /** + * Addition operator adds corresponding elements of the two Vectors. + * \param lhs The Vector to add to. + * \param rhs The Vector to add. + * \return The resulting Vector. + */ + template + Vector operator+(const Vector& lhs, const Vector& rhs) + { + Vector result = lhs; + result += rhs; + return result; + } + + /** + * Subtraction operator subtracts corresponding elements of one Vector from the other. + * \param lhs The Vector to subtract from. + * \param rhs The Vector to subtract. + * \return The resulting Vector. + */ + template + Vector operator-(const Vector& lhs, const Vector& rhs) + { + Vector result = lhs; + result -= rhs; + return result; + } + + /** + * Multiplication operator mulitplies corresponding elements of the two Vectors. + * \param lhs The Vector to multiply. + * \param rhs The Vector to multiply by. + * \return The resulting Vector. + */ + template + Vector operator*(const Vector& lhs, const Vector& rhs) + { + Vector result = lhs; + result *= rhs; + return result; + } + + /** + * Division operator divides corresponding elements of one Vector by the other. + * \param lhs The Vector to divide. + * \param rhs The Vector to divide by. + * \return The resulting Vector. + */ + template + Vector operator/(const Vector& lhs, const Vector& rhs) + { + Vector result = lhs; + result /= rhs; + return result; + } + + /** + * Multiplication operator multiplies each element of the Vector by a number. + * \param lhs The Vector to multiply. + * \param rhs The number the Vector is multiplied by. + * \return The resulting Vector. + */ + template + Vector operator*(const Vector& lhs, const StorageType& rhs) + { + Vector result = lhs; + result *= rhs; + return result; + } + + /** + * Division operator divides each element of the Vector by a number. + * \param lhs The Vector to divide. + * \param rhs The number the Vector is divided by. + * \return The resulting Vector. + */ + template + Vector operator/(const Vector& lhs, const StorageType& rhs) + { + Vector result = lhs; + result /= rhs; + return result; + } + + /** + * Enables the Vector to be used intuitively with output streams such as cout. + * \param os The output stream to write to. + * \param vector The Vector to write to the stream. + * \return A reference to the output stream to allow chaining. + */ + template + std::ostream& operator<<(std::ostream& os, const Vector& vector) + { + os << "("; + for(uint32_t ct = 0; ct < Size; ++ct) + { + os << vector.getElement(ct); + if(ct < (Size-1)) + { + os << ","; + } + } + os << ")"; + return os; + } + + /** + * Returns the element at the given position. + * \param index The index of the element to return. + * \return The element. + */ + template + inline StorageType Vector::getElement(uint32_t index) const + { + if(index >= Size) + { + POLYVOX_THROW(std::out_of_range, "Attempted to access invalid vector element."); + } + + return m_tElements[index]; + } + + /** + * \return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector. + */ + template + inline StorageType Vector::getX(void) const + { + return m_tElements[0]; // This is fine, a Vector always contains at least two elements. + } + + /** + * \return A const reference to the Y component of a 2, 3, or 4 dimensional Vector. + */ + template + inline StorageType Vector::getY(void) const + { + return m_tElements[1]; // This is fine, a Vector always contains at least two elements. + } + + /** + * \return A const reference to the Z component of a 3 or 4 dimensional Vector. + */ + template + inline StorageType Vector::getZ(void) const + { + static_assert(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); + + return m_tElements[2]; + } + + /** + * \return A const reference to the W component of a 4 dimensional Vector. + */ + template + inline StorageType Vector::getW(void) const + { + static_assert(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); + + return m_tElements[3]; + } + + /** + * \param index The index of the element to set. + * \param tValue The new value for the element. + */ + template + inline void Vector::setElement(uint32_t index, StorageType tValue) + { + if(index >= Size) + { + POLYVOX_THROW(std::out_of_range, "Attempted to access invalid vector element."); + } + + m_tElements[index] = tValue; + } + + /** + * Sets several elements of a vector at once. + * \param x The X component to set. + * \param y The Y component to set. + */ + template + inline void Vector::setElements(StorageType x, StorageType y) + { + // This is fine, a Vector always contains at least two elements. + m_tElements[0] = x; + m_tElements[1] = y; + } + + /** + * Sets several elements of a vector at once. + * \param x The X component to set. + * \param y The Y component to set. + * \param z The Z component to set. + */ + template + inline void Vector::setElements(StorageType x, StorageType y, StorageType z) + { + static_assert(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); + + m_tElements[0] = x; + m_tElements[1] = y; + m_tElements[2] = z; + } + + /** + * Sets several elements of a vector at once. + * \param x The X component to set. + * \param y The Y component to set. + * \param z The Z component to set. + * \param w The W component to set. + */ + template + inline void Vector::setElements(StorageType x, StorageType y, StorageType z, StorageType w) + { + static_assert(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); + + m_tElements[0] = x; + m_tElements[1] = y; + m_tElements[2] = z; + m_tElements[3] = w; + } + + /** + * \param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector. + */ + template + inline void Vector::setX(StorageType tX) + { + m_tElements[0] = tX; // This is fine, a Vector always contains at least two elements. + } + + /** + * \param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector. + */ + template + inline void Vector::setY(StorageType tY) + { + m_tElements[1] = tY; // This is fine, a Vector always contains at least two elements. + } + + /** + * \param tZ The new value for the Z component of a 3 or 4 dimensional Vector. + */ + template + inline void Vector::setZ(StorageType tZ) + { + static_assert(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); + + m_tElements[2] = tZ; + } + + /** + * \param tW The new value for the W component of a 4 dimensional Vector. + */ + template + inline void Vector::setW(StorageType tW) + { + static_assert(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); + + m_tElements[3] = tW; + } + + /** + * \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer. + * \return The length of the Vector. + */ + template + inline float Vector::length(void) const + { + return sqrt(static_cast(lengthSquared())); + } + + /** + * \return The squared length of the Vector. + */ + template + inline OperationType Vector::lengthSquared(void) const + { + OperationType tLengthSquared = static_cast(0); + for(uint32_t ct = 0; ct < Size; ++ct) + { + tLengthSquared += static_cast(m_tElements[ct]) * static_cast(m_tElements[ct]); + } + return tLengthSquared; + } + + /** + * This function is commutative, such that a.angleTo(b) == b.angleTo(a). The angle + * returned is in radians and varies between 0 and 3.14(pi). It is always positive. + * + * \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer. + * + * \param vector The Vector to find the angle to. + * \return The angle between them in radians. + */ + template + inline float Vector::angleTo(const Vector& vector) const + { + return acos(static_cast(dot(vector)) / (vector.length() * this->length())); + } + + /** + * This function is used to calculate the cross product of two Vectors. + * The cross product is the Vector which is perpendicular to the two + * given Vectors. It is worth remembering that, unlike the dot product, + * it is not commutative. E.g a.b != b.a. The cross product obeys the + * right-hand rule such that if the two vectors are given by the index + * finger and middle finger respectively then the cross product is given + * by the thumb. + * \param vector The vector to cross with this + * \return The value of the cross product. + * \see dot() + */ + template + inline Vector Vector::cross(const Vector& vector) const + { + StorageType i = vector.getZ() * this->getY() - vector.getY() * this->getZ(); + StorageType j = vector.getX() * this->getZ() - vector.getZ() * this->getX(); + StorageType k = vector.getY() * this->getX() - vector.getX() * this->getY(); + return Vector(i,j,k); + } + + /** + * Calculates the dot product of the Vector and the parameter. + * This function is commutative, such that a.dot(b) == b.dot(a). + * \param rhs The Vector to find the dot product with. + * \return The value of the dot product. + * \see cross() + */ + template + inline OperationType Vector::dot(const Vector& rhs) const + { + OperationType dotProduct = static_cast(0); + for(uint32_t ct = 0; ct < Size; ++ct) + { + dotProduct += static_cast(m_tElements[ct]) * static_cast(rhs.m_tElements[ct]); + } + return dotProduct; + } + + /** + * Divides the i, j, and k components by the length to give a Vector of length 1.0. If the vector is + * very short (or zero) then a divide by zero may cause elements to take on invalid values. You may + * want to check for this before normalising. + * + * \note You should not attempt to normalise a vector whose StorageType is an integer. + */ + template + inline void Vector::normalise(void) + { + float fLength = this->length(); + + // We could wait until the NAN occurs before throwing, but then we'd have to add some roll-back code. + // This seems like a lot of overhead for a common operation which should rarely go wrong. + if(fLength <= 0.0001) + { + POLYVOX_THROW(invalid_operation, "Cannot normalise a vector with a length of zero"); + } + + for(uint32_t ct = 0; ct < Size; ++ct) + { + // Standard float rules apply for divide-by-zero + m_tElements[ct] /= fLength; + + //This shouldn't happen as we had the length check earlier. So it's probably a bug if it does happen. + POLYVOX_ASSERT(m_tElements[ct] == m_tElements[ct], "Obtained NAN during vector normalisation. Perhaps the input vector was too short?"); + } + } +}//namespace PolyVox diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h index 5074a92c..ec7aed00 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h @@ -1,57 +1,57 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_VolumeResampler_H__ -#define __PolyVox_VolumeResampler_H__ - -#include "PolyVoxCore/Region.h" - -namespace PolyVox -{ - template< typename SrcVolumeType, typename DstVolumeType> - class VolumeResampler - { - public: - VolumeResampler(SrcVolumeType* pVolSrc, const Region& regSrc, DstVolumeType* pVolDst, const Region& regDst); - - void execute(); - - private: - void resampleSameSize(); - void resampleArbitrary(); - - //Source data - SrcVolumeType* m_pVolSrc; - Region m_regSrc; - - //Destination data - DstVolumeType* m_pVolDst; - Region m_regDst; - }; - -}//namespace PolyVox - -#include "PolyVoxCore/VolumeResampler.inl" - -#endif - +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_VolumeResampler_H__ +#define __PolyVox_VolumeResampler_H__ + +#include "PolyVoxCore/Region.h" + +namespace PolyVox +{ + template< typename SrcVolumeType, typename DstVolumeType> + class VolumeResampler + { + public: + VolumeResampler(SrcVolumeType* pVolSrc, const Region& regSrc, DstVolumeType* pVolDst, const Region& regDst); + + void execute(); + + private: + void resampleSameSize(); + void resampleArbitrary(); + + //Source data + SrcVolumeType* m_pVolSrc; + Region m_regSrc; + + //Destination data + DstVolumeType* m_pVolDst; + Region m_regDst; + }; + +}//namespace PolyVox + +#include "PolyVoxCore/VolumeResampler.inl" + +#endif + diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index 2c6c129d..ae09dfb9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -1,138 +1,138 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Interpolation.h" - -#include - -namespace PolyVox -{ - /** - * \param pVolSrc - * \param regSrc - * \param[out] pVolDst - * \param regDst - */ - template< typename SrcVolumeType, typename DstVolumeType> - VolumeResampler::VolumeResampler(SrcVolumeType* pVolSrc, const Region ®Src, DstVolumeType* pVolDst, const Region& regDst) - :m_pVolSrc(pVolSrc) - ,m_regSrc(regSrc) - ,m_pVolDst(pVolDst) - ,m_regDst(regDst) - { - } - - template< typename SrcVolumeType, typename DstVolumeType> - void VolumeResampler::execute() - { - int32_t uSrcWidth = m_regSrc.getUpperX() - m_regSrc.getLowerX() + 1; - int32_t uSrcHeight = m_regSrc.getUpperY() - m_regSrc.getLowerY() + 1; - int32_t uSrcDepth = m_regSrc.getUpperZ() - m_regSrc.getLowerZ() + 1; - - int32_t uDstWidth = m_regDst.getUpperX() - m_regDst.getLowerX() + 1; - int32_t uDstHeight = m_regDst.getUpperY() - m_regDst.getLowerY() + 1; - int32_t uDstDepth = m_regDst.getUpperZ() - m_regDst.getLowerZ() + 1; - - if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) - { - resampleSameSize(); - } - else - { - resampleArbitrary(); - } - } - - template< typename SrcVolumeType, typename DstVolumeType> - void VolumeResampler::resampleSameSize() - { - for(int32_t sz = m_regSrc.getLowerZ(), dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); sz++, dz++) - { - for(int32_t sy = m_regSrc.getLowerY(), dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); sy++, dy++) - { - for(int32_t sx = m_regSrc.getLowerX(), dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); sx++,dx++) - { - const typename SrcVolumeType::VoxelType& tSrcVoxel = m_pVolSrc->getVoxel(sx,sy,sz, WrapModes::AssumeValid); // FIXME use templatised version of getVoxel(), but watch out for Linux compile issues. - const typename DstVolumeType::VoxelType& tDstVoxel = static_cast(tSrcVoxel); - m_pVolDst->setVoxelAt(dx,dy,dz,tDstVoxel); - } - } - } - } - - template< typename SrcVolumeType, typename DstVolumeType> - void VolumeResampler::resampleArbitrary() - { - float srcWidth = m_regSrc.getWidthInCells(); - float srcHeight = m_regSrc.getHeightInCells(); - float srcDepth = m_regSrc.getDepthInCells(); - - float dstWidth = m_regDst.getWidthInCells(); - float dstHeight = m_regDst.getHeightInCells(); - float dstDepth = m_regDst.getDepthInCells(); - - float fScaleX = srcWidth / dstWidth; - float fScaleY = srcHeight / dstHeight; - float fScaleZ = srcDepth / dstDepth; - - typename SrcVolumeType::Sampler sampler(m_pVolSrc); - - for(int32_t dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); dz++) - { - for(int32_t dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); dy++) - { - for(int32_t dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); dx++) - { - float sx = (dx - m_regDst.getLowerX()) * fScaleX; - float sy = (dy - m_regDst.getLowerY()) * fScaleY; - float sz = (dz - m_regDst.getLowerZ()) * fScaleZ; - - sx += m_regSrc.getLowerX(); - sy += m_regSrc.getLowerY(); - sz += m_regSrc.getLowerZ(); - - sampler.setPosition(sx,sy,sz); - const typename SrcVolumeType::VoxelType& voxel000 = sampler.peekVoxel0px0py0pz(); - const typename SrcVolumeType::VoxelType& voxel001 = sampler.peekVoxel0px0py1pz(); - const typename SrcVolumeType::VoxelType& voxel010 = sampler.peekVoxel0px1py0pz(); - const typename SrcVolumeType::VoxelType& voxel011 = sampler.peekVoxel0px1py1pz(); - const typename SrcVolumeType::VoxelType& voxel100 = sampler.peekVoxel1px0py0pz(); - const typename SrcVolumeType::VoxelType& voxel101 = sampler.peekVoxel1px0py1pz(); - const typename SrcVolumeType::VoxelType& voxel110 = sampler.peekVoxel1px1py0pz(); - const typename SrcVolumeType::VoxelType& voxel111 = sampler.peekVoxel1px1py1pz(); - - //FIXME - should accept all float parameters, but GCC complains? - double dummy; - sx = modf(sx, &dummy); - sy = modf(sy, &dummy); - sz = modf(sz, &dummy); - - typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); - - typename DstVolumeType::VoxelType result = static_cast(tInterpolatedValue); - m_pVolDst->setVoxelAt(dx,dy,dz,result); - } - } - } - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Interpolation.h" + +#include + +namespace PolyVox +{ + /** + * \param pVolSrc + * \param regSrc + * \param[out] pVolDst + * \param regDst + */ + template< typename SrcVolumeType, typename DstVolumeType> + VolumeResampler::VolumeResampler(SrcVolumeType* pVolSrc, const Region ®Src, DstVolumeType* pVolDst, const Region& regDst) + :m_pVolSrc(pVolSrc) + ,m_regSrc(regSrc) + ,m_pVolDst(pVolDst) + ,m_regDst(regDst) + { + } + + template< typename SrcVolumeType, typename DstVolumeType> + void VolumeResampler::execute() + { + int32_t uSrcWidth = m_regSrc.getUpperX() - m_regSrc.getLowerX() + 1; + int32_t uSrcHeight = m_regSrc.getUpperY() - m_regSrc.getLowerY() + 1; + int32_t uSrcDepth = m_regSrc.getUpperZ() - m_regSrc.getLowerZ() + 1; + + int32_t uDstWidth = m_regDst.getUpperX() - m_regDst.getLowerX() + 1; + int32_t uDstHeight = m_regDst.getUpperY() - m_regDst.getLowerY() + 1; + int32_t uDstDepth = m_regDst.getUpperZ() - m_regDst.getLowerZ() + 1; + + if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth)) + { + resampleSameSize(); + } + else + { + resampleArbitrary(); + } + } + + template< typename SrcVolumeType, typename DstVolumeType> + void VolumeResampler::resampleSameSize() + { + for(int32_t sz = m_regSrc.getLowerZ(), dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); sz++, dz++) + { + for(int32_t sy = m_regSrc.getLowerY(), dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); sy++, dy++) + { + for(int32_t sx = m_regSrc.getLowerX(), dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); sx++,dx++) + { + const typename SrcVolumeType::VoxelType& tSrcVoxel = m_pVolSrc->getVoxel(sx,sy,sz, WrapModes::AssumeValid); // FIXME use templatised version of getVoxel(), but watch out for Linux compile issues. + const typename DstVolumeType::VoxelType& tDstVoxel = static_cast(tSrcVoxel); + m_pVolDst->setVoxelAt(dx,dy,dz,tDstVoxel); + } + } + } + } + + template< typename SrcVolumeType, typename DstVolumeType> + void VolumeResampler::resampleArbitrary() + { + float srcWidth = m_regSrc.getWidthInCells(); + float srcHeight = m_regSrc.getHeightInCells(); + float srcDepth = m_regSrc.getDepthInCells(); + + float dstWidth = m_regDst.getWidthInCells(); + float dstHeight = m_regDst.getHeightInCells(); + float dstDepth = m_regDst.getDepthInCells(); + + float fScaleX = srcWidth / dstWidth; + float fScaleY = srcHeight / dstHeight; + float fScaleZ = srcDepth / dstDepth; + + typename SrcVolumeType::Sampler sampler(m_pVolSrc); + + for(int32_t dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); dz++) + { + for(int32_t dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); dy++) + { + for(int32_t dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); dx++) + { + float sx = (dx - m_regDst.getLowerX()) * fScaleX; + float sy = (dy - m_regDst.getLowerY()) * fScaleY; + float sz = (dz - m_regDst.getLowerZ()) * fScaleZ; + + sx += m_regSrc.getLowerX(); + sy += m_regSrc.getLowerY(); + sz += m_regSrc.getLowerZ(); + + sampler.setPosition(sx,sy,sz); + const typename SrcVolumeType::VoxelType& voxel000 = sampler.peekVoxel0px0py0pz(); + const typename SrcVolumeType::VoxelType& voxel001 = sampler.peekVoxel0px0py1pz(); + const typename SrcVolumeType::VoxelType& voxel010 = sampler.peekVoxel0px1py0pz(); + const typename SrcVolumeType::VoxelType& voxel011 = sampler.peekVoxel0px1py1pz(); + const typename SrcVolumeType::VoxelType& voxel100 = sampler.peekVoxel1px0py0pz(); + const typename SrcVolumeType::VoxelType& voxel101 = sampler.peekVoxel1px0py1pz(); + const typename SrcVolumeType::VoxelType& voxel110 = sampler.peekVoxel1px1py0pz(); + const typename SrcVolumeType::VoxelType& voxel111 = sampler.peekVoxel1px1py1pz(); + + //FIXME - should accept all float parameters, but GCC complains? + double dummy; + sx = modf(sx, &dummy); + sy = modf(sy, &dummy); + sz = modf(sz, &dummy); + + typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz); + + typename DstVolumeType::VoxelType result = static_cast(tInterpolatedValue); + m_pVolDst->setVoxelAt(dx,dy,dz,result); + } + } + } + } +} diff --git a/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h b/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h index 00df1ed1..1c54b9ea 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h @@ -1,37 +1,37 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#ifndef __PolyVox_VoxelFilters_H__ -#define __PolyVox_VoxelFilters_H__ - -#include "Impl/TypeDef.h" - -namespace PolyVox -{ - template< typename VolumeType > - float computeSmoothedVoxel(typename VolumeType::Sampler& volIter); -} - -#include "PolyVoxCore/VoxelFilters.inl" - -#endif +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_VoxelFilters_H__ +#define __PolyVox_VoxelFilters_H__ + +#include "Impl/TypeDef.h" + +namespace PolyVox +{ + template< typename VolumeType > + float computeSmoothedVoxel(typename VolumeType::Sampler& volIter); +} + +#include "PolyVoxCore/VoxelFilters.inl" + +#endif diff --git a/library/PolyVoxCore/source/AStarPathfinder.cpp b/library/PolyVoxCore/source/AStarPathfinder.cpp index fcb58ca2..83d42db1 100644 --- a/library/PolyVoxCore/source/AStarPathfinder.cpp +++ b/library/PolyVoxCore/source/AStarPathfinder.cpp @@ -1,67 +1,67 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/AStarPathfinder.h" - -using namespace PolyVox; - -namespace PolyVox -{ - const Vector3DInt32 arrayPathfinderFaces[6] = - { - Vector3DInt32(0, 0, -1), - Vector3DInt32(0, 0, +1), - Vector3DInt32(0, -1, 0), - Vector3DInt32(0, +1, 0), - Vector3DInt32(-1, 0, 0), - Vector3DInt32(+1, 0, 0) - }; - - const Vector3DInt32 arrayPathfinderEdges[12] = - { - Vector3DInt32(0, -1, -1), - Vector3DInt32(0, -1, +1), - Vector3DInt32(0, +1, -1), - Vector3DInt32(0, +1, +1), - Vector3DInt32(-1, 0, -1), - Vector3DInt32(-1, 0, +1), - Vector3DInt32(+1, 0, -1), - Vector3DInt32(+1, 0, +1), - Vector3DInt32(-1, -1, 0), - Vector3DInt32(-1, +1, 0), - Vector3DInt32(+1, -1, 0), - Vector3DInt32(+1, +1, 0) - }; - - const Vector3DInt32 arrayPathfinderCorners[8] = - { - Vector3DInt32(-1, -1, -1), - Vector3DInt32(-1, -1, +1), - Vector3DInt32(-1, +1, -1), - Vector3DInt32(-1, +1, +1), - Vector3DInt32(+1, -1, -1), - Vector3DInt32(+1, -1, +1), - Vector3DInt32(+1, +1, -1), - Vector3DInt32(+1, +1, +1) - }; -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/AStarPathfinder.h" + +using namespace PolyVox; + +namespace PolyVox +{ + const Vector3DInt32 arrayPathfinderFaces[6] = + { + Vector3DInt32(0, 0, -1), + Vector3DInt32(0, 0, +1), + Vector3DInt32(0, -1, 0), + Vector3DInt32(0, +1, 0), + Vector3DInt32(-1, 0, 0), + Vector3DInt32(+1, 0, 0) + }; + + const Vector3DInt32 arrayPathfinderEdges[12] = + { + Vector3DInt32(0, -1, -1), + Vector3DInt32(0, -1, +1), + Vector3DInt32(0, +1, -1), + Vector3DInt32(0, +1, +1), + Vector3DInt32(-1, 0, -1), + Vector3DInt32(-1, 0, +1), + Vector3DInt32(+1, 0, -1), + Vector3DInt32(+1, 0, +1), + Vector3DInt32(-1, -1, 0), + Vector3DInt32(-1, +1, 0), + Vector3DInt32(+1, -1, 0), + Vector3DInt32(+1, +1, 0) + }; + + const Vector3DInt32 arrayPathfinderCorners[8] = + { + Vector3DInt32(-1, -1, -1), + Vector3DInt32(-1, -1, +1), + Vector3DInt32(-1, +1, -1), + Vector3DInt32(-1, +1, +1), + Vector3DInt32(+1, -1, -1), + Vector3DInt32(+1, -1, +1), + Vector3DInt32(+1, +1, -1), + Vector3DInt32(+1, +1, +1) + }; +} diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index 81c7389d..ca2d7337 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -1,519 +1,519 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Region.h" - -#include -#include - -namespace PolyVox -{ - /** - */ - const Region Region::MaxRegion - ( - Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()), - Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()) - ); - - /** - * This Region is not considered valid as defined by isValid(). It's main application - * is to initialise a Region to this value and then() accumulate positions. The result - * of this will be a Region which encompasses all positions specified. - */ - const Region Region::InvertedRegion - ( - Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()), - Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()) - ); - - /** - * \param iX The 'x' component of the position to accumulate. - * \param iY The 'y' component of the position to accumulate. - * \param iZ The 'z' component of the position to accumulate. - */ - void Region::accumulate(int32_t iX, int32_t iY, int32_t iZ) - { - m_iLowerX = ((std::min)(m_iLowerX, iX)); - m_iLowerY = ((std::min)(m_iLowerY, iY)); - m_iLowerZ = ((std::min)(m_iLowerZ, iZ)); - m_iUpperX = ((std::max)(m_iUpperX, iX)); - m_iUpperY = ((std::max)(m_iUpperY, iY)); - m_iUpperZ = ((std::max)(m_iUpperZ, iZ)); - } - - /** - * \param v3dPos The position to accumulate. - */ - void Region::accumulate(const Vector3DInt32& v3dPos) - { - accumulate(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); - } - - /** - * Note that this is not the same as computing the union of two Regions (as the result of - * such a union may not be a shape which can be exactly represented by a Region). Instead, - * the result is simply big enough to contain both this Region and the one passed as a parameter. - * \param reg The Region to accumulate. This must be valid as defined by the isValid() function. - * \sa isValid() - */ - void Region::accumulate(const Region& reg) - { - if(!reg.isValid()) - { - POLYVOX_THROW(invalid_operation, "You cannot accumulate an invalid region."); //The result of accumulating an invalid region is not defined. - } - - m_iLowerX = ((std::min)(m_iLowerX, reg.getLowerX())); - m_iLowerY = ((std::min)(m_iLowerY, reg.getLowerY())); - m_iLowerZ = ((std::min)(m_iLowerZ, reg.getLowerZ())); - m_iUpperX = ((std::max)(m_iUpperX, reg.getUpperX())); - m_iUpperY = ((std::max)(m_iUpperY, reg.getUpperY())); - m_iUpperZ = ((std::max)(m_iUpperZ, reg.getUpperZ())); - } - - /** - * Constructs a Region and clears all extents to zero. - */ - Region::Region() - :m_iLowerX(0) - ,m_iLowerY(0) - ,m_iLowerZ(0) - ,m_iUpperX(0) - ,m_iUpperY(0) - ,m_iUpperZ(0) - { - } - - /** - * Constructs a Region and sets the lower and upper corners to the specified values. - * \param v3dLowerCorner The desired lower corner of the Region. - * \param v3dUpperCorner The desired upper corner of the Region. - */ - Region::Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner) - :m_iLowerX(v3dLowerCorner.getX()) - ,m_iLowerY(v3dLowerCorner.getY()) - ,m_iLowerZ(v3dLowerCorner.getZ()) - ,m_iUpperX(v3dUpperCorner.getX()) - ,m_iUpperY(v3dUpperCorner.getY()) - ,m_iUpperZ(v3dUpperCorner.getZ()) - { - } - - /** - * Constructs a Region and sets the extents to the specified values. - * \param iLowerX The desired lower 'x' extent of the Region. - * \param iLowerY The desired lower 'y' extent of the Region. - * \param iLowerZ The desired lower 'z' extent of the Region. - * \param iUpperX The desired upper 'x' extent of the Region. - * \param iUpperY The desired upper 'y' extent of the Region. - * \param iUpperZ The desired upper 'z' extent of the Region. - */ - Region::Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ) - :m_iLowerX(iLowerX) - ,m_iLowerY(iLowerY) - ,m_iLowerZ(iLowerZ) - ,m_iUpperX(iUpperX) - ,m_iUpperY(iUpperY) - ,m_iUpperZ(iUpperZ) - { - } - - /** - * Two regions are considered equal if all their extents match. - * \param rhs The Region to compare to. - * \return true if the Regions match. - * \sa operator!= - */ - bool Region::operator==(const Region& rhs) const - { - return ((m_iLowerX == rhs.m_iLowerX) && (m_iLowerY == rhs.m_iLowerY) && (m_iLowerZ == rhs.m_iLowerZ) - && (m_iUpperX == rhs.m_iUpperX) && (m_iUpperY == rhs.m_iUpperY) && (m_iUpperZ == rhs.m_iUpperZ)); - } - - /** - * Two regions are considered different if any of their extents differ. - * \param rhs The Region to compare to. - * \return true if the Regions are different. - * \sa operator== - */ - bool Region::operator!=(const Region& rhs) const - { - return !(*this == rhs); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in all directions. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param fX The 'x' position of the point to test. - * \param fY The 'y' position of the point to test. - * \param fZ The 'z' position of the point to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPoint(float fX, float fY, float fZ, float boundary) const - { - return (fX <= m_iUpperX - boundary) - && (fY <= m_iUpperY - boundary) - && (fZ <= m_iUpperZ - boundary) - && (fX >= m_iLowerX + boundary) - && (fY >= m_iLowerY + boundary) - && (fZ >= m_iLowerZ + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in all directions. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPoint(const Vector3DFloat& pos, float boundary) const - { - return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in all directions. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param iX The 'x' position of the point to test. - * \param iY The 'y' position of the point to test. - * \param iZ The 'z' position of the point to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const - { - return (iX <= m_iUpperX - boundary) - && (iY <= m_iUpperY - boundary) - && (iZ <= m_iUpperZ - boundary) - && (iX >= m_iLowerX + boundary) - && (iY >= m_iLowerY + boundary) - && (iZ >= m_iLowerZ + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in all directions. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const - { - return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'x' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInX(float pos, float boundary) const - { - return (pos <= m_iUpperX - boundary) - && (pos >= m_iLowerX + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'x' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInX(int32_t pos, uint8_t boundary) const - { - return (pos <= m_iUpperX - boundary) - && (pos >= m_iLowerX + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'y' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInY(float pos, float boundary) const - { - return (pos <= m_iUpperY - boundary) - && (pos >= m_iLowerY + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'y' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInY(int32_t pos, uint8_t boundary) const - { - return (pos <= m_iUpperY - boundary) - && (pos >= m_iLowerY + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'z' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInZ(float pos, float boundary) const - { - return (pos <= m_iUpperZ - boundary) - && (pos >= m_iLowerZ + boundary); - } - - /** - * The boundary value can be used to ensure a position is only considered to be inside - * the Region if it is that far in in the 'z' direction. Also, the test is inclusive such - * that positions lying exactly on the edge of the Region are considered to be inside it. - * \param pos The position to test. - * \param boundary The desired boundary value. - */ - bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const - { - return (pos <= m_iUpperZ - boundary) - && (pos >= m_iLowerZ + boundary); - } - - /** - * The boundary value can be used to ensure a region is only considered to be inside - * another Region if it is that far in in all directions. Also, the test is inclusive such - * that a region is considered to be inside of itself. - * \param reg The region to test. - * \param boundary The desired boundary value. - */ - bool Region::containsRegion(const Region& reg, uint8_t boundary) const - { - return (reg.m_iUpperX <= m_iUpperX - boundary) - && (reg.m_iUpperY <= m_iUpperY - boundary) - && (reg.m_iUpperZ <= m_iUpperZ - boundary) - && (reg.m_iLowerX >= m_iLowerX + boundary) - && (reg.m_iLowerY >= m_iLowerY + boundary) - && (reg.m_iLowerZ >= m_iLowerZ + boundary); - } - - /** - * After calling this functions, the extents of this Region are given by the intersection - * of this Region and the one it was cropped to. - * \param other The Region to crop to. - */ - void Region::cropTo(const Region& other) - { - m_iLowerX = ((std::max)(m_iLowerX, other.m_iLowerX)); - m_iLowerY = ((std::max)(m_iLowerY, other.m_iLowerY)); - m_iLowerZ = ((std::max)(m_iLowerZ, other.m_iLowerZ)); - m_iUpperX = ((std::min)(m_iUpperX, other.m_iUpperX)); - m_iUpperY = ((std::min)(m_iUpperY, other.m_iUpperY)); - m_iUpperZ = ((std::min)(m_iUpperZ, other.m_iUpperZ)); - } - - /** - * The same amount of growth is applied in all directions. Negative growth - * is possible but you should prefer the shrink() function for clarity. - * \param iAmount The amount to grow by. - */ - void Region::grow(int32_t iAmount) - { - m_iLowerX -= iAmount; - m_iLowerY -= iAmount; - m_iLowerZ -= iAmount; - - m_iUpperX += iAmount; - m_iUpperY += iAmount; - m_iUpperZ += iAmount; - } - - /** - * The amount can be specified seperatly for each direction. Negative growth - * is possible but you should prefer the shrink() function for clarity. - * \param iAmountX The amount to grow by in 'x'. - * \param iAmountY The amount to grow by in 'y'. - * \param iAmountZ The amount to grow by in 'z'. - */ - void Region::grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - m_iLowerX -= iAmountX; - m_iLowerY -= iAmountY; - m_iLowerZ -= iAmountZ; - - m_iUpperX += iAmountX; - m_iUpperY += iAmountY; - m_iUpperZ += iAmountZ; - } - - /** - * The amount can be specified seperatly for each direction. Negative growth - * is possible but you should prefer the shrink() function for clarity. - * \param v3dAmount The amount to grow by (one component for each direction). - */ - void Region::grow(const Vector3DInt32& v3dAmount) - { - grow(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); - } - - /** - */ - bool Region::isValid(void) const - { - return (m_iUpperX >= m_iLowerX) && (m_iUpperY >= m_iLowerY) && (m_iUpperZ >= m_iLowerZ); - } - - /** - * \param iAmountX The amount to move the Region by in 'x'. - * \param iAmountY The amount to move the Region by in 'y'. - * \param iAmountZ The amount to move the Region by in 'z'. - */ - void Region::shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - shiftLowerCorner(iAmountX, iAmountY, iAmountZ); - shiftUpperCorner(iAmountX, iAmountY, iAmountZ); - } - - /** - * \param v3dAmount The amount to move the Region by. - */ - void Region::shift(const Vector3DInt32& v3dAmount) - { - shiftLowerCorner(v3dAmount); - shiftUpperCorner(v3dAmount); - } - - /** - * \param iAmountX The amount to move the lower corner by in 'x'. - * \param iAmountY The amount to move the lower corner by in 'y'. - * \param iAmountZ The amount to move the lower corner by in 'z'. - */ - void Region::shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - m_iLowerX += iAmountX; - m_iLowerY += iAmountY; - m_iLowerZ += iAmountZ; - } - - /** - * \param v3dAmount The amount to move the lower corner by. - */ - void Region::shiftLowerCorner(const Vector3DInt32& v3dAmount) - { - shiftLowerCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); - } - - /** - * \param iAmountX The amount to move the upper corner by in 'x'. - * \param iAmountY The amount to move the upper corner by in 'y'. - * \param iAmountZ The amount to move the upper corner by in 'z'. - */ - void Region::shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - m_iUpperX += iAmountX; - m_iUpperY += iAmountY; - m_iUpperZ += iAmountZ; - } - - /** - * \param v3dAmount The amount to move the upper corner by. - */ - void Region::shiftUpperCorner(const Vector3DInt32& v3dAmount) - { - shiftUpperCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); - } - - /** - * The same amount of shrinkage is applied in all directions. Negative shrinkage - * is possible but you should prefer the grow() function for clarity. - * \param iAmount The amount to shrink by. - */ - void Region::shrink(int32_t iAmount) - { - m_iLowerX += iAmount; - m_iLowerY += iAmount; - m_iLowerZ += iAmount; - - m_iUpperX -= iAmount; - m_iUpperY -= iAmount; - m_iUpperZ -= iAmount; - } - - /** - * The amount can be specified seperatly for each direction. Negative shrinkage - * is possible but you should prefer the grow() function for clarity. - * \param iAmountX The amount to shrink by in 'x'. - * \param iAmountY The amount to shrink by in 'y'. - * \param iAmountZ The amount to shrink by in 'z'. - */ - void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - m_iLowerX += iAmountX; - m_iLowerY += iAmountY; - m_iLowerZ += iAmountZ; - - m_iUpperX -= iAmountX; - m_iUpperY -= iAmountY; - m_iUpperZ -= iAmountZ; - } - - /** - * The amount can be specified seperatly for each direction. Negative shrinkage - * is possible but you should prefer the grow() function for clarity. - * \param v3dAmount The amount to shrink by (one component for each direction). - */ - void Region::shrink(const Vector3DInt32& v3dAmount) - { - shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); - } - - /** - * This function only returns true if the regions are really intersecting and not simply touching. - */ - - bool intersects(const Region& a, const Region& b) - { - // No intersection if seperated along an axis. - if(a.getUpperX() < b.getLowerX() || a.getLowerX() > b.getUpperX()) return false; - if(a.getUpperY() < b.getLowerY() || a.getLowerY() > b.getUpperY()) return false; - if(a.getUpperZ() < b.getLowerZ() || a.getLowerZ() > b.getUpperZ()) return false; - - // Overlapping on all axes means Regions are intersecting. - return true; - } - - /** - * Enables the Region to be used intuitively with output streams such as cout. - * \param os The output stream to write to. - * \param region The Region to write to the stream. - * \return A reference to the output stream to allow chaining. - */ - std::ostream& operator<<(std::ostream& os, const Region& region) - { - os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() << - ") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")"; - return os; - } -} +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "PolyVoxCore/Region.h" + +#include +#include + +namespace PolyVox +{ + /** + */ + const Region Region::MaxRegion + ( + Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()), + Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()) + ); + + /** + * This Region is not considered valid as defined by isValid(). It's main application + * is to initialise a Region to this value and then() accumulate positions. The result + * of this will be a Region which encompasses all positions specified. + */ + const Region Region::InvertedRegion + ( + Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()), + Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()) + ); + + /** + * \param iX The 'x' component of the position to accumulate. + * \param iY The 'y' component of the position to accumulate. + * \param iZ The 'z' component of the position to accumulate. + */ + void Region::accumulate(int32_t iX, int32_t iY, int32_t iZ) + { + m_iLowerX = ((std::min)(m_iLowerX, iX)); + m_iLowerY = ((std::min)(m_iLowerY, iY)); + m_iLowerZ = ((std::min)(m_iLowerZ, iZ)); + m_iUpperX = ((std::max)(m_iUpperX, iX)); + m_iUpperY = ((std::max)(m_iUpperY, iY)); + m_iUpperZ = ((std::max)(m_iUpperZ, iZ)); + } + + /** + * \param v3dPos The position to accumulate. + */ + void Region::accumulate(const Vector3DInt32& v3dPos) + { + accumulate(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); + } + + /** + * Note that this is not the same as computing the union of two Regions (as the result of + * such a union may not be a shape which can be exactly represented by a Region). Instead, + * the result is simply big enough to contain both this Region and the one passed as a parameter. + * \param reg The Region to accumulate. This must be valid as defined by the isValid() function. + * \sa isValid() + */ + void Region::accumulate(const Region& reg) + { + if(!reg.isValid()) + { + POLYVOX_THROW(invalid_operation, "You cannot accumulate an invalid region."); //The result of accumulating an invalid region is not defined. + } + + m_iLowerX = ((std::min)(m_iLowerX, reg.getLowerX())); + m_iLowerY = ((std::min)(m_iLowerY, reg.getLowerY())); + m_iLowerZ = ((std::min)(m_iLowerZ, reg.getLowerZ())); + m_iUpperX = ((std::max)(m_iUpperX, reg.getUpperX())); + m_iUpperY = ((std::max)(m_iUpperY, reg.getUpperY())); + m_iUpperZ = ((std::max)(m_iUpperZ, reg.getUpperZ())); + } + + /** + * Constructs a Region and clears all extents to zero. + */ + Region::Region() + :m_iLowerX(0) + ,m_iLowerY(0) + ,m_iLowerZ(0) + ,m_iUpperX(0) + ,m_iUpperY(0) + ,m_iUpperZ(0) + { + } + + /** + * Constructs a Region and sets the lower and upper corners to the specified values. + * \param v3dLowerCorner The desired lower corner of the Region. + * \param v3dUpperCorner The desired upper corner of the Region. + */ + Region::Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner) + :m_iLowerX(v3dLowerCorner.getX()) + ,m_iLowerY(v3dLowerCorner.getY()) + ,m_iLowerZ(v3dLowerCorner.getZ()) + ,m_iUpperX(v3dUpperCorner.getX()) + ,m_iUpperY(v3dUpperCorner.getY()) + ,m_iUpperZ(v3dUpperCorner.getZ()) + { + } + + /** + * Constructs a Region and sets the extents to the specified values. + * \param iLowerX The desired lower 'x' extent of the Region. + * \param iLowerY The desired lower 'y' extent of the Region. + * \param iLowerZ The desired lower 'z' extent of the Region. + * \param iUpperX The desired upper 'x' extent of the Region. + * \param iUpperY The desired upper 'y' extent of the Region. + * \param iUpperZ The desired upper 'z' extent of the Region. + */ + Region::Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ) + :m_iLowerX(iLowerX) + ,m_iLowerY(iLowerY) + ,m_iLowerZ(iLowerZ) + ,m_iUpperX(iUpperX) + ,m_iUpperY(iUpperY) + ,m_iUpperZ(iUpperZ) + { + } + + /** + * Two regions are considered equal if all their extents match. + * \param rhs The Region to compare to. + * \return true if the Regions match. + * \sa operator!= + */ + bool Region::operator==(const Region& rhs) const + { + return ((m_iLowerX == rhs.m_iLowerX) && (m_iLowerY == rhs.m_iLowerY) && (m_iLowerZ == rhs.m_iLowerZ) + && (m_iUpperX == rhs.m_iUpperX) && (m_iUpperY == rhs.m_iUpperY) && (m_iUpperZ == rhs.m_iUpperZ)); + } + + /** + * Two regions are considered different if any of their extents differ. + * \param rhs The Region to compare to. + * \return true if the Regions are different. + * \sa operator== + */ + bool Region::operator!=(const Region& rhs) const + { + return !(*this == rhs); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in all directions. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param fX The 'x' position of the point to test. + * \param fY The 'y' position of the point to test. + * \param fZ The 'z' position of the point to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPoint(float fX, float fY, float fZ, float boundary) const + { + return (fX <= m_iUpperX - boundary) + && (fY <= m_iUpperY - boundary) + && (fZ <= m_iUpperZ - boundary) + && (fX >= m_iLowerX + boundary) + && (fY >= m_iLowerY + boundary) + && (fZ >= m_iLowerZ + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in all directions. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPoint(const Vector3DFloat& pos, float boundary) const + { + return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in all directions. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param iX The 'x' position of the point to test. + * \param iY The 'y' position of the point to test. + * \param iZ The 'z' position of the point to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const + { + return (iX <= m_iUpperX - boundary) + && (iY <= m_iUpperY - boundary) + && (iZ <= m_iUpperZ - boundary) + && (iX >= m_iLowerX + boundary) + && (iY >= m_iLowerY + boundary) + && (iZ >= m_iLowerZ + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in all directions. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const + { + return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'x' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInX(float pos, float boundary) const + { + return (pos <= m_iUpperX - boundary) + && (pos >= m_iLowerX + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'x' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInX(int32_t pos, uint8_t boundary) const + { + return (pos <= m_iUpperX - boundary) + && (pos >= m_iLowerX + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'y' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInY(float pos, float boundary) const + { + return (pos <= m_iUpperY - boundary) + && (pos >= m_iLowerY + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'y' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInY(int32_t pos, uint8_t boundary) const + { + return (pos <= m_iUpperY - boundary) + && (pos >= m_iLowerY + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'z' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInZ(float pos, float boundary) const + { + return (pos <= m_iUpperZ - boundary) + && (pos >= m_iLowerZ + boundary); + } + + /** + * The boundary value can be used to ensure a position is only considered to be inside + * the Region if it is that far in in the 'z' direction. Also, the test is inclusive such + * that positions lying exactly on the edge of the Region are considered to be inside it. + * \param pos The position to test. + * \param boundary The desired boundary value. + */ + bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const + { + return (pos <= m_iUpperZ - boundary) + && (pos >= m_iLowerZ + boundary); + } + + /** + * The boundary value can be used to ensure a region is only considered to be inside + * another Region if it is that far in in all directions. Also, the test is inclusive such + * that a region is considered to be inside of itself. + * \param reg The region to test. + * \param boundary The desired boundary value. + */ + bool Region::containsRegion(const Region& reg, uint8_t boundary) const + { + return (reg.m_iUpperX <= m_iUpperX - boundary) + && (reg.m_iUpperY <= m_iUpperY - boundary) + && (reg.m_iUpperZ <= m_iUpperZ - boundary) + && (reg.m_iLowerX >= m_iLowerX + boundary) + && (reg.m_iLowerY >= m_iLowerY + boundary) + && (reg.m_iLowerZ >= m_iLowerZ + boundary); + } + + /** + * After calling this functions, the extents of this Region are given by the intersection + * of this Region and the one it was cropped to. + * \param other The Region to crop to. + */ + void Region::cropTo(const Region& other) + { + m_iLowerX = ((std::max)(m_iLowerX, other.m_iLowerX)); + m_iLowerY = ((std::max)(m_iLowerY, other.m_iLowerY)); + m_iLowerZ = ((std::max)(m_iLowerZ, other.m_iLowerZ)); + m_iUpperX = ((std::min)(m_iUpperX, other.m_iUpperX)); + m_iUpperY = ((std::min)(m_iUpperY, other.m_iUpperY)); + m_iUpperZ = ((std::min)(m_iUpperZ, other.m_iUpperZ)); + } + + /** + * The same amount of growth is applied in all directions. Negative growth + * is possible but you should prefer the shrink() function for clarity. + * \param iAmount The amount to grow by. + */ + void Region::grow(int32_t iAmount) + { + m_iLowerX -= iAmount; + m_iLowerY -= iAmount; + m_iLowerZ -= iAmount; + + m_iUpperX += iAmount; + m_iUpperY += iAmount; + m_iUpperZ += iAmount; + } + + /** + * The amount can be specified seperatly for each direction. Negative growth + * is possible but you should prefer the shrink() function for clarity. + * \param iAmountX The amount to grow by in 'x'. + * \param iAmountY The amount to grow by in 'y'. + * \param iAmountZ The amount to grow by in 'z'. + */ + void Region::grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + m_iLowerX -= iAmountX; + m_iLowerY -= iAmountY; + m_iLowerZ -= iAmountZ; + + m_iUpperX += iAmountX; + m_iUpperY += iAmountY; + m_iUpperZ += iAmountZ; + } + + /** + * The amount can be specified seperatly for each direction. Negative growth + * is possible but you should prefer the shrink() function for clarity. + * \param v3dAmount The amount to grow by (one component for each direction). + */ + void Region::grow(const Vector3DInt32& v3dAmount) + { + grow(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); + } + + /** + */ + bool Region::isValid(void) const + { + return (m_iUpperX >= m_iLowerX) && (m_iUpperY >= m_iLowerY) && (m_iUpperZ >= m_iLowerZ); + } + + /** + * \param iAmountX The amount to move the Region by in 'x'. + * \param iAmountY The amount to move the Region by in 'y'. + * \param iAmountZ The amount to move the Region by in 'z'. + */ + void Region::shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + shiftLowerCorner(iAmountX, iAmountY, iAmountZ); + shiftUpperCorner(iAmountX, iAmountY, iAmountZ); + } + + /** + * \param v3dAmount The amount to move the Region by. + */ + void Region::shift(const Vector3DInt32& v3dAmount) + { + shiftLowerCorner(v3dAmount); + shiftUpperCorner(v3dAmount); + } + + /** + * \param iAmountX The amount to move the lower corner by in 'x'. + * \param iAmountY The amount to move the lower corner by in 'y'. + * \param iAmountZ The amount to move the lower corner by in 'z'. + */ + void Region::shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + m_iLowerX += iAmountX; + m_iLowerY += iAmountY; + m_iLowerZ += iAmountZ; + } + + /** + * \param v3dAmount The amount to move the lower corner by. + */ + void Region::shiftLowerCorner(const Vector3DInt32& v3dAmount) + { + shiftLowerCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); + } + + /** + * \param iAmountX The amount to move the upper corner by in 'x'. + * \param iAmountY The amount to move the upper corner by in 'y'. + * \param iAmountZ The amount to move the upper corner by in 'z'. + */ + void Region::shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + m_iUpperX += iAmountX; + m_iUpperY += iAmountY; + m_iUpperZ += iAmountZ; + } + + /** + * \param v3dAmount The amount to move the upper corner by. + */ + void Region::shiftUpperCorner(const Vector3DInt32& v3dAmount) + { + shiftUpperCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); + } + + /** + * The same amount of shrinkage is applied in all directions. Negative shrinkage + * is possible but you should prefer the grow() function for clarity. + * \param iAmount The amount to shrink by. + */ + void Region::shrink(int32_t iAmount) + { + m_iLowerX += iAmount; + m_iLowerY += iAmount; + m_iLowerZ += iAmount; + + m_iUpperX -= iAmount; + m_iUpperY -= iAmount; + m_iUpperZ -= iAmount; + } + + /** + * The amount can be specified seperatly for each direction. Negative shrinkage + * is possible but you should prefer the grow() function for clarity. + * \param iAmountX The amount to shrink by in 'x'. + * \param iAmountY The amount to shrink by in 'y'. + * \param iAmountZ The amount to shrink by in 'z'. + */ + void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + m_iLowerX += iAmountX; + m_iLowerY += iAmountY; + m_iLowerZ += iAmountZ; + + m_iUpperX -= iAmountX; + m_iUpperY -= iAmountY; + m_iUpperZ -= iAmountZ; + } + + /** + * The amount can be specified seperatly for each direction. Negative shrinkage + * is possible but you should prefer the grow() function for clarity. + * \param v3dAmount The amount to shrink by (one component for each direction). + */ + void Region::shrink(const Vector3DInt32& v3dAmount) + { + shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); + } + + /** + * This function only returns true if the regions are really intersecting and not simply touching. + */ + + bool intersects(const Region& a, const Region& b) + { + // No intersection if seperated along an axis. + if(a.getUpperX() < b.getLowerX() || a.getLowerX() > b.getUpperX()) return false; + if(a.getUpperY() < b.getLowerY() || a.getLowerY() > b.getUpperY()) return false; + if(a.getUpperZ() < b.getLowerZ() || a.getLowerZ() > b.getUpperZ()) return false; + + // Overlapping on all axes means Regions are intersecting. + return true; + } + + /** + * Enables the Region to be used intuitively with output streams such as cout. + * \param os The output stream to write to. + * \param region The Region to write to the stream. + * \return A reference to the output stream to allow chaining. + */ + std::ostream& operator<<(std::ostream& os, const Region& region) + { + os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() << + ") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")"; + return os; + } +} diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt index 2160dc5c..b542e068 100644 --- a/library/PolyVoxUtil/CMakeLists.txt +++ b/library/PolyVoxUtil/CMakeLists.txt @@ -1,92 +1,92 @@ -# Copyright (c) 2008-2012 Matt Williams -# Copyright (c) 2008-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -PROJECT(PolyVoxUtil) - -#Projects source files -SET(UTIL_SRC_FILES - source/Dummy.cpp -) - -#Projects headers files -SET(UTIL_INC_FILES - #Nothing here at the moment... -) - -ADD_DEFINITIONS(-DPOLYVOX_SHARED_EXPORTS) #Export symbols in the .dll - -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Source Files" FILES ${UTIL_SRC_FILES}) -SOURCE_GROUP("Header Files" FILES ${UTIL_INC_FILES}) - -#Tell CMake the paths -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include) -#There has to be a better way! -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/release ${PolyVoxCore_BINARY_DIR}) - -#Util -#Build -IF(LIBRARY_TYPE STREQUAL "STATIC") - ADD_LIBRARY(PolyVoxUtil STATIC ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) - IF(UNIX) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF() -ENDIF() -IF(LIBRARY_TYPE STREQUAL "DYNAMIC") - ADD_LIBRARY(PolyVoxUtil SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) - SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") -ENDIF() -SET_PROPERTY(TARGET PolyVoxUtil PROPERTY FOLDER "Library") - -TARGET_LINK_LIBRARIES(PolyVoxUtil PolyVoxCore) -SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) -IF(MSVC) - SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "/W4 /wd4251 /wd4127") #Disable warning on STL exports -ENDIF(MSVC) - -#Install -IF(WIN32) - INSTALL(TARGETS PolyVoxUtil - RUNTIME DESTINATION PolyVoxUtil/bin COMPONENT library - LIBRARY DESTINATION PolyVoxUtil/lib COMPONENT library - ARCHIVE DESTINATION PolyVoxUtil/lib COMPONENT library - ) - - #Install the util header files. - INSTALL(DIRECTORY include DESTINATION PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) - - #On windows, we also install the debug information. It's unfortunate that we have to hard-code - #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I - #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS RelWithDebInfo) -ELSE(WIN32) - INSTALL(TARGETS PolyVoxUtil - RUNTIME DESTINATION bin COMPONENT library - LIBRARY DESTINATION lib COMPONENT library - ARCHIVE DESTINATION lib COMPONENT library - ) - - #Install the util header files. - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) -ENDIF(WIN32) +# Copyright (c) 2008-2012 Matt Williams +# Copyright (c) 2008-2012 David Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +PROJECT(PolyVoxUtil) + +#Projects source files +SET(UTIL_SRC_FILES + source/Dummy.cpp +) + +#Projects headers files +SET(UTIL_INC_FILES + #Nothing here at the moment... +) + +ADD_DEFINITIONS(-DPOLYVOX_SHARED_EXPORTS) #Export symbols in the .dll + +#"Sources" and "Headers" are the group names in Visual Studio. +#They may have other uses too... +SOURCE_GROUP("Source Files" FILES ${UTIL_SRC_FILES}) +SOURCE_GROUP("Header Files" FILES ${UTIL_INC_FILES}) + +#Tell CMake the paths +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include) +#There has to be a better way! +LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/release ${PolyVoxCore_BINARY_DIR}) + +#Util +#Build +IF(LIBRARY_TYPE STREQUAL "STATIC") + ADD_LIBRARY(PolyVoxUtil STATIC ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) + IF(UNIX) + SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) + ENDIF() +ENDIF() +IF(LIBRARY_TYPE STREQUAL "DYNAMIC") + ADD_LIBRARY(PolyVoxUtil SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) + SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") +ENDIF() +SET_PROPERTY(TARGET PolyVoxUtil PROPERTY FOLDER "Library") + +TARGET_LINK_LIBRARIES(PolyVoxUtil PolyVoxCore) +SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) +IF(MSVC) + SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "/W4 /wd4251 /wd4127") #Disable warning on STL exports +ENDIF(MSVC) + +#Install +IF(WIN32) + INSTALL(TARGETS PolyVoxUtil + RUNTIME DESTINATION PolyVoxUtil/bin COMPONENT library + LIBRARY DESTINATION PolyVoxUtil/lib COMPONENT library + ARCHIVE DESTINATION PolyVoxUtil/lib COMPONENT library + ) + + #Install the util header files. + INSTALL(DIRECTORY include DESTINATION PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) + + #On windows, we also install the debug information. It's unfortunate that we have to hard-code + #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I + #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS RelWithDebInfo) +ELSE(WIN32) + INSTALL(TARGETS PolyVoxUtil + RUNTIME DESTINATION bin COMPONENT library + LIBRARY DESTINATION lib COMPONENT library + ARCHIVE DESTINATION lib COMPONENT library + ) + + #Install the util header files. + INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) +ENDIF(WIN32) diff --git a/library/PolyVoxUtil/source/Dummy.cpp b/library/PolyVoxUtil/source/Dummy.cpp index 5f781569..73e5e376 100644 --- a/library/PolyVoxUtil/source/Dummy.cpp +++ b/library/PolyVoxUtil/source/Dummy.cpp @@ -1,16 +1,16 @@ -#include "PolyVoxCore/Impl/TypeDef.h" - -namespace PolyVox -{ - class POLYVOX_API DummyClass - { - public: - int getx(void); - int x; - }; - - int DummyClass::getx(void) - { - return x; - } -} +#include "PolyVoxCore/Impl/TypeDef.h" + +namespace PolyVox +{ + class POLYVOX_API DummyClass + { + public: + int getx(void); + int x; + }; + + int DummyClass::getx(void) + { + return x; + } +} diff --git a/library/bindings/Array.i b/library/bindings/Array.i index a4345de2..269e42b8 100644 --- a/library/bindings/Array.i +++ b/library/bindings/Array.i @@ -1,10 +1,10 @@ -%module Array -%{ -#include "PolyVoxImpl\SubArray.h" -#include "Array.h" -%} - -%include "PolyVoxImpl\SubArray.h" -%include "Array.h" - -%template(Array3IndexAndMaterial) PolyVox::Array<3, PolyVox::IndexAndMaterial>; +%module Array +%{ +#include "PolyVoxImpl\SubArray.h" +#include "Array.h" +%} + +%include "PolyVoxImpl\SubArray.h" +%include "Array.h" + +%template(Array3IndexAndMaterial) PolyVox::Array<3, PolyVox::IndexAndMaterial>; diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index 8bd8e7b7..f4573be6 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -1,65 +1,65 @@ -# Copyright (c) 2009-2013 Matt Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -option(ENABLE_BINDINGS "Build bindings" ON) -if(ENABLE_BINDINGS) - find_package(SWIG) - mark_as_advanced(SWIG_DIR SWIG_VERSION) - find_package(PythonLibs 3) - if(CMAKE_VERSION VERSION_LESS "2.8.6") - set_package_info(SWIG "Bindings generator" http://www.swig.org) - set_package_info(PythonLibs "Programming language" http://www.python.org) - else() - set_package_properties(SWIG PROPERTIES DESCRIPTION "Bindings generator" URL http://www.swig.org) - set_package_properties(PythonLibs PROPERTIES DESCRIPTION "Programming language" URL http://www.python.org) - endif() - if(SWIG_FOUND) - set(BUILD_BINDINGS ON CACHE BOOL "Will the bindings be built" FORCE) - include(${SWIG_USE_FILE}) - - set(CMAKE_SWIG_FLAGS "") - set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON) - - include_directories(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore) - if(PYTHONLIBS_FOUND) - include_directories(${PYTHON_INCLUDE_PATH}) - link_directories(${PolyVoxCore_BINARY_DIR}) - - #set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin") - set(SWIG_MODULE_PolyVoxCorePython_EXTRA_FLAGS "-py3") - swig_add_module(PolyVoxCorePython python PolyVoxCore.i) - swig_link_libraries(PolyVoxCorePython ${PYTHON_LIBRARIES} PolyVoxCore) - set_target_properties(${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTIES OUTPUT_NAME _PolyVoxCore) - #set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") - SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTY FOLDER "Bindings") - endif() - - set(SWIG_MODULE_PolyVoxCoreCSharp_EXTRA_FLAGS "-dllimport;PolyVoxCoreCSharp") #This _should_ be inside UseSWIG.cmake - http://www.cmake.org/Bug/view.php?id=13814 - swig_add_module(PolyVoxCoreCSharp csharp PolyVoxCore.i) - swig_link_libraries(PolyVoxCoreCSharp PolyVoxCore) - SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCoreCSharp_REAL_NAME} PROPERTY FOLDER "Bindings") - else() - set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE) - endif() -else() - set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE) -endif() -mark_as_advanced(FORCE BUILD_BINDINGS) +# Copyright (c) 2009-2013 Matt Williams +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +option(ENABLE_BINDINGS "Build bindings" ON) +if(ENABLE_BINDINGS) + find_package(SWIG) + mark_as_advanced(SWIG_DIR SWIG_VERSION) + find_package(PythonLibs 3) + if(CMAKE_VERSION VERSION_LESS "2.8.6") + set_package_info(SWIG "Bindings generator" http://www.swig.org) + set_package_info(PythonLibs "Programming language" http://www.python.org) + else() + set_package_properties(SWIG PROPERTIES DESCRIPTION "Bindings generator" URL http://www.swig.org) + set_package_properties(PythonLibs PROPERTIES DESCRIPTION "Programming language" URL http://www.python.org) + endif() + if(SWIG_FOUND) + set(BUILD_BINDINGS ON CACHE BOOL "Will the bindings be built" FORCE) + include(${SWIG_USE_FILE}) + + set(CMAKE_SWIG_FLAGS "") + set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON) + + include_directories(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore) + if(PYTHONLIBS_FOUND) + include_directories(${PYTHON_INCLUDE_PATH}) + link_directories(${PolyVoxCore_BINARY_DIR}) + + #set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin") + set(SWIG_MODULE_PolyVoxCorePython_EXTRA_FLAGS "-py3") + swig_add_module(PolyVoxCorePython python PolyVoxCore.i) + swig_link_libraries(PolyVoxCorePython ${PYTHON_LIBRARIES} PolyVoxCore) + set_target_properties(${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTIES OUTPUT_NAME _PolyVoxCore) + #set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") + SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTY FOLDER "Bindings") + endif() + + set(SWIG_MODULE_PolyVoxCoreCSharp_EXTRA_FLAGS "-dllimport;PolyVoxCoreCSharp") #This _should_ be inside UseSWIG.cmake - http://www.cmake.org/Bug/view.php?id=13814 + swig_add_module(PolyVoxCoreCSharp csharp PolyVoxCore.i) + swig_link_libraries(PolyVoxCoreCSharp PolyVoxCore) + SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCoreCSharp_REAL_NAME} PROPERTY FOLDER "Bindings") + else() + set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE) + endif() +else() + set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE) +endif() +mark_as_advanced(FORCE BUILD_BINDINGS) diff --git a/library/bindings/CubicSurfaceExtractor.i b/library/bindings/CubicSurfaceExtractor.i index 11e76cdb..6246925b 100644 --- a/library/bindings/CubicSurfaceExtractor.i +++ b/library/bindings/CubicSurfaceExtractor.i @@ -1,9 +1,9 @@ -%module CubicSurfaceExtractor -%{ -#include "CubicSurfaceExtractor.h" -%} - -%include "CubicSurfaceExtractor.h" - -%template(CubicSurfaceExtractorSimpleVolumeuint8) PolyVox::CubicSurfaceExtractor, PolyVox::DefaultIsQuadNeeded >; -//EXTRACTORS(CubicSurfaceExtractor) +%module CubicSurfaceExtractor +%{ +#include "CubicSurfaceExtractor.h" +%} + +%include "CubicSurfaceExtractor.h" + +%template(CubicSurfaceExtractorSimpleVolumeuint8) PolyVox::CubicSurfaceExtractor, PolyVox::DefaultIsQuadNeeded >; +//EXTRACTORS(CubicSurfaceExtractor) diff --git a/library/bindings/CubicSurfaceExtractorWithNormals.i b/library/bindings/CubicSurfaceExtractorWithNormals.i index 5bd6e0ab..d95578a7 100644 --- a/library/bindings/CubicSurfaceExtractorWithNormals.i +++ b/library/bindings/CubicSurfaceExtractorWithNormals.i @@ -1,8 +1,8 @@ -%module CubicSurfaceExtractorWithNormals -%{ -#include "CubicSurfaceExtractorWithNormals.h" -%} - -%include "CubicSurfaceExtractorWithNormals.h" - -%template(CubicSurfaceExtractorWithNormalsSimpleVolumeuint8) PolyVox::CubicSurfaceExtractorWithNormals, PolyVox::DefaultIsQuadNeeded >; +%module CubicSurfaceExtractorWithNormals +%{ +#include "CubicSurfaceExtractorWithNormals.h" +%} + +%include "CubicSurfaceExtractorWithNormals.h" + +%template(CubicSurfaceExtractorWithNormalsSimpleVolumeuint8) PolyVox::CubicSurfaceExtractorWithNormals, PolyVox::DefaultIsQuadNeeded >; diff --git a/library/bindings/MeshDecimator.i b/library/bindings/MeshDecimator.i index 6e4b25ac..f4515302 100644 --- a/library/bindings/MeshDecimator.i +++ b/library/bindings/MeshDecimator.i @@ -5,5 +5,5 @@ %include "MeshDecimator.h" -%template(MeshDecimatorMaterial8) PolyVox::MeshDecimator; +%template(MeshDecimatorMaterial8) PolyVox::MeshDecimator; %template(MeshDecimatorDensity8) PolyVox::MeshDecimator; \ No newline at end of file diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index 09e63e88..3f6a2d0b 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -1,98 +1,98 @@ -%module PolyVoxCore - -#define POLYVOX_API -%include "Impl/TypeDef.h" -#define __attribute__(x) //Silence DEPRECATED errors - -//This macro allows us to use Python properties on our classes -%define PROPERTY(type,name,getter,setter) -%extend type { - %pythoncode %{ - __swig_getmethods__["name"] = getter - __swig_setmethods__["name"] = setter - if _newclass: name = property(getter, setter) - %} -}; -%enddef - -//Put this in an %extend section to wrap operator<< as __str__ -%define STR() -const char* __str__() { - std::ostringstream out; - out << *$self; - return out.str().c_str(); -} -%enddef - -//Centralise this to avoid repeating ourselves -//This macro will be called in the volume interface files to define the various volume types. -%define VOLUMETYPES(class) -%template(class ## int8) PolyVox::class; -%template(class ## int16) PolyVox::class; -%template(class ## int32) PolyVox::class; -%template(class ## uint8) PolyVox::class; -%template(class ## uint16) PolyVox::class; -%template(class ## uint32) PolyVox::class; -%template(class ## float) PolyVox::class; -%enddef - -//Template based on voxel type -%define EXTRACTOR(class, volumetype) -%template(class ## volumetype ## int8) PolyVox::class >; -%template(class ## volumetype ## int16) PolyVox::class >; -%template(class ## volumetype ## int32) PolyVox::class >; -%template(class ## volumetype ## uint8) PolyVox::class >; -%template(class ## volumetype ## uint16) PolyVox::class >; -%template(class ## volumetype ## uint32) PolyVox::class >; -%template(class ## volumetype ## float) PolyVox::class >; -%enddef - -//Template based on volume type -%define EXTRACTORS(shortname) -EXTRACTOR(shortname, SimpleVolume) -EXTRACTOR(shortname, RawVolume) -EXTRACTOR(shortname, LargeVolume) -%enddef - -%feature("autodoc", "1"); - -#ifdef SWIGPYTHON -//This will rename "operator=" to "assign" since Python doesn't have assignment -%rename(assign) *::operator=; -#endif -#ifdef SWIGCSHARP -//These operators are not wrappable in C# and their function is provided by other means -%ignore *::operator=; -%ignore *::operator+=; -%ignore *::operator-=; -%ignore *::operator*=; -%ignore *::operator/=; -%ignore *::operator<<; //This is covered by STR() -#endif - -%include "stdint.i" -%include "std_vector.i" -%include "Vector.i" -%include "DefaultMarchingCubesController.i" -%include "Region.i" -%include "Block.i" -%include "CompressedBlock.i" -%include "UncompressedBlock.i" -%include "BlockCompressor.i" -%include "Pager.i" -%include "FilePager.i" -%include "MinizBlockCompressor.i" -%include "RLEBlockCompressor.i" -%include "BaseVolume.i" -%include "SimpleVolume.i" -%include "RawVolume.i" -%include "LargeVolume.i" -//%include "SubArray.i" -//%include "Array.i" -%include "VertexTypes.i" -%include "SurfaceMesh.i" -%include "MarchingCubesSurfaceExtractor.i" -%include "CubicSurfaceExtractor.i" -%include "CubicSurfaceExtractorWithNormals.i" -%include "Raycast.i" -%include "Picking.i" +%module PolyVoxCore + +#define POLYVOX_API +%include "Impl/TypeDef.h" +#define __attribute__(x) //Silence DEPRECATED errors + +//This macro allows us to use Python properties on our classes +%define PROPERTY(type,name,getter,setter) +%extend type { + %pythoncode %{ + __swig_getmethods__["name"] = getter + __swig_setmethods__["name"] = setter + if _newclass: name = property(getter, setter) + %} +}; +%enddef + +//Put this in an %extend section to wrap operator<< as __str__ +%define STR() +const char* __str__() { + std::ostringstream out; + out << *$self; + return out.str().c_str(); +} +%enddef + +//Centralise this to avoid repeating ourselves +//This macro will be called in the volume interface files to define the various volume types. +%define VOLUMETYPES(class) +%template(class ## int8) PolyVox::class; +%template(class ## int16) PolyVox::class; +%template(class ## int32) PolyVox::class; +%template(class ## uint8) PolyVox::class; +%template(class ## uint16) PolyVox::class; +%template(class ## uint32) PolyVox::class; +%template(class ## float) PolyVox::class; +%enddef + +//Template based on voxel type +%define EXTRACTOR(class, volumetype) +%template(class ## volumetype ## int8) PolyVox::class >; +%template(class ## volumetype ## int16) PolyVox::class >; +%template(class ## volumetype ## int32) PolyVox::class >; +%template(class ## volumetype ## uint8) PolyVox::class >; +%template(class ## volumetype ## uint16) PolyVox::class >; +%template(class ## volumetype ## uint32) PolyVox::class >; +%template(class ## volumetype ## float) PolyVox::class >; +%enddef + +//Template based on volume type +%define EXTRACTORS(shortname) +EXTRACTOR(shortname, SimpleVolume) +EXTRACTOR(shortname, RawVolume) +EXTRACTOR(shortname, LargeVolume) +%enddef + +%feature("autodoc", "1"); + +#ifdef SWIGPYTHON +//This will rename "operator=" to "assign" since Python doesn't have assignment +%rename(assign) *::operator=; +#endif +#ifdef SWIGCSHARP +//These operators are not wrappable in C# and their function is provided by other means +%ignore *::operator=; +%ignore *::operator+=; +%ignore *::operator-=; +%ignore *::operator*=; +%ignore *::operator/=; +%ignore *::operator<<; //This is covered by STR() +#endif + +%include "stdint.i" +%include "std_vector.i" +%include "Vector.i" +%include "DefaultMarchingCubesController.i" +%include "Region.i" +%include "Block.i" +%include "CompressedBlock.i" +%include "UncompressedBlock.i" +%include "BlockCompressor.i" +%include "Pager.i" +%include "FilePager.i" +%include "MinizBlockCompressor.i" +%include "RLEBlockCompressor.i" +%include "BaseVolume.i" +%include "SimpleVolume.i" +%include "RawVolume.i" +%include "LargeVolume.i" +//%include "SubArray.i" +//%include "Array.i" +%include "VertexTypes.i" +%include "SurfaceMesh.i" +%include "MarchingCubesSurfaceExtractor.i" +%include "CubicSurfaceExtractor.i" +%include "CubicSurfaceExtractorWithNormals.i" +%include "Raycast.i" +%include "Picking.i" diff --git a/library/bindings/SimpleVolumeSampler.i b/library/bindings/SimpleVolumeSampler.i index 16a59eb0..3243d2e0 100644 --- a/library/bindings/SimpleVolumeSampler.i +++ b/library/bindings/SimpleVolumeSampler.i @@ -1,9 +1,9 @@ -%module SimpleVolumeSampler -%{ -#include "SimpleVolume.h" -%} - -%include "SimpleVolume.h" - -%template(SimpleVolumeSamplerMaterial8) PolyVox::SimpleVolume::Sampler; +%module SimpleVolumeSampler +%{ +#include "SimpleVolume.h" +%} + +%include "SimpleVolume.h" + +%template(SimpleVolumeSamplerMaterial8) PolyVox::SimpleVolume::Sampler; %template(SimpleVolumeSamplerDensity8) PolyVox::SimpleVolume::Sampler; \ No newline at end of file diff --git a/library/bindings/SubArray.i b/library/bindings/SubArray.i index 6ea933d8..6807d1f7 100644 --- a/library/bindings/SubArray.i +++ b/library/bindings/SubArray.i @@ -1,9 +1,9 @@ -%module SubArray -%{ -#include "PolyVoxImpl\SubArray.h" -%} - -%include "PolyVoxImpl\SubArray.h" - -//%template(SubArray) PolyVox::SubArray; +%module SubArray +%{ +#include "PolyVoxImpl\SubArray.h" +%} + +%include "PolyVoxImpl\SubArray.h" + +//%template(SubArray) PolyVox::SubArray; //%template(SubArray) PolyVox::SubArray; \ No newline at end of file diff --git a/library/bindings/SurfaceMesh.i b/library/bindings/SurfaceMesh.i index a8df1588..dd135a72 100644 --- a/library/bindings/SurfaceMesh.i +++ b/library/bindings/SurfaceMesh.i @@ -1,20 +1,20 @@ -%module SurfaceMesh -%{ -#include "Region.h" -#include "VertexTypes.h" -#include "SurfaceMesh.h" -%} - -%include "Region.h" -%include "VertexTypes.h" -%include "SurfaceMesh.h" - -//%template(VertexTypeVector) std::vector; -%template(PositionMaterialVector) std::vector; -%template(PositionMaterialNormalVector) std::vector; -%template(LodRecordVector) std::vector; -%template(uint8Vector) std::vector; -%template(uint32Vector) std::vector; - -%template(SurfaceMeshPositionMaterial) PolyVox::SurfaceMesh; +%module SurfaceMesh +%{ +#include "Region.h" +#include "VertexTypes.h" +#include "SurfaceMesh.h" +%} + +%include "Region.h" +%include "VertexTypes.h" +%include "SurfaceMesh.h" + +//%template(VertexTypeVector) std::vector; +%template(PositionMaterialVector) std::vector; +%template(PositionMaterialNormalVector) std::vector; +%template(LodRecordVector) std::vector; +%template(uint8Vector) std::vector; +%template(uint32Vector) std::vector; + +%template(SurfaceMeshPositionMaterial) PolyVox::SurfaceMesh; %template(SurfaceMeshPositionMaterialNormal) PolyVox::SurfaceMesh; \ No newline at end of file diff --git a/library/bindings/TypeDef.i b/library/bindings/TypeDef.i index 7398c4c1..4954a328 100644 --- a/library/bindings/TypeDef.i +++ b/library/bindings/TypeDef.i @@ -1,6 +1,6 @@ -%module TypeDef -%{ -#include "PolyVoxImpl/TypeDef.h" -%} - +%module TypeDef +%{ +#include "PolyVoxImpl/TypeDef.h" +%} + %include "PolyVoxImpl/TypeDef.h" \ No newline at end of file diff --git a/library/bindings/Vector.i b/library/bindings/Vector.i index ac6eed46..7c34a109 100644 --- a/library/bindings/Vector.i +++ b/library/bindings/Vector.i @@ -1,121 +1,121 @@ -%module Vector -%{ -#include "Vector.h" -#include -%} - -%include "Vector.h" - -#ifdef SWIGPYTHON -PROPERTY(PolyVox::Vector, x, getX, setX) -PROPERTY(PolyVox::Vector, y, getY, setY) -PROPERTY(PolyVox::Vector, z, getZ, setZ) -#endif - -%rename(Plus) operator +; -%rename(Minus) operator -; -%rename(Multiply) operator *; -%rename(Divide) operator /; -%rename(Equal) operator ==; -%rename(NotEqual) operator !=; - -%extend PolyVox::Vector { -#ifdef SWIGPYTHON - PolyVox::Vector __add__(const PolyVox::Vector& rhs) { - return *$self + rhs; - } - PolyVox::Vector __sub__(const PolyVox::Vector& rhs) { - return *$self - rhs; - } - PolyVox::Vector __div__(const PolyVox::Vector& rhs) { - return *$self / rhs; - } - PolyVox::Vector __div__(const StorageType& rhs) { - return *$self / rhs; - } - PolyVox::Vector __mul__(const PolyVox::Vector& rhs) { - return *$self * rhs; - } - PolyVox::Vector __mul__(const StorageType& rhs) { - return *$self * rhs; - } -#endif - STR() -}; - -%feature("pythonprepend") PolyVox::Vector::operator< %{ - import warnings - warnings.warn("deprecated", DeprecationWarning) -%} - -//%csattributes PolyVox::Vector::operator< "[System.Obsolete(\"deprecated\")]" - -%define VECTOR3(StorageType,OperationType,ReducedStorageType) - #if SWIGCSHARP - %extend PolyVox::Vector<3,StorageType,OperationType> { - PolyVox::Vector<3,StorageType,OperationType> operator+(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self + rhs;} - PolyVox::Vector<3,StorageType,OperationType> operator-(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self - rhs;} - PolyVox::Vector<3,StorageType,OperationType> operator*(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self * rhs;} - PolyVox::Vector<3,StorageType,OperationType> operator/(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self / rhs;} - PolyVox::Vector<3,StorageType,OperationType> operator*(const StorageType& rhs) {return *$self * rhs;} - PolyVox::Vector<3,StorageType,OperationType> operator/(const StorageType& rhs) {return *$self / rhs;} - }; - %typemap(cscode) PolyVox::Vector<3,StorageType,OperationType> %{ - public static Vector3D##StorageType operator+(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Plus(rhs); - return newVec; - } - public static Vector3D##StorageType operator-(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Minus(rhs); - return newVec; - } - public static Vector3D##StorageType operator*(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Multiply(rhs); - return newVec; - } - public static Vector3D##StorageType operator/(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Divide(rhs); - return newVec; - } - public static Vector3D##StorageType operator*(Vector3D##StorageType lhs, $typemap(cstype, StorageType) rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Multiply(rhs); - return newVec; - } - public static Vector3D##StorageType operator/(Vector3D##StorageType lhs, $typemap(cstype, StorageType) rhs) { - Vector3D##StorageType newVec = new Vector3D##StorageType(); - newVec = lhs.Divide(rhs); - return newVec; - } - public bool Equals(Vector3D##StorageType rhs) { - if ((object)rhs == null) - { - return false; - } - return Equal(rhs); - } - %} - %ignore PolyVox::Vector<3,StorageType,OperationType>::operator<; //This is deprecated - #endif - %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType,ReducedStorageType,ReducedStorageType); - %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType); - %ignore PolyVox::Vector<3,StorageType,OperationType>::getW() const; - %ignore PolyVox::Vector<3,StorageType,OperationType>::setW(ReducedStorageType); - %ignore PolyVox::Vector<3,StorageType,OperationType>::setElements(ReducedStorageType,ReducedStorageType,ReducedStorageType,ReducedStorageType); - %template(Vector3D ## StorageType) PolyVox::Vector<3,StorageType,OperationType>; -%enddef - -VECTOR3(float,float,float) -VECTOR3(double,double,double) -VECTOR3(int8_t,int32_t,signed char) -VECTOR3(uint8_t,int32_t,unsigned char) -VECTOR3(int16_t,int32_t,signed short) -VECTOR3(uint16_t,int32_t,unsigned short) -VECTOR3(int32_t,int32_t,signed int) -VECTOR3(uint32_t,int32_t,unsigned int) - -//%rename(assign) Vector3DFloat::operator=; +%module Vector +%{ +#include "Vector.h" +#include +%} + +%include "Vector.h" + +#ifdef SWIGPYTHON +PROPERTY(PolyVox::Vector, x, getX, setX) +PROPERTY(PolyVox::Vector, y, getY, setY) +PROPERTY(PolyVox::Vector, z, getZ, setZ) +#endif + +%rename(Plus) operator +; +%rename(Minus) operator -; +%rename(Multiply) operator *; +%rename(Divide) operator /; +%rename(Equal) operator ==; +%rename(NotEqual) operator !=; + +%extend PolyVox::Vector { +#ifdef SWIGPYTHON + PolyVox::Vector __add__(const PolyVox::Vector& rhs) { + return *$self + rhs; + } + PolyVox::Vector __sub__(const PolyVox::Vector& rhs) { + return *$self - rhs; + } + PolyVox::Vector __div__(const PolyVox::Vector& rhs) { + return *$self / rhs; + } + PolyVox::Vector __div__(const StorageType& rhs) { + return *$self / rhs; + } + PolyVox::Vector __mul__(const PolyVox::Vector& rhs) { + return *$self * rhs; + } + PolyVox::Vector __mul__(const StorageType& rhs) { + return *$self * rhs; + } +#endif + STR() +}; + +%feature("pythonprepend") PolyVox::Vector::operator< %{ + import warnings + warnings.warn("deprecated", DeprecationWarning) +%} + +//%csattributes PolyVox::Vector::operator< "[System.Obsolete(\"deprecated\")]" + +%define VECTOR3(StorageType,OperationType,ReducedStorageType) + #if SWIGCSHARP + %extend PolyVox::Vector<3,StorageType,OperationType> { + PolyVox::Vector<3,StorageType,OperationType> operator+(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self + rhs;} + PolyVox::Vector<3,StorageType,OperationType> operator-(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self - rhs;} + PolyVox::Vector<3,StorageType,OperationType> operator*(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self * rhs;} + PolyVox::Vector<3,StorageType,OperationType> operator/(const PolyVox::Vector<3,StorageType,OperationType>& rhs) {return *$self / rhs;} + PolyVox::Vector<3,StorageType,OperationType> operator*(const StorageType& rhs) {return *$self * rhs;} + PolyVox::Vector<3,StorageType,OperationType> operator/(const StorageType& rhs) {return *$self / rhs;} + }; + %typemap(cscode) PolyVox::Vector<3,StorageType,OperationType> %{ + public static Vector3D##StorageType operator+(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Plus(rhs); + return newVec; + } + public static Vector3D##StorageType operator-(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Minus(rhs); + return newVec; + } + public static Vector3D##StorageType operator*(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Multiply(rhs); + return newVec; + } + public static Vector3D##StorageType operator/(Vector3D##StorageType lhs, Vector3D##StorageType rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Divide(rhs); + return newVec; + } + public static Vector3D##StorageType operator*(Vector3D##StorageType lhs, $typemap(cstype, StorageType) rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Multiply(rhs); + return newVec; + } + public static Vector3D##StorageType operator/(Vector3D##StorageType lhs, $typemap(cstype, StorageType) rhs) { + Vector3D##StorageType newVec = new Vector3D##StorageType(); + newVec = lhs.Divide(rhs); + return newVec; + } + public bool Equals(Vector3D##StorageType rhs) { + if ((object)rhs == null) + { + return false; + } + return Equal(rhs); + } + %} + %ignore PolyVox::Vector<3,StorageType,OperationType>::operator<; //This is deprecated + #endif + %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType,ReducedStorageType,ReducedStorageType); + %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType); + %ignore PolyVox::Vector<3,StorageType,OperationType>::getW() const; + %ignore PolyVox::Vector<3,StorageType,OperationType>::setW(ReducedStorageType); + %ignore PolyVox::Vector<3,StorageType,OperationType>::setElements(ReducedStorageType,ReducedStorageType,ReducedStorageType,ReducedStorageType); + %template(Vector3D ## StorageType) PolyVox::Vector<3,StorageType,OperationType>; +%enddef + +VECTOR3(float,float,float) +VECTOR3(double,double,double) +VECTOR3(int8_t,int32_t,signed char) +VECTOR3(uint8_t,int32_t,unsigned char) +VECTOR3(int16_t,int32_t,signed short) +VECTOR3(uint16_t,int32_t,unsigned short) +VECTOR3(int32_t,int32_t,signed int) +VECTOR3(uint32_t,int32_t,unsigned int) + +//%rename(assign) Vector3DFloat::operator=; diff --git a/library/bindings/VertexTypes.i b/library/bindings/VertexTypes.i index 6d9ac104..3ed1ff48 100644 --- a/library/bindings/VertexTypes.i +++ b/library/bindings/VertexTypes.i @@ -1,13 +1,13 @@ -%module VertexTypes -%{ -#include "Impl/TypeDef.h" -#include "Vector.h" -#include "VertexTypes.h" -%} - -%include "Impl/TypeDef.h" -%include "Vector.h" -%include "VertexTypes.h" - -//%template (PositionMaterial) PolyVox::PositionMaterial; +%module VertexTypes +%{ +#include "Impl/TypeDef.h" +#include "Vector.h" +#include "VertexTypes.h" +%} + +%include "Impl/TypeDef.h" +%include "Vector.h" +%include "VertexTypes.h" + +//%template (PositionMaterial) PolyVox::PositionMaterial; //%template (PositionMaterialNormal) PolyVox::PositionMaterialNormal; \ No newline at end of file diff --git a/tests/TestAStarPathfinder.cpp b/tests/TestAStarPathfinder.cpp index e36752f5..15c118d7 100644 --- a/tests/TestAStarPathfinder.cpp +++ b/tests/TestAStarPathfinder.cpp @@ -1,139 +1,139 @@ -/******************************************************************************* -Copyright (c) 2011 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "TestAStarPathfinder.h" - -#include "PolyVoxCore/AStarPathfinder.h" -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/RawVolume.h" - -#include - -using namespace PolyVox; - -template< typename VolumeType> -bool testVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos) -{ - //Voxels are considered valid candidates for the path if they are inside the volume... - if(volData->getEnclosingRegion().containsPoint(v3dPos) == false) - { - return false; - } - - typename VolumeType::VoxelType voxel = volData->getVoxel(v3dPos, WrapModes::Validate); // FIXME use templatised version of getVoxel(), but watch out for Linux compile issues. - if(voxel != 0) - { - return false; - } - - return true; -} - -void TestAStarPathfinder::testExecute() -{ - const Vector3DInt32 expectedResult[] = - { - Vector3DInt32(0,0,0), - Vector3DInt32(1,1,1), - Vector3DInt32(2,1,2), - Vector3DInt32(3,1,3), - Vector3DInt32(3,1,4), - Vector3DInt32(3,1,5), - Vector3DInt32(3,1,6), - Vector3DInt32(3,1,7), - Vector3DInt32(4,2,8), - Vector3DInt32(5,3,9), - Vector3DInt32(5,3,10), - Vector3DInt32(5,3,11), - Vector3DInt32(6,4,12), - Vector3DInt32(7,5,13), - Vector3DInt32(8,6,13), - Vector3DInt32(9,7,13), - Vector3DInt32(9,8,13), - Vector3DInt32(10,9,13), - Vector3DInt32(11,10,14), - Vector3DInt32(12,11,15), - Vector3DInt32(13,12,15), - Vector3DInt32(14,13,15), - Vector3DInt32(14,14,15), - Vector3DInt32(15,15,15) - }; - - const int32_t uVolumeSideLength = 16; - - //Create a volume - RawVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); - - //Clear the volume - for(int z = 0; z < uVolumeSideLength; z++) - { - for(int y = 0; y < uVolumeSideLength; y++) - { - for(int x = 0; x < uVolumeSideLength; x++) - { - uint8_t solidVoxel(0); - volData.setVoxelAt(x,y,z,solidVoxel); - } - } - } - - //Place a solid cube in the middle of it - for(int z = 4; z < 12; z++) - { - for(int y = 4; y < 12; y++) - { - for(int x = 4; x < 12; x++) - { - uint8_t solidVoxel(1); - volData.setVoxelAt(x,y,z,solidVoxel); - } - } - } - - //List to store the resulting path - std::list result; - - //Create an AStarPathfinder - AStarPathfinderParams< RawVolume > params(&volData, Vector3DInt32(0,0,0), Vector3DInt32(15,15,15), &result, 1.0f, 10000, TwentySixConnected, &testVoxelValidator >); - AStarPathfinder< RawVolume > pathfinder(params); - - //Execute the pathfinder. - QBENCHMARK { - pathfinder.execute(); - } - - //Make sure the right number of steps were created. - QCOMPARE(result.size(), static_cast(24)); - - //Make sure that each step is correct. - uint32_t uExpectedIndex = 0; - for(std::list::iterator iterResult = result.begin(); iterResult != result.end(); iterResult++) - { - Vector3DInt32 res = *iterResult; - Vector3DInt32 exp = expectedResult[uExpectedIndex]; - QCOMPARE(res, exp); - uExpectedIndex++; - } -} - -QTEST_MAIN(TestAStarPathfinder) +/******************************************************************************* +Copyright (c) 2011 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "TestAStarPathfinder.h" + +#include "PolyVoxCore/AStarPathfinder.h" +#include "PolyVoxCore/Material.h" +#include "PolyVoxCore/RawVolume.h" + +#include + +using namespace PolyVox; + +template< typename VolumeType> +bool testVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos) +{ + //Voxels are considered valid candidates for the path if they are inside the volume... + if(volData->getEnclosingRegion().containsPoint(v3dPos) == false) + { + return false; + } + + typename VolumeType::VoxelType voxel = volData->getVoxel(v3dPos, WrapModes::Validate); // FIXME use templatised version of getVoxel(), but watch out for Linux compile issues. + if(voxel != 0) + { + return false; + } + + return true; +} + +void TestAStarPathfinder::testExecute() +{ + const Vector3DInt32 expectedResult[] = + { + Vector3DInt32(0,0,0), + Vector3DInt32(1,1,1), + Vector3DInt32(2,1,2), + Vector3DInt32(3,1,3), + Vector3DInt32(3,1,4), + Vector3DInt32(3,1,5), + Vector3DInt32(3,1,6), + Vector3DInt32(3,1,7), + Vector3DInt32(4,2,8), + Vector3DInt32(5,3,9), + Vector3DInt32(5,3,10), + Vector3DInt32(5,3,11), + Vector3DInt32(6,4,12), + Vector3DInt32(7,5,13), + Vector3DInt32(8,6,13), + Vector3DInt32(9,7,13), + Vector3DInt32(9,8,13), + Vector3DInt32(10,9,13), + Vector3DInt32(11,10,14), + Vector3DInt32(12,11,15), + Vector3DInt32(13,12,15), + Vector3DInt32(14,13,15), + Vector3DInt32(14,14,15), + Vector3DInt32(15,15,15) + }; + + const int32_t uVolumeSideLength = 16; + + //Create a volume + RawVolume volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(uVolumeSideLength-1, uVolumeSideLength-1, uVolumeSideLength-1))); + + //Clear the volume + for(int z = 0; z < uVolumeSideLength; z++) + { + for(int y = 0; y < uVolumeSideLength; y++) + { + for(int x = 0; x < uVolumeSideLength; x++) + { + uint8_t solidVoxel(0); + volData.setVoxelAt(x,y,z,solidVoxel); + } + } + } + + //Place a solid cube in the middle of it + for(int z = 4; z < 12; z++) + { + for(int y = 4; y < 12; y++) + { + for(int x = 4; x < 12; x++) + { + uint8_t solidVoxel(1); + volData.setVoxelAt(x,y,z,solidVoxel); + } + } + } + + //List to store the resulting path + std::list result; + + //Create an AStarPathfinder + AStarPathfinderParams< RawVolume > params(&volData, Vector3DInt32(0,0,0), Vector3DInt32(15,15,15), &result, 1.0f, 10000, TwentySixConnected, &testVoxelValidator >); + AStarPathfinder< RawVolume > pathfinder(params); + + //Execute the pathfinder. + QBENCHMARK { + pathfinder.execute(); + } + + //Make sure the right number of steps were created. + QCOMPARE(result.size(), static_cast(24)); + + //Make sure that each step is correct. + uint32_t uExpectedIndex = 0; + for(std::list::iterator iterResult = result.begin(); iterResult != result.end(); iterResult++) + { + Vector3DInt32 res = *iterResult; + Vector3DInt32 exp = expectedResult[uExpectedIndex]; + QCOMPARE(res, exp); + uExpectedIndex++; + } +} + +QTEST_MAIN(TestAStarPathfinder) diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 67e0143b..13aeaee1 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -1,127 +1,127 @@ -/******************************************************************************* -Copyright (c) 2010 Matt Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "TestArray.h" - -#include "PolyVoxCore/Array.h" - -#include - -using namespace PolyVox; - -void TestArray::testCArraySpeed() -{ - const int width = 64; - const int height = 32; - const int depth = 16; - - int cArray[width][height][depth]; - - QBENCHMARK - { - int ct = 1; - int expectedTotal = 0; - for (int z = 0; z < depth; z++) - { - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - cArray[x][y][z] = ct; - expectedTotal += cArray[x][y][z]; - ct++; - } - } - } - } -} - -void TestArray::testPolyVoxArraySpeed() -{ - const int width = 64; - const int height = 32; - const int depth = 16; - - Array<3, int> polyvoxArray(width, height, depth); - - QBENCHMARK - { - int ct = 1; - int expectedTotal = 0; - for (int z = 0; z < depth; z++) - { - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - polyvoxArray(x, y, z) = ct; - expectedTotal += polyvoxArray(x, y, z); - ct++; - } - } - } - } -} - -void TestArray::testReadWrite() -{ - int width = 5; - int height = 10; - int depth = 20; - - Array<3, int> myArray(width, height, depth); - - int ct = 1; - int expectedTotal = 0; - for(int z = 0; z < depth; z++) - { - for(int y = 0; y < height; y++) - { - for(int x = 0; x < width; x++) - { - myArray(x, y, z) = ct; - expectedTotal += myArray(x, y, z); - ct++; - } - } - } - - ct = 1; - int total = 0; - for(int z = 0; z < depth; z++) - { - for(int y = 0; y < height; y++) - { - for(int x = 0; x < width; x++) - { - QCOMPARE(myArray(x, y, z), ct); - total += myArray(x, y, z); - ct++; - } - } - } - - QCOMPARE(total, expectedTotal); -} - -QTEST_MAIN(TestArray) +/******************************************************************************* +Copyright (c) 2010 Matt Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "TestArray.h" + +#include "PolyVoxCore/Array.h" + +#include + +using namespace PolyVox; + +void TestArray::testCArraySpeed() +{ + const int width = 64; + const int height = 32; + const int depth = 16; + + int cArray[width][height][depth]; + + QBENCHMARK + { + int ct = 1; + int expectedTotal = 0; + for (int z = 0; z < depth; z++) + { + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + cArray[x][y][z] = ct; + expectedTotal += cArray[x][y][z]; + ct++; + } + } + } + } +} + +void TestArray::testPolyVoxArraySpeed() +{ + const int width = 64; + const int height = 32; + const int depth = 16; + + Array<3, int> polyvoxArray(width, height, depth); + + QBENCHMARK + { + int ct = 1; + int expectedTotal = 0; + for (int z = 0; z < depth; z++) + { + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + polyvoxArray(x, y, z) = ct; + expectedTotal += polyvoxArray(x, y, z); + ct++; + } + } + } + } +} + +void TestArray::testReadWrite() +{ + int width = 5; + int height = 10; + int depth = 20; + + Array<3, int> myArray(width, height, depth); + + int ct = 1; + int expectedTotal = 0; + for(int z = 0; z < depth; z++) + { + for(int y = 0; y < height; y++) + { + for(int x = 0; x < width; x++) + { + myArray(x, y, z) = ct; + expectedTotal += myArray(x, y, z); + ct++; + } + } + } + + ct = 1; + int total = 0; + for(int z = 0; z < depth; z++) + { + for(int y = 0; y < height; y++) + { + for(int x = 0; x < width; x++) + { + QCOMPARE(myArray(x, y, z), ct); + total += myArray(x, y, z); + ct++; + } + } + } + + QCOMPARE(total, expectedTotal); +} + +QTEST_MAIN(TestArray) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 74182fda..61398777 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -34,26 +34,26 @@ freely, subject to the following restrictions: using namespace PolyVox; -template -class CustomIsQuadNeeded -{ +template +class CustomIsQuadNeeded +{ public: typedef _VoxelType VoxelType; - bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) - { - // Not a useful test - it just does something different - // to the DefaultIsQuadNeeded so we can check it compiles. - if ((back > 1) && (front <= 1)) - { + bool operator()(VoxelType back, VoxelType front, VoxelType& materialToUse) + { + // Not a useful test - it just does something different + // to the DefaultIsQuadNeeded so we can check it compiles. + if ((back > 1) && (front <= 1)) + { materialToUse = static_cast(back); - return true; - } - else - { - return false; - } - } + return true; + } + else + { + return false; + } + } }; // Runs the surface extractor for a given type. diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index a3a70085..92e28755 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -1,236 +1,236 @@ -/******************************************************************************* -Copyright (c) 2010 Matt Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "TestSurfaceExtractor.h" - -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" - -#include - -using namespace PolyVox; - -// Test our ability to modify the behaviour of the MarchingCubesSurfaceExtractor. This simple example only modifies -// the threshold (and actually this can be achieved by passing a parameter to the constructor of the -// DefaultMarchingCubesController) but you could implement custom behaviour in the other members -// if you wanted too. Actually, it's not clear if this ability is really useful because I can't think -// what you'd modify apart from the threshold but the ability is at least available. Also, the -// DefaultMarchingCubesController is templatised whereas this exmple shows that controllers don't -// have to be. -class CustomMarchingCubesController -{ -public: - typedef float DensityType; - typedef float MaterialType; - - float convertToDensity(float voxel) - { - return voxel; - } - - float convertToMaterial(float /*voxel*/) - { - return 1.0f; - } - - float blendMaterials(float /*a*/, float /*b*/, float /*weight*/) - { - return 1.0f; - } - - float getThreshold(void) - { - return 50.0f; - } -}; - -// These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. -// They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part -// of PolyVox, but they might be usful to other tests so we cold move them into a 'Tests.h' or something in the future. -template -void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) -{ - voxel = valueToWrite; -} - -template<> -void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setDensity(valueToWrite); -} - -template -void writeMaterialValueToVoxel(int /*valueToWrite*/, VoxelType& /*voxel*/) -{ - //Most types don't have a material - return; -} - -template<> -void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) -{ - voxel.setMaterial(valueToWrite); -} - -template -VolumeType* createAndFillVolume(void) -{ - const int32_t uVolumeSideLength = 64; - - FilePager* pager = new FilePager("."); - - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); - - // Fill - for (int32_t z = 0; z < uVolumeSideLength; z++) - { - for (int32_t y = 0; y < uVolumeSideLength; y++) - { - for (int32_t x = 0; x < uVolumeSideLength; x++) - { - // Create a density field which changes throughout the volume. It's - // zero in the lower corner and increasing as the coordinates increase. - typename VolumeType::VoxelType voxelValue; - writeDensityValueToVoxel(x + y + z, voxelValue); - writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); - volData->setVoxelAt(x, y, z, voxelValue); - } - } - } - - return volData; -} - -// From http://stackoverflow.com/a/5289624 -float randomFloat(float a, float b) -{ - float random = ((float)rand()) / (float)RAND_MAX; - float diff = b - a; - float r = random * diff; - return a + r; -} - -template -VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) -{ - FilePager* pager = new FilePager("."); - - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); - - // Seed generator for consistency between runs. - srand(12345); - - // Fill - for (int32_t z = 0; z < iVolumeSideLength; z++) - { - for (int32_t y = 0; y < iVolumeSideLength; y++) - { - for (int32_t x = 0; x < iVolumeSideLength; x++) - { - float voxelValue = randomFloat(minValue, maxValue); - volData->setVoxelAt(x, y, z, voxelValue); - } - } - } - - return volData; -} - -void TestSurfaceExtractor::testBehaviour() -{ - // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers - // and user-provided meshes to make sure these various combinations work as expected. - // - // It is also noted that the number of indices and vertices is varying quite significantly based on the voxel type. This seems unexpected, but could - // be explained if some overflow is occuring when writing data into the volume, causing volumes of different voxel types to have different distributions. - // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. - - // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. - auto uintVol = createAndFillVolume< PagedVolume >(); - auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); - QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh - QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices - QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type - - // This test makes use of a custom controller - auto floatVol = createAndFillVolume< PagedVolume >(); - CustomMarchingCubesController floatCustomController; - auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); - QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh - QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices - QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type - - // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us - // use a default for the second-to-last parameter but noot use a default for the last parameter. - auto intVol = createAndFillVolume< PagedVolume >(); - Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; - extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); - QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices - QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh - QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices - QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type - - // This test makes use of a user-provided mesh and also a custom controller. - auto doubleVol = createAndFillVolume< PagedVolume >(); - CustomMarchingCubesController doubleCustomController; - Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; - extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); - QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh - QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices - QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type - - // This test ensures the extractor works on a non-primitive voxel type. - auto materialVol = createAndFillVolume< PagedVolume >(); - auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); - QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices - QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh - QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices - QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex -} - -void TestSurfaceExtractor::testEmptyVolumePerformance() -{ - auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, -2.0f, -1.0f); - Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; - QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } - QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); -} - -void TestSurfaceExtractor::testNoiseVolumePerformance() -{ - auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, -1.0f, 1.0f); - Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; - QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } - QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); -} - -QTEST_MAIN(TestSurfaceExtractor) +/******************************************************************************* +Copyright (c) 2010 Matt Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "TestSurfaceExtractor.h" + +#include "PolyVoxCore/Density.h" +#include "PolyVoxCore/FilePager.h" +#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVoxCore/RawVolume.h" +#include "PolyVoxCore/PagedVolume.h" +#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" + +#include + +using namespace PolyVox; + +// Test our ability to modify the behaviour of the MarchingCubesSurfaceExtractor. This simple example only modifies +// the threshold (and actually this can be achieved by passing a parameter to the constructor of the +// DefaultMarchingCubesController) but you could implement custom behaviour in the other members +// if you wanted too. Actually, it's not clear if this ability is really useful because I can't think +// what you'd modify apart from the threshold but the ability is at least available. Also, the +// DefaultMarchingCubesController is templatised whereas this exmple shows that controllers don't +// have to be. +class CustomMarchingCubesController +{ +public: + typedef float DensityType; + typedef float MaterialType; + + float convertToDensity(float voxel) + { + return voxel; + } + + float convertToMaterial(float /*voxel*/) + { + return 1.0f; + } + + float blendMaterials(float /*a*/, float /*b*/, float /*weight*/) + { + return 1.0f; + } + + float getThreshold(void) + { + return 50.0f; + } +}; + +// These 'writeDensityValueToVoxel' functions provide a unified interface for writting densities to primative and class voxel types. +// They are conceptually the inverse of the 'convertToDensity' function used by the MarchingCubesSurfaceExtractor. They probably shouldn't be part +// of PolyVox, but they might be usful to other tests so we cold move them into a 'Tests.h' or something in the future. +template +void writeDensityValueToVoxel(int valueToWrite, VoxelType& voxel) +{ + voxel = valueToWrite; +} + +template<> +void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) +{ + voxel.setDensity(valueToWrite); +} + +template +void writeMaterialValueToVoxel(int /*valueToWrite*/, VoxelType& /*voxel*/) +{ + //Most types don't have a material + return; +} + +template<> +void writeMaterialValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) +{ + voxel.setMaterial(valueToWrite); +} + +template +VolumeType* createAndFillVolume(void) +{ + const int32_t uVolumeSideLength = 64; + + FilePager* pager = new FilePager("."); + + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); + + // Fill + for (int32_t z = 0; z < uVolumeSideLength; z++) + { + for (int32_t y = 0; y < uVolumeSideLength; y++) + { + for (int32_t x = 0; x < uVolumeSideLength; x++) + { + // Create a density field which changes throughout the volume. It's + // zero in the lower corner and increasing as the coordinates increase. + typename VolumeType::VoxelType voxelValue; + writeDensityValueToVoxel(x + y + z, voxelValue); + writeMaterialValueToVoxel(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue); + volData->setVoxelAt(x, y, z, voxelValue); + } + } + } + + return volData; +} + +// From http://stackoverflow.com/a/5289624 +float randomFloat(float a, float b) +{ + float random = ((float)rand()) / (float)RAND_MAX; + float diff = b - a; + float r = random * diff; + return a + r; +} + +template +VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue) +{ + FilePager* pager = new FilePager("."); + + //Create empty volume + VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); + + // Seed generator for consistency between runs. + srand(12345); + + // Fill + for (int32_t z = 0; z < iVolumeSideLength; z++) + { + for (int32_t y = 0; y < iVolumeSideLength; y++) + { + for (int32_t x = 0; x < iVolumeSideLength; x++) + { + float voxelValue = randomFloat(minValue, maxValue); + volData->setVoxelAt(x, y, z, voxelValue); + } + } + } + + return volData; +} + +void TestSurfaceExtractor::testBehaviour() +{ + // These tests apply the Marching Cubes surface extractor to volumes of various voxel types. In addition we sometimes make use of custom controllers + // and user-provided meshes to make sure these various combinations work as expected. + // + // It is also noted that the number of indices and vertices is varying quite significantly based on the voxel type. This seems unexpected, but could + // be explained if some overflow is occuring when writing data into the volume, causing volumes of different voxel types to have different distributions. + // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. + + // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. + auto uintVol = createAndFillVolume< PagedVolume >(); + auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); + QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(uintMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type + + // This test makes use of a custom controller + auto floatVol = createAndFillVolume< PagedVolume >(); + CustomMarchingCubesController floatCustomController; + auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); + QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(floatMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type + + // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us + // use a default for the second-to-last parameter but noot use a default for the last parameter. + auto intVol = createAndFillVolume< PagedVolume >(); + Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; + extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); + QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices + QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh + QCOMPARE(intMesh.getIndex(100), uint16_t(29)); // Verifies that we have 16-bit indices + QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type + + // This test makes use of a user-provided mesh and also a custom controller. + auto doubleVol = createAndFillVolume< PagedVolume >(); + CustomMarchingCubesController doubleCustomController; + Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; + extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); + QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh + QCOMPARE(doubleMesh.getIndex(100), uint16_t(26)); // Verifies that we have 32-bit indices + QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type + + // This test ensures the extractor works on a non-primitive voxel type. + auto materialVol = createAndFillVolume< PagedVolume >(); + auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); + QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices + QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh + QCOMPARE(materialMesh.getIndex(100), uint32_t(44)); // Verifies that we have 32-bit indices + QCOMPARE(materialMesh.getVertex(100).data.getMaterial(), uint16_t(79)); // Verify the data attached to the vertex +} + +void TestSurfaceExtractor::testEmptyVolumePerformance() +{ + auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, -2.0f, -1.0f); + Mesh< MarchingCubesVertex< float >, uint16_t > emptyMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } + QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); +} + +void TestSurfaceExtractor::testNoiseVolumePerformance() +{ + auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, -1.0f, 1.0f); + Mesh< MarchingCubesVertex< float >, uint16_t > noiseMesh; + QBENCHMARK{ extractMarchingCubesMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } + QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(48967)); +} + +QTEST_MAIN(TestSurfaceExtractor) diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 1db0065e..9be146d4 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -1,194 +1,194 @@ -/******************************************************************************* -Copyright (c) 2010 Matt Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "TestVolumeSubclass.h" - -#include "PolyVoxCore/Array.h" - -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/Vector.h" - -#include - -using namespace PolyVox; - -template -class VolumeSubclass : public BaseVolume -{ -public: - //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. - //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but - //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler - //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated - //in the future - //typedef BaseVolume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn - //class Sampler : public VolumeOfVoxelType::template Sampler< VolumeSubclass > - #if defined(_MSC_VER) - class Sampler : public BaseVolume::Sampler< VolumeSubclass > //This line works on VS2010 - #else - class Sampler : public BaseVolume::template Sampler< VolumeSubclass > //This line works on GCC - #endif - { - public: - Sampler(VolumeSubclass* volume) - :BaseVolume::template Sampler< VolumeSubclass >(volume) - { - this->mVolume = volume; - } - //~Sampler(); - }; - - /// Constructor for creating a fixed size volume. - VolumeSubclass(const Region& regValid) - :BaseVolume(regValid) - , mVolumeData(this->getWidth(), this->getHeight(), this->getDepth()) - { - //mVolumeData.resize(ArraySizes(this->getWidth())(this->getHeight())(this->getDepth())); - } - /// Destructor - ~VolumeSubclass() {}; - - /// Gets a voxel at the position given by x,y,z coordinates - template - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const - { - // FIXME: This templatised version is implemented in terms of the not template version. This is strange - // from a peformance point of view but it's just because we were encountering some compile issues on GCC. - return getVoxel(uXPos, uYPos, uZPos, eWrapMode, tBorder); - } - - /// Gets a voxel at the position given by a 3D vector - template - VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const - { - // Simply call through to the real implementation - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); - } - - /// Gets a voxel at the position given by x,y,z coordinates - VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const - { - switch(eWrapMode) - { - case WrapModes::Validate: - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) - { - POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); - } - - return mVolumeData(uXPos, uYPos, uZPos); - } - case WrapModes::Clamp: - { - //Perform clamping - uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); - uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); - uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); - uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); - uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); - uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - return mVolumeData(uXPos, uYPos, uZPos); - } - case WrapModes::Border: - { - if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) - { - return mVolumeData(uXPos, uYPos, uZPos); - } - else - { - return tBorder; - } - } - case WrapModes::AssumeValid: - { - return mVolumeData(uXPos, uYPos, uZPos); - } - default: - { - // Should never happen - POLYVOX_ASSERT(false, "Invalid wrap mode"); - return VoxelType(); - } - } - } - - /// Gets a voxel at the position given by a 3D vector - VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const - { - return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); - } - - /// Sets the value used for voxels which are outside the volume - void setBorderValue(const VoxelType& tBorder) { } - /// Sets the voxel at the position given by x,y,z coordinates - bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) - { - if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) - { - mVolumeData(uXPos, uYPos, uZPos) = tValue; - return true; - } - else - { - return false; - } - } - /// Sets the voxel at the position given by a 3D vector - bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) { return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } - - /// Calculates approximatly how many bytes of memory the volume is currently using. - uint32_t calculateSizeInBytes(void) { return 0; } - - /// Deprecated - I don't think we should expose this function? Let us know if you disagree... - //void resize(const Region& regValidRegion); - -private: - Array<3, VoxelType> mVolumeData; -}; - -void TestVolumeSubclass::testExtractSurface() -{ - VolumeSubclass volumeSubclass(Region(0,0,0,16,16,16)); - - for(int32_t z = 0; z < volumeSubclass.getDepth() / 2; z++) - { - for(int32_t y = 0; y < volumeSubclass.getHeight(); y++) - { - for(int32_t x = 0; x < volumeSubclass.getWidth(); x++) - { - Material8 mat(1); - volumeSubclass.setVoxelAt(Vector3DInt32(x,y,z),mat); - } - } - } +/******************************************************************************* +Copyright (c) 2010 Matt Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#include "TestVolumeSubclass.h" + +#include "PolyVoxCore/Array.h" + +#include "PolyVoxCore/BaseVolume.h" +#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVoxCore/Material.h" +#include "PolyVoxCore/Vector.h" + +#include + +using namespace PolyVox; + +template +class VolumeSubclass : public BaseVolume +{ +public: + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef BaseVolume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn + //class Sampler : public VolumeOfVoxelType::template Sampler< VolumeSubclass > + #if defined(_MSC_VER) + class Sampler : public BaseVolume::Sampler< VolumeSubclass > //This line works on VS2010 + #else + class Sampler : public BaseVolume::template Sampler< VolumeSubclass > //This line works on GCC + #endif + { + public: + Sampler(VolumeSubclass* volume) + :BaseVolume::template Sampler< VolumeSubclass >(volume) + { + this->mVolume = volume; + } + //~Sampler(); + }; + + /// Constructor for creating a fixed size volume. + VolumeSubclass(const Region& regValid) + :BaseVolume(regValid) + , mVolumeData(this->getWidth(), this->getHeight(), this->getDepth()) + { + //mVolumeData.resize(ArraySizes(this->getWidth())(this->getHeight())(this->getDepth())); + } + /// Destructor + ~VolumeSubclass() {}; + + /// Gets a voxel at the position given by x,y,z coordinates + template + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const + { + // FIXME: This templatised version is implemented in terms of the not template version. This is strange + // from a peformance point of view but it's just because we were encountering some compile issues on GCC. + return getVoxel(uXPos, uYPos, uZPos, eWrapMode, tBorder); + } + + /// Gets a voxel at the position given by a 3D vector + template + VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const + { + // Simply call through to the real implementation + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder); + } + + /// Gets a voxel at the position given by x,y,z coordinates + VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const + { + switch(eWrapMode) + { + case WrapModes::Validate: + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) + { + POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); + } + + return mVolumeData(uXPos, uYPos, uZPos); + } + case WrapModes::Clamp: + { + //Perform clamping + uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); + uYPos = (std::max)(uYPos, this->m_regValidRegion.getLowerY()); + uZPos = (std::max)(uZPos, this->m_regValidRegion.getLowerZ()); + uXPos = (std::min)(uXPos, this->m_regValidRegion.getUpperX()); + uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); + uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); + return mVolumeData(uXPos, uYPos, uZPos); + } + case WrapModes::Border: + { + if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) + { + return mVolumeData(uXPos, uYPos, uZPos); + } + else + { + return tBorder; + } + } + case WrapModes::AssumeValid: + { + return mVolumeData(uXPos, uYPos, uZPos); + } + default: + { + // Should never happen + POLYVOX_ASSERT(false, "Invalid wrap mode"); + return VoxelType(); + } + } + } + + /// Gets a voxel at the position given by a 3D vector + VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::Validate, VoxelType tBorder = VoxelType()) const + { + return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder); + } + + /// Sets the value used for voxels which are outside the volume + void setBorderValue(const VoxelType& tBorder) { } + /// Sets the voxel at the position given by x,y,z coordinates + bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) + { + if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) + { + mVolumeData(uXPos, uYPos, uZPos) = tValue; + return true; + } + else + { + return false; + } + } + /// Sets the voxel at the position given by a 3D vector + bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) { return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } + + /// Calculates approximatly how many bytes of memory the volume is currently using. + uint32_t calculateSizeInBytes(void) { return 0; } + + /// Deprecated - I don't think we should expose this function? Let us know if you disagree... + //void resize(const Region& regValidRegion); + +private: + Array<3, VoxelType> mVolumeData; +}; + +void TestVolumeSubclass::testExtractSurface() +{ + VolumeSubclass volumeSubclass(Region(0,0,0,16,16,16)); + + for(int32_t z = 0; z < volumeSubclass.getDepth() / 2; z++) + { + for(int32_t y = 0; y < volumeSubclass.getHeight(); y++) + { + for(int32_t x = 0; x < volumeSubclass.getWidth(); x++) + { + Material8 mat(1); + volumeSubclass.setVoxelAt(Vector3DInt32(x,y,z),mat); + } + } + } auto result = extractCubicMesh(&volumeSubclass, volumeSubclass.getEnclosingRegion()); - - QCOMPARE(result.getNoOfVertices(), static_cast(8)); -} - -QTEST_MAIN(TestVolumeSubclass) + + QCOMPARE(result.getNoOfVertices(), static_cast(8)); +} + +QTEST_MAIN(TestVolumeSubclass) From 66fdc19fe917925ddc0f886fab96659b1acfb081 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 25 Sep 2014 23:02:39 +0200 Subject: [PATCH 235/259] Added pattern for SWIG interface files. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 4fd74970..0b083562 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,6 +10,7 @@ *.h text *.inl text *.txt text +*.i text # Declare files that will always have CRLF line endings on checkout. #*.sln text eol=crlf From 4ed75cd174cd2ec641983c250782c873765e535b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 27 Sep 2014 09:26:21 +0200 Subject: [PATCH 236/259] Updated changlelog with a quick braindump. --- CHANGELOG.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d466b177..40e0bcb7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,21 @@ Changes for PolyVox version 0.3 =============================== This release has focused on... (some introduction here). +*** Quick braindump of some changes *** + + * SimpleVolume is now PagedVolume (slightly slower but can go larger). + * MarchingCubesSurfaceExtractor class is now a free function extractMarchingCubesSurface() + * Meshes are more templatized (e.g. on IndexType) and extracted meshes are encoded to save space. A 'decode' function is provided for these (or you can do it on the GPU). + * Generally more templatization - you will want to use a lot of the 'auto' keyword to stay sane. + * MarchingCubesController class gives more control over extraction process, but defaults should be fine for primative voxel types. + * Requires VS2013 on Windows (GCC 4.7/Clang should be ok). + * Support for 'WrapModes' when accessing outside volumes but I think these have bought a performance impact. + * Documentation is as poor (or wrong) as ever but all tests and examples work. + * New Array class is much faster + +*** End of braindump *** + + This line was added just for testing. Voxel access From 436e8d479cf85d0b4a2474670193f63ba248c26c Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 3 Oct 2014 21:47:04 +0200 Subject: [PATCH 237/259] Compile fix. --- library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 28babf13..6ee86f1c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -454,11 +454,13 @@ namespace PolyVox { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { - m_pRecentlyUsedChunks.erase(Vector3DInt32(x, y, z)); m_pLastAccessedChunk = 0; + m_pRecentlyUsedChunks.erase(Vector3DInt32(x, y, z)); } } } + m_pLastAccessedChunk = nullptr; + // We might now have so null pointers in the 'all chunks' list so clean them up. purgeNullPtrsFromAllChunks(); } @@ -482,7 +484,7 @@ namespace PolyVox m_uTimestamper = 0; m_v3dLastAccessedChunkPos = Vector3DInt32(0,0,0); //There are no invalid positions, but initially the m_pLastAccessedChunk pointer will be null; - m_pLastAccessedChunk = 0; + m_pLastAccessedChunk = nullptr; //Compute the chunk side length m_uChunkSideLengthPower = logBase2(m_uChunkSideLength); From 2e98414fd3550fef660d484d04e733dc257907b4 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 10 Dec 2014 15:47:54 +0000 Subject: [PATCH 238/259] Start updating the library bindings Nothing works at the moment and the bindings are likely going to have to change significantly. In the meantime just disable them by default to avoid confusion. --- library/bindings/CMakeLists.txt | 2 +- library/bindings/Chunk.i | 9 ++++ library/bindings/CubicSurfaceExtractor.i | 2 +- library/bindings/PagedVolume.i | 50 +++++++++++++++++++ library/bindings/PolyVoxCore.i | 63 +++++++++++------------- library/bindings/SurfaceMesh.i | 22 ++++----- library/bindings/VertexTypes.i | 4 +- 7 files changed, 103 insertions(+), 49 deletions(-) create mode 100644 library/bindings/Chunk.i create mode 100644 library/bindings/PagedVolume.i diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index f4573be6..9df9b456 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -19,7 +19,7 @@ # 3. This notice may not be removed or altered from any source # distribution. -option(ENABLE_BINDINGS "Build bindings" ON) +option(ENABLE_BINDINGS "Build bindings" OFF) #Off by default if(ENABLE_BINDINGS) find_package(SWIG) mark_as_advanced(SWIG_DIR SWIG_VERSION) diff --git a/library/bindings/Chunk.i b/library/bindings/Chunk.i new file mode 100644 index 00000000..b2559e4c --- /dev/null +++ b/library/bindings/Chunk.i @@ -0,0 +1,9 @@ +%module Chunk +%{ +#include "Chunk.h" +%} + +%include "Chunk.h" + +VOLUMETYPES(Chunk) + \ No newline at end of file diff --git a/library/bindings/CubicSurfaceExtractor.i b/library/bindings/CubicSurfaceExtractor.i index 6246925b..805c2d1d 100644 --- a/library/bindings/CubicSurfaceExtractor.i +++ b/library/bindings/CubicSurfaceExtractor.i @@ -5,5 +5,5 @@ %include "CubicSurfaceExtractor.h" -%template(CubicSurfaceExtractorSimpleVolumeuint8) PolyVox::CubicSurfaceExtractor, PolyVox::DefaultIsQuadNeeded >; +%template(extractCubicMeshSimpleVolumeuint8) extractCubicMesh >; //EXTRACTORS(CubicSurfaceExtractor) diff --git a/library/bindings/PagedVolume.i b/library/bindings/PagedVolume.i new file mode 100644 index 00000000..45f81903 --- /dev/null +++ b/library/bindings/PagedVolume.i @@ -0,0 +1,50 @@ +%module PagedVolume + +#pragma SWIG nowarn=SWIGWARN_PARSE_NESTED_CLASS + +namespace PolyVox +{ + class PolyVox::PagedVolume_Chunk { + public: + PagedVolume_Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, PolyVox::PagedVolume_Pager* pPager = nullptr); + ~PagedVolume_Chunk(); + + VoxelType* getData(void) const; + uint32_t getDataSizeInBytes(void) const; + + VoxelType getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; + VoxelType getVoxel(const Vector3DUint16& v3dPos) const; + + void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); + void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); + }; + + class PolyVox::PagedVolume_Pager { + public: + /// Constructor + PagedVolume_Pager() {}; + /// Destructor + virtual ~PagedVolume_Pager() {}; + + virtual void pageIn(const Region& region, PagedVolume_Chunk* pChunk) = 0; + virtual void pageOut(const Region& region, PagedVolume_Chunk* pChunk) = 0; + }; +} + +%{ +#include "PagedVolume.h" +%} + +%include "PagedVolume.h" + +%{ +namespace PolyVox +{ + // SWIG thinks that Inner is a global class, so we need to trick the C++ + // compiler into understanding this so called global type. + typedef PagedVolume::Pager PagedVolume_Pager; + typedef PagedVolume::Chunk PagedVolume_Chunk; +} +%} + +VOLUMETYPES(PagedVolume) diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index 3f6a2d0b..0e902ccd 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -28,30 +28,29 @@ const char* __str__() { //This macro will be called in the volume interface files to define the various volume types. %define VOLUMETYPES(class) %template(class ## int8) PolyVox::class; -%template(class ## int16) PolyVox::class; -%template(class ## int32) PolyVox::class; -%template(class ## uint8) PolyVox::class; -%template(class ## uint16) PolyVox::class; -%template(class ## uint32) PolyVox::class; -%template(class ## float) PolyVox::class; +//%template(class ## int16) PolyVox::class; +//%template(class ## int32) PolyVox::class; +//%template(class ## uint8) PolyVox::class; +//%template(class ## uint16) PolyVox::class; +//%template(class ## uint32) PolyVox::class; +//%template(class ## float) PolyVox::class; %enddef //Template based on voxel type %define EXTRACTOR(class, volumetype) %template(class ## volumetype ## int8) PolyVox::class >; -%template(class ## volumetype ## int16) PolyVox::class >; -%template(class ## volumetype ## int32) PolyVox::class >; -%template(class ## volumetype ## uint8) PolyVox::class >; -%template(class ## volumetype ## uint16) PolyVox::class >; -%template(class ## volumetype ## uint32) PolyVox::class >; -%template(class ## volumetype ## float) PolyVox::class >; +//%template(class ## volumetype ## int16) PolyVox::class >; +//%template(class ## volumetype ## int32) PolyVox::class >; +//%template(class ## volumetype ## uint8) PolyVox::class >; +//%template(class ## volumetype ## uint16) PolyVox::class >; +//%template(class ## volumetype ## uint32) PolyVox::class >; +//%template(class ## volumetype ## float) PolyVox::class >; %enddef //Template based on volume type %define EXTRACTORS(shortname) -EXTRACTOR(shortname, SimpleVolume) +EXTRACTOR(shortname, PagedVolume) EXTRACTOR(shortname, RawVolume) -EXTRACTOR(shortname, LargeVolume) %enddef %feature("autodoc", "1"); @@ -75,24 +74,20 @@ EXTRACTOR(shortname, LargeVolume) %include "Vector.i" %include "DefaultMarchingCubesController.i" %include "Region.i" -%include "Block.i" -%include "CompressedBlock.i" -%include "UncompressedBlock.i" -%include "BlockCompressor.i" -%include "Pager.i" -%include "FilePager.i" -%include "MinizBlockCompressor.i" -%include "RLEBlockCompressor.i" +//%include "Chunk.i" +//%include "CompressedBlock.i" +//%include "UncompressedBlock.i" +//%include "BlockCompressor.i" +//%include "Pager.i" +//%include "FilePager.i" +//%include "MinizBlockCompressor.i" +//%include "RLEBlockCompressor.i" %include "BaseVolume.i" -%include "SimpleVolume.i" -%include "RawVolume.i" -%include "LargeVolume.i" -//%include "SubArray.i" -//%include "Array.i" -%include "VertexTypes.i" -%include "SurfaceMesh.i" -%include "MarchingCubesSurfaceExtractor.i" -%include "CubicSurfaceExtractor.i" -%include "CubicSurfaceExtractorWithNormals.i" -%include "Raycast.i" -%include "Picking.i" +//%include "RawVolume.i" +%include "PagedVolume.i" +//%include "VertexTypes.i" +//%include "SurfaceMesh.i" +////%include "MarchingCubesSurfaceExtractor.i" +////%include "CubicSurfaceExtractor.i" +//%include "Raycast.i" +//%include "Picking.i" diff --git a/library/bindings/SurfaceMesh.i b/library/bindings/SurfaceMesh.i index dd135a72..0588971c 100644 --- a/library/bindings/SurfaceMesh.i +++ b/library/bindings/SurfaceMesh.i @@ -1,20 +1,20 @@ %module SurfaceMesh %{ #include "Region.h" -#include "VertexTypes.h" -#include "SurfaceMesh.h" +#include "Vertex.h" +#include "Mesh.h" %} %include "Region.h" -%include "VertexTypes.h" -%include "SurfaceMesh.h" +%include "Vertex.h" +%include "Mesh.h" //%template(VertexTypeVector) std::vector; -%template(PositionMaterialVector) std::vector; -%template(PositionMaterialNormalVector) std::vector; -%template(LodRecordVector) std::vector; -%template(uint8Vector) std::vector; -%template(uint32Vector) std::vector; +//%template(PositionMaterialVector) std::vector; +//%template(PositionMaterialNormalVector) std::vector; +//%template(LodRecordVector) std::vector; +//%template(uint8Vector) std::vector; +//%template(uint32Vector) std::vector; -%template(SurfaceMeshPositionMaterial) PolyVox::SurfaceMesh; -%template(SurfaceMeshPositionMaterialNormal) PolyVox::SurfaceMesh; \ No newline at end of file +%template(MeshPositionMaterial) PolyVox::Mesh, uint16_t >; +%template(MeshPositionMaterialNormal) PolyVox::Mesh, uint16_t >; \ No newline at end of file diff --git a/library/bindings/VertexTypes.i b/library/bindings/VertexTypes.i index 3ed1ff48..5f0f4e2b 100644 --- a/library/bindings/VertexTypes.i +++ b/library/bindings/VertexTypes.i @@ -2,12 +2,12 @@ %{ #include "Impl/TypeDef.h" #include "Vector.h" -#include "VertexTypes.h" +#include "Vertex.h" %} %include "Impl/TypeDef.h" %include "Vector.h" -%include "VertexTypes.h" +%include "Vertex.h" //%template (PositionMaterial) PolyVox::PositionMaterial; //%template (PositionMaterialNormal) PolyVox::PositionMaterialNormal; \ No newline at end of file From 6d6b1907438cf70752e314c27b49bf620bfcd390 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 10 Dec 2014 15:53:25 +0000 Subject: [PATCH 239/259] Reorganise the CMake scripts to make sure the core library is independent --- CMakeLists.txt | 64 +++++++++++++++++++---------------------- examples/CMakeLists.txt | 7 +++++ library/CMakeLists.txt | 3 +- 3 files changed, 38 insertions(+), 36 deletions(-) create mode 100644 examples/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6c583f..bce84941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (c) 2007-2012 Matt Williams -# Copyright (c) 2007-2012 David Williams +# Copyright (c) 2007-2014 Matt Williams +# Copyright (c) 2007-2014 David Williams # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages @@ -24,73 +24,63 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6) PROJECT(PolyVox) +include(FeatureSummary) + +SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) + +#Set up for building the library itself + SET(POLYVOX_VERSION_MAJOR "0") SET(POLYVOX_VERSION_MINOR "2") SET(POLYVOX_VERSION_PATCH "1") SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}" CACHE STRING "PolyVox version") MARK_AS_ADVANCED(FORCE POLYVOX_VERSION) -SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) -include(FeatureSummary) - -FIND_PACKAGE(Doxygen) -OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) - SET(LIBRARY_TYPE "DYNAMIC" CACHE STRING "Should the library be STATIC or DYNAMIC") SET_PROPERTY(CACHE LIBRARY_TYPE PROPERTY STRINGS DYNAMIC STATIC) IF(WIN32) SET(LIBRARY_TYPE "STATIC") ENDIF() -# Qt is required for building the tests, the example and optionally for bundling the documentation -FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) -INCLUDE(${QT_USE_FILE}) -if(CMAKE_VERSION VERSION_LESS "2.8.6") - set_package_info(Doxygen "API documentation generator" http://www.doxygen.org "Building the API documentation") - set_package_info(Qt4 "C++ framework" http://qt-project.org "Building the examples and tests") -else() - set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") - set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) - set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") - set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") -endif() - - -IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW" - ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode -ENDIF() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode endif() +#We need to find doxygen before building the library +FIND_PACKAGE(Doxygen) + + ADD_SUBDIRECTORY(library) + + +# Qt is required for building the tests, the example and optionally for bundling the documentation +FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) +INCLUDE(${QT_USE_FILE}) + +#Examples OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) - ADD_SUBDIRECTORY(examples/common) - ADD_SUBDIRECTORY(examples/Basic) - ADD_SUBDIRECTORY(examples/Paging) - ADD_SUBDIRECTORY(examples/OpenGL) - ADD_SUBDIRECTORY(examples/SmoothLOD) - ADD_SUBDIRECTORY(examples/DecodeOnGPU) - ADD_SUBDIRECTORY(examples/Python) SET(BUILD_EXAMPLES ON) + add_subdirectory(examples) ELSE() SET(BUILD_EXAMPLES OFF) ENDIF() INCLUDE(Packaging.cmake) +#Tests OPTION(ENABLE_TESTS "Should the tests be built" ON) IF(ENABLE_TESTS AND QT_QTTEST_FOUND) + SET(BUILD_TESTS ON) INCLUDE(CTest) MARK_AS_ADVANCED(FORCE BUILD_TESTING) ADD_SUBDIRECTORY(tests) - SET(BUILD_TESTS ON) ELSE() SET(BUILD_TESTS OFF) ENDIF() +#Manual #Check if we will building _and_ bundling the docs IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) SET(BUILD_AND_BUNDLE_DOCS ON) @@ -100,6 +90,12 @@ ENDIF() ADD_SUBDIRECTORY(documentation) + +set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") +set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) +set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples") +set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests") + add_feature_info("Examples" BUILD_EXAMPLES "Examples of PolyVox usage") add_feature_info("Tests" BUILD_TESTS "Unit tests") add_feature_info("Bindings" BUILD_BINDINGS "SWIG bindings") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 00000000..e95ad41a --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +ADD_SUBDIRECTORY(common) +ADD_SUBDIRECTORY(Basic) +ADD_SUBDIRECTORY(Paging) +ADD_SUBDIRECTORY(OpenGL) +ADD_SUBDIRECTORY(SmoothLOD) +ADD_SUBDIRECTORY(DecodeOnGPU) +ADD_SUBDIRECTORY(Python) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 392503b8..79467307 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -48,6 +48,7 @@ endif(WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR} COMPONENT development) +#Documentation if(DOXYGEN_FOUND) #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.css ${CMAKE_CURRENT_BINARY_DIR}/polyvox.css) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) @@ -82,5 +83,3 @@ if(DOXYGEN_FOUND) ) endif() endif() - -#add_subdirectory(bindings) From ecb3439d224a366d0f87f5ffad5bf50d59be5ce7 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Fri, 12 Dec 2014 10:36:45 +0000 Subject: [PATCH 240/259] Reorder initialisation to silence -Wreorder warnings --- .../PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index a406d7c5..429140e9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -40,11 +40,11 @@ namespace PolyVox :m_volData(volData) ,m_regSizeInVoxels(region) ,m_meshCurrent(result) + ,m_previousSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) + ,m_currentSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) ,m_bMergeQuads(bMergeQuads) ,m_eWrapMode(eWrapMode) ,m_tBorderValue(tBorderValue) - ,m_previousSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) - ,m_currentSliceVertices(m_regSizeInVoxels.getUpperX() - m_regSizeInVoxels.getLowerX() + 2, m_regSizeInVoxels.getUpperY() - m_regSizeInVoxels.getLowerY() + 2, MaxVerticesPerPosition) { m_funcIsQuadNeededCallback = isQuadNeeded; From 8065b709d17964a401dcba5a09b1b648b163eeb9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 00:07:32 +0100 Subject: [PATCH 241/259] Made Region header only. --- examples/Paging/main.cpp | 2 +- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/PagedVolume.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Region.h | 6 +- .../PolyVoxCore/Region.inl} | 95 +++++++++---------- 5 files changed, 54 insertions(+), 53 deletions(-) rename library/PolyVoxCore/{source/Region.cpp => include/PolyVoxCore/Region.inl} (83%) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 86e52aff..a3e60356 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) openGLWidget.show(); PerlinNoisePager* pager = new PerlinNoisePager(); - PagedVolume volData(PolyVox::Region::MaxRegion, pager, 64); + PagedVolume volData(PolyVox::Region::MaxRegion(), pager, 64); volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb //createSphereInVolume(volData, 30); diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 35478777..f44550ab 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -25,7 +25,6 @@ PROJECT(PolyVoxCore) #Projects source files SET(CORE_SRC_FILES source/AStarPathfinder.cpp - source/Region.cpp ) #Projects headers files @@ -71,6 +70,7 @@ SET(CORE_INC_FILES include/PolyVoxCore/Raycast.h include/PolyVoxCore/Raycast.inl include/PolyVoxCore/Region.h + include/PolyVoxCore/Region.inl include/PolyVoxCore/SimpleVolume.h include/PolyVoxCore/Vector.h include/PolyVoxCore/Vector.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 6ee86f1c..642c1ff8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -52,7 +52,7 @@ namespace PolyVox { // If the user is creating a vast (almost infinite) volume then we can bet they will be // expecting a high memory usage and will want a fair number of chunks to play around with. - if (regValid == Region::MaxRegion) + if (regValid == Region::MaxRegion()) { m_uChunkCountLimit = 1024; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 2e8d113b..6221b87b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -58,9 +58,9 @@ namespace PolyVox public: /// A Region with the lower corner set as low as possible and the upper corner set as high as possible. - static const Region MaxRegion; + static Region MaxRegion(); /// A Region with the lower corner set as high as possible and the upper corner set as low as possible. - static const Region InvertedRegion; + static Region InvertedRegion(); /// Constructor Region(); @@ -458,4 +458,6 @@ namespace PolyVox } } +#include "PolyVoxCore/Region.inl" + #endif diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/include/PolyVoxCore/Region.inl similarity index 83% rename from library/PolyVoxCore/source/Region.cpp rename to library/PolyVoxCore/include/PolyVoxCore/Region.inl index ca2d7337..e327f6f6 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.inl @@ -21,8 +21,6 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Region.h" - #include #include @@ -30,29 +28,31 @@ namespace PolyVox { /** */ - const Region Region::MaxRegion - ( - Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()), - Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()) - ); + inline Region Region::MaxRegion() + { + return Region( + (std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)(), + (std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()); + } /** * This Region is not considered valid as defined by isValid(). It's main application * is to initialise a Region to this value and then() accumulate positions. The result * of this will be a Region which encompasses all positions specified. */ - const Region Region::InvertedRegion - ( - Vector3DInt32((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()), - Vector3DInt32((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()) - ); + inline Region Region::InvertedRegion() + { + return Region( + (std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)(), + (std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()); + } /** * \param iX The 'x' component of the position to accumulate. * \param iY The 'y' component of the position to accumulate. * \param iZ The 'z' component of the position to accumulate. */ - void Region::accumulate(int32_t iX, int32_t iY, int32_t iZ) + inline void Region::accumulate(int32_t iX, int32_t iY, int32_t iZ) { m_iLowerX = ((std::min)(m_iLowerX, iX)); m_iLowerY = ((std::min)(m_iLowerY, iY)); @@ -65,7 +65,7 @@ namespace PolyVox /** * \param v3dPos The position to accumulate. */ - void Region::accumulate(const Vector3DInt32& v3dPos) + inline void Region::accumulate(const Vector3DInt32& v3dPos) { accumulate(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); } @@ -77,7 +77,7 @@ namespace PolyVox * \param reg The Region to accumulate. This must be valid as defined by the isValid() function. * \sa isValid() */ - void Region::accumulate(const Region& reg) + inline void Region::accumulate(const Region& reg) { if(!reg.isValid()) { @@ -95,7 +95,7 @@ namespace PolyVox /** * Constructs a Region and clears all extents to zero. */ - Region::Region() + inline Region::Region() :m_iLowerX(0) ,m_iLowerY(0) ,m_iLowerZ(0) @@ -110,7 +110,7 @@ namespace PolyVox * \param v3dLowerCorner The desired lower corner of the Region. * \param v3dUpperCorner The desired upper corner of the Region. */ - Region::Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner) + inline Region::Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner) :m_iLowerX(v3dLowerCorner.getX()) ,m_iLowerY(v3dLowerCorner.getY()) ,m_iLowerZ(v3dLowerCorner.getZ()) @@ -129,7 +129,7 @@ namespace PolyVox * \param iUpperY The desired upper 'y' extent of the Region. * \param iUpperZ The desired upper 'z' extent of the Region. */ - Region::Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ) + inline Region::Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ) :m_iLowerX(iLowerX) ,m_iLowerY(iLowerY) ,m_iLowerZ(iLowerZ) @@ -145,7 +145,7 @@ namespace PolyVox * \return true if the Regions match. * \sa operator!= */ - bool Region::operator==(const Region& rhs) const + inline bool Region::operator==(const Region& rhs) const { return ((m_iLowerX == rhs.m_iLowerX) && (m_iLowerY == rhs.m_iLowerY) && (m_iLowerZ == rhs.m_iLowerZ) && (m_iUpperX == rhs.m_iUpperX) && (m_iUpperY == rhs.m_iUpperY) && (m_iUpperZ == rhs.m_iUpperZ)); @@ -157,7 +157,7 @@ namespace PolyVox * \return true if the Regions are different. * \sa operator== */ - bool Region::operator!=(const Region& rhs) const + inline bool Region::operator!=(const Region& rhs) const { return !(*this == rhs); } @@ -171,7 +171,7 @@ namespace PolyVox * \param fZ The 'z' position of the point to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(float fX, float fY, float fZ, float boundary) const + inline bool Region::containsPoint(float fX, float fY, float fZ, float boundary) const { return (fX <= m_iUpperX - boundary) && (fY <= m_iUpperY - boundary) @@ -188,7 +188,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(const Vector3DFloat& pos, float boundary) const + inline bool Region::containsPoint(const Vector3DFloat& pos, float boundary) const { return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); } @@ -202,7 +202,7 @@ namespace PolyVox * \param iZ The 'z' position of the point to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const + inline bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const { return (iX <= m_iUpperX - boundary) && (iY <= m_iUpperY - boundary) @@ -219,7 +219,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const + inline bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const { return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); } @@ -231,7 +231,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInX(float pos, float boundary) const + inline bool Region::containsPointInX(float pos, float boundary) const { return (pos <= m_iUpperX - boundary) && (pos >= m_iLowerX + boundary); @@ -244,7 +244,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInX(int32_t pos, uint8_t boundary) const + inline bool Region::containsPointInX(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperX - boundary) && (pos >= m_iLowerX + boundary); @@ -257,7 +257,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInY(float pos, float boundary) const + inline bool Region::containsPointInY(float pos, float boundary) const { return (pos <= m_iUpperY - boundary) && (pos >= m_iLowerY + boundary); @@ -270,7 +270,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInY(int32_t pos, uint8_t boundary) const + inline bool Region::containsPointInY(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperY - boundary) && (pos >= m_iLowerY + boundary); @@ -283,7 +283,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInZ(float pos, float boundary) const + inline bool Region::containsPointInZ(float pos, float boundary) const { return (pos <= m_iUpperZ - boundary) && (pos >= m_iLowerZ + boundary); @@ -296,7 +296,7 @@ namespace PolyVox * \param pos The position to test. * \param boundary The desired boundary value. */ - bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const + inline bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const { return (pos <= m_iUpperZ - boundary) && (pos >= m_iLowerZ + boundary); @@ -309,7 +309,7 @@ namespace PolyVox * \param reg The region to test. * \param boundary The desired boundary value. */ - bool Region::containsRegion(const Region& reg, uint8_t boundary) const + inline bool Region::containsRegion(const Region& reg, uint8_t boundary) const { return (reg.m_iUpperX <= m_iUpperX - boundary) && (reg.m_iUpperY <= m_iUpperY - boundary) @@ -324,7 +324,7 @@ namespace PolyVox * of this Region and the one it was cropped to. * \param other The Region to crop to. */ - void Region::cropTo(const Region& other) + inline void Region::cropTo(const Region& other) { m_iLowerX = ((std::max)(m_iLowerX, other.m_iLowerX)); m_iLowerY = ((std::max)(m_iLowerY, other.m_iLowerY)); @@ -339,7 +339,7 @@ namespace PolyVox * is possible but you should prefer the shrink() function for clarity. * \param iAmount The amount to grow by. */ - void Region::grow(int32_t iAmount) + inline void Region::grow(int32_t iAmount) { m_iLowerX -= iAmount; m_iLowerY -= iAmount; @@ -357,7 +357,7 @@ namespace PolyVox * \param iAmountY The amount to grow by in 'y'. * \param iAmountZ The amount to grow by in 'z'. */ - void Region::grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + inline void Region::grow(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) { m_iLowerX -= iAmountX; m_iLowerY -= iAmountY; @@ -373,14 +373,14 @@ namespace PolyVox * is possible but you should prefer the shrink() function for clarity. * \param v3dAmount The amount to grow by (one component for each direction). */ - void Region::grow(const Vector3DInt32& v3dAmount) + inline void Region::grow(const Vector3DInt32& v3dAmount) { grow(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } /** */ - bool Region::isValid(void) const + inline bool Region::isValid(void) const { return (m_iUpperX >= m_iLowerX) && (m_iUpperY >= m_iLowerY) && (m_iUpperZ >= m_iLowerZ); } @@ -390,7 +390,7 @@ namespace PolyVox * \param iAmountY The amount to move the Region by in 'y'. * \param iAmountZ The amount to move the Region by in 'z'. */ - void Region::shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + inline void Region::shift(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) { shiftLowerCorner(iAmountX, iAmountY, iAmountZ); shiftUpperCorner(iAmountX, iAmountY, iAmountZ); @@ -399,7 +399,7 @@ namespace PolyVox /** * \param v3dAmount The amount to move the Region by. */ - void Region::shift(const Vector3DInt32& v3dAmount) + inline void Region::shift(const Vector3DInt32& v3dAmount) { shiftLowerCorner(v3dAmount); shiftUpperCorner(v3dAmount); @@ -410,7 +410,7 @@ namespace PolyVox * \param iAmountY The amount to move the lower corner by in 'y'. * \param iAmountZ The amount to move the lower corner by in 'z'. */ - void Region::shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + inline void Region::shiftLowerCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) { m_iLowerX += iAmountX; m_iLowerY += iAmountY; @@ -420,7 +420,7 @@ namespace PolyVox /** * \param v3dAmount The amount to move the lower corner by. */ - void Region::shiftLowerCorner(const Vector3DInt32& v3dAmount) + inline void Region::shiftLowerCorner(const Vector3DInt32& v3dAmount) { shiftLowerCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } @@ -430,7 +430,7 @@ namespace PolyVox * \param iAmountY The amount to move the upper corner by in 'y'. * \param iAmountZ The amount to move the upper corner by in 'z'. */ - void Region::shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + inline void Region::shiftUpperCorner(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) { m_iUpperX += iAmountX; m_iUpperY += iAmountY; @@ -440,7 +440,7 @@ namespace PolyVox /** * \param v3dAmount The amount to move the upper corner by. */ - void Region::shiftUpperCorner(const Vector3DInt32& v3dAmount) + inline void Region::shiftUpperCorner(const Vector3DInt32& v3dAmount) { shiftUpperCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } @@ -450,7 +450,7 @@ namespace PolyVox * is possible but you should prefer the grow() function for clarity. * \param iAmount The amount to shrink by. */ - void Region::shrink(int32_t iAmount) + inline void Region::shrink(int32_t iAmount) { m_iLowerX += iAmount; m_iLowerY += iAmount; @@ -468,7 +468,7 @@ namespace PolyVox * \param iAmountY The amount to shrink by in 'y'. * \param iAmountZ The amount to shrink by in 'z'. */ - void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + inline void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) { m_iLowerX += iAmountX; m_iLowerY += iAmountY; @@ -484,7 +484,7 @@ namespace PolyVox * is possible but you should prefer the grow() function for clarity. * \param v3dAmount The amount to shrink by (one component for each direction). */ - void Region::shrink(const Vector3DInt32& v3dAmount) + inline void Region::shrink(const Vector3DInt32& v3dAmount) { shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } @@ -492,8 +492,7 @@ namespace PolyVox /** * This function only returns true if the regions are really intersecting and not simply touching. */ - - bool intersects(const Region& a, const Region& b) + inline bool intersects(const Region& a, const Region& b) { // No intersection if seperated along an axis. if(a.getUpperX() < b.getLowerX() || a.getLowerX() > b.getUpperX()) return false; @@ -510,7 +509,7 @@ namespace PolyVox * \param region The Region to write to the stream. * \return A reference to the output stream to allow chaining. */ - std::ostream& operator<<(std::ostream& os, const Region& region) + inline std::ostream& operator<<(std::ostream& os, const Region& region) { os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() << ") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")"; From d480935e38e1429e92085db6898073e1568d411e Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 16:08:05 +0100 Subject: [PATCH 242/259] Moved A* pathfinder data from .cpp to header. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/AStarPathfinder.h | 40 ++++++++++- .../PolyVoxCore/source/AStarPathfinder.cpp | 67 ------------------- 3 files changed, 38 insertions(+), 71 deletions(-) delete mode 100644 library/PolyVoxCore/source/AStarPathfinder.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index f44550ab..27dbaa31 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -24,7 +24,7 @@ PROJECT(PolyVoxCore) #Projects source files SET(CORE_SRC_FILES - source/AStarPathfinder.cpp + #source/AStarPathfinder.cpp ) #Projects headers files diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index dce2aaf7..0c9d7a89 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -37,9 +37,43 @@ namespace PolyVox const float sqrt_2 = 1.4143f; const float sqrt_3 = 1.7321f; - extern const POLYVOX_API Vector3DInt32 arrayPathfinderFaces[6]; - extern const POLYVOX_API Vector3DInt32 arrayPathfinderEdges[12]; - extern const POLYVOX_API Vector3DInt32 arrayPathfinderCorners[8]; + const Vector3DInt32 arrayPathfinderFaces[6] = + { + Vector3DInt32(0, 0, -1), + Vector3DInt32(0, 0, +1), + Vector3DInt32(0, -1, 0), + Vector3DInt32(0, +1, 0), + Vector3DInt32(-1, 0, 0), + Vector3DInt32(+1, 0, 0) + }; + + const Vector3DInt32 arrayPathfinderEdges[12] = + { + Vector3DInt32(0, -1, -1), + Vector3DInt32(0, -1, +1), + Vector3DInt32(0, +1, -1), + Vector3DInt32(0, +1, +1), + Vector3DInt32(-1, 0, -1), + Vector3DInt32(-1, 0, +1), + Vector3DInt32(+1, 0, -1), + Vector3DInt32(+1, 0, +1), + Vector3DInt32(-1, -1, 0), + Vector3DInt32(-1, +1, 0), + Vector3DInt32(+1, -1, 0), + Vector3DInt32(+1, +1, 0) + }; + + const Vector3DInt32 arrayPathfinderCorners[8] = + { + Vector3DInt32(-1, -1, -1), + Vector3DInt32(-1, -1, +1), + Vector3DInt32(-1, +1, -1), + Vector3DInt32(-1, +1, +1), + Vector3DInt32(+1, -1, -1), + Vector3DInt32(+1, -1, +1), + Vector3DInt32(+1, +1, -1), + Vector3DInt32(+1, +1, +1) + }; /// This function provides the default method for checking whether a given voxel /// is valid for the path computed by the AStarPathfinder. diff --git a/library/PolyVoxCore/source/AStarPathfinder.cpp b/library/PolyVoxCore/source/AStarPathfinder.cpp deleted file mode 100644 index 83d42db1..00000000 --- a/library/PolyVoxCore/source/AStarPathfinder.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/AStarPathfinder.h" - -using namespace PolyVox; - -namespace PolyVox -{ - const Vector3DInt32 arrayPathfinderFaces[6] = - { - Vector3DInt32(0, 0, -1), - Vector3DInt32(0, 0, +1), - Vector3DInt32(0, -1, 0), - Vector3DInt32(0, +1, 0), - Vector3DInt32(-1, 0, 0), - Vector3DInt32(+1, 0, 0) - }; - - const Vector3DInt32 arrayPathfinderEdges[12] = - { - Vector3DInt32(0, -1, -1), - Vector3DInt32(0, -1, +1), - Vector3DInt32(0, +1, -1), - Vector3DInt32(0, +1, +1), - Vector3DInt32(-1, 0, -1), - Vector3DInt32(-1, 0, +1), - Vector3DInt32(+1, 0, -1), - Vector3DInt32(+1, 0, +1), - Vector3DInt32(-1, -1, 0), - Vector3DInt32(-1, +1, 0), - Vector3DInt32(+1, -1, 0), - Vector3DInt32(+1, +1, 0) - }; - - const Vector3DInt32 arrayPathfinderCorners[8] = - { - Vector3DInt32(-1, -1, -1), - Vector3DInt32(-1, -1, +1), - Vector3DInt32(-1, +1, -1), - Vector3DInt32(-1, +1, +1), - Vector3DInt32(+1, -1, -1), - Vector3DInt32(+1, -1, +1), - Vector3DInt32(+1, +1, -1), - Vector3DInt32(+1, +1, +1) - }; -} From eb45c97a61e4a9bc7aa142862c5bf0fa4991285d Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 16:37:08 +0100 Subject: [PATCH 243/259] Moved marching cubes tables to header file. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../PolyVoxCore/Impl/MarchingCubesTables.h | 302 +++++++++++++++- .../source/Impl/MarchingCubesTables.cpp | 328 ------------------ 3 files changed, 301 insertions(+), 331 deletions(-) delete mode 100644 library/PolyVoxCore/source/Impl/MarchingCubesTables.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 27dbaa31..ed717e07 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -84,7 +84,7 @@ SET(CORE_INC_FILES SET(IMPL_SRC_FILES source/Impl/ErrorHandling.cpp source/Impl/Logging.cpp - source/Impl/MarchingCubesTables.cpp + #source/Impl/MarchingCubesTables.cpp source/Impl/RandomUnitVectors.cpp source/Impl/RandomVectors.cpp source/Impl/Timer.cpp diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h index 2f29ae43..2a251120 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h @@ -30,8 +30,306 @@ freely, subject to the following restrictions: namespace PolyVox { - extern const POLYVOX_API uint16_t edgeTable[256]; - extern const POLYVOX_API int8_t triTable[256][16]; + //These tables were based on the article "Polygonising a scalar field". + //They have been optimised to allow a more efficient algorithm via bitwise operations. + + // http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/index.html + + const uint16_t edgeTable[256] = + { + 0x000, 0x109, 0x203, 0x30a, 0x80c, 0x905, 0xa0f, 0xb06, + 0x406, 0x50f, 0x605, 0x70c, 0xc0a, 0xd03, 0xe09, 0xf00, + 0x190, 0x099, 0x393, 0x29a, 0x99c, 0x895, 0xb9f, 0xa96, + 0x596, 0x49f, 0x795, 0x69c, 0xd9a, 0xc93, 0xf99, 0xe90, + 0x230, 0x339, 0x033, 0x13a, 0xa3c, 0xb35, 0x83f, 0x936, + 0x636, 0x73f, 0x435, 0x53c, 0xe3a, 0xf33, 0xc39, 0xd30, + 0x3a0, 0x2a9, 0x1a3, 0x0aa, 0xbac, 0xaa5, 0x9af, 0x8a6, + 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xfaa, 0xea3, 0xda9, 0xca0, + 0x8c0, 0x9c9, 0xac3, 0xbca, 0x0cc, 0x1c5, 0x2cf, 0x3c6, + 0xcc6, 0xdcf, 0xec5, 0xfcc, 0x4ca, 0x5c3, 0x6c9, 0x7c0, + 0x950, 0x859, 0xb53, 0xa5a, 0x15c, 0x055, 0x35f, 0x256, + 0xd56, 0xc5f, 0xf55, 0xe5c, 0x55a, 0x453, 0x759, 0x650, + 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0x2fc, 0x3f5, 0x0ff, 0x1f6, + 0xef6, 0xfff, 0xcf5, 0xdfc, 0x6fa, 0x7f3, 0x4f9, 0x5f0, + 0xb60, 0xa69, 0x963, 0x86a, 0x36c, 0x265, 0x16f, 0x066, + 0xf66, 0xe6f, 0xd65, 0xc6c, 0x76a, 0x663, 0x569, 0x460, + 0x460, 0x569, 0x663, 0x76a, 0xc6c, 0xd65, 0xe6f, 0xf66, + 0x066, 0x16f, 0x265, 0x36c, 0x86a, 0x963, 0xa69, 0xb60, + 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0xdfc, 0xcf5, 0xfff, 0xef6, + 0x1f6, 0x0ff, 0x3f5, 0x2fc, 0x9fa, 0x8f3, 0xbf9, 0xaf0, + 0x650, 0x759, 0x453, 0x55a, 0xe5c, 0xf55, 0xc5f, 0xd56, + 0x256, 0x35f, 0x055, 0x15c, 0xa5a, 0xb53, 0x859, 0x950, + 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0xfcc, 0xec5, 0xdcf, 0xcc6, + 0x3c6, 0x2cf, 0x1c5, 0x0cc, 0xbca, 0xac3, 0x9c9, 0x8c0, + 0xca0, 0xda9, 0xea3, 0xfaa, 0x4ac, 0x5a5, 0x6af, 0x7a6, + 0x8a6, 0x9af, 0xaa5, 0xbac, 0x0aa, 0x1a3, 0x2a9, 0x3a0, + 0xd30, 0xc39, 0xf33, 0xe3a, 0x53c, 0x435, 0x73f, 0x636, + 0x936, 0x83f, 0xb35, 0xa3c, 0x13a, 0x033, 0x339, 0x230, + 0xe90, 0xf99, 0xc93, 0xd9a, 0x69c, 0x795, 0x49f, 0x596, + 0xa96, 0xb9f, 0x895, 0x99c, 0x29a, 0x393, 0x099, 0x190, + 0xf00, 0xe09, 0xd03, 0xc0a, 0x70c, 0x605, 0x50f, 0x406, + 0xb06, 0xa0f, 0x905, 0x80c, 0x30a, 0x203, 0x109, 0x000 + }; + + const int8_t triTable[256][16] = + { + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, }, + { 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, }, + { 3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, }, + { 4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, }, + { 4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, }, + { 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, }, + { 10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, }, + { 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, }, + { 5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, }, + { 2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, }, + { 11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, }, + { 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, }, + { 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, }, + { 5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, }, + { 11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, }, + { 11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, }, + { 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, }, + { 10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, }, + { 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, }, + { 7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, }, + { 8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, }, + { 1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, }, + { 4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, }, + { 10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, }, + { 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, }, + { 10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, }, + { 10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, }, + { 7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, }, + { 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, }, + { 6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, }, + { 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, }, + { 7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, }, + { 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, }, + { 9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, }, + { 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, }, + { 4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, }, + { 7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, }, + { 6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, }, + { 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, }, + { 6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, }, + { 9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, }, + { 1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, }, + { 0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, }, + { 11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, }, + { 6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, }, + { 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, }, + { 10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, }, + { 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, }, + { 1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, }, + { 6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, }, + { 3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, }, + { 6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, }, + { 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, }, + { 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, }, + { 9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, }, + { 6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, }, + { 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, }, + { 7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, }, + { 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, }, + { 5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, }, + { 0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, }, + { 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, }, + { 10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, }, + { 10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, }, + { 3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, }, + { 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, }, + { 1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, }, + { 0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, }, + { 8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, }, + { 3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, }, + { 6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, }, + { 10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, }, + { 10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, }, + { 2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, }, + { 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, }, + { 11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, }, + { 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, }, + { 2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, }, + { 7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, }, + { 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, }, + { 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, }, + { 2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, }, + { 9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, }, + { 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, }, + { 11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, }, + { 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, }, + { 7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, }, + { 1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, }, + { 0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, }, + { 10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, }, + { 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, }, + { 5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, }, + { 5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, }, + { 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, }, + { 0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, }, + { 0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, }, + { 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, }, + { 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, }, + { 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, }, + { 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, }, + { 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, }, + { 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, }, + { 3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, }, + { 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, }, + { 9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, }, + { 11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, }, + { 11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, }, + { 4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, }, + { 4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, }, + { 9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, }, + { 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, }, + { 0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, } + }; } #endif diff --git a/library/PolyVoxCore/source/Impl/MarchingCubesTables.cpp b/library/PolyVoxCore/source/Impl/MarchingCubesTables.cpp deleted file mode 100644 index 15769007..00000000 --- a/library/PolyVoxCore/source/Impl/MarchingCubesTables.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -//These tables were based on the article "Polygonising a scalar field". -//They have been optimised to allow a more efficient algorithm via bitwise operations. - -// http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/index.html - -#include "PolyVoxCore/Impl/MarchingCubesTables.h" - -namespace PolyVox -{ - const uint16_t edgeTable[256]= - { - 0x000, 0x109, 0x203, 0x30a, 0x80c, 0x905, 0xa0f, 0xb06, - 0x406, 0x50f, 0x605, 0x70c, 0xc0a, 0xd03, 0xe09, 0xf00, - 0x190, 0x099, 0x393, 0x29a, 0x99c, 0x895, 0xb9f, 0xa96, - 0x596, 0x49f, 0x795, 0x69c, 0xd9a, 0xc93, 0xf99, 0xe90, - 0x230, 0x339, 0x033, 0x13a, 0xa3c, 0xb35, 0x83f, 0x936, - 0x636, 0x73f, 0x435, 0x53c, 0xe3a, 0xf33, 0xc39, 0xd30, - 0x3a0, 0x2a9, 0x1a3, 0x0aa, 0xbac, 0xaa5, 0x9af, 0x8a6, - 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xfaa, 0xea3, 0xda9, 0xca0, - 0x8c0, 0x9c9, 0xac3, 0xbca, 0x0cc, 0x1c5, 0x2cf, 0x3c6, - 0xcc6, 0xdcf, 0xec5, 0xfcc, 0x4ca, 0x5c3, 0x6c9, 0x7c0, - 0x950, 0x859, 0xb53, 0xa5a, 0x15c, 0x055, 0x35f, 0x256, - 0xd56, 0xc5f, 0xf55, 0xe5c, 0x55a, 0x453, 0x759, 0x650, - 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0x2fc, 0x3f5, 0x0ff, 0x1f6, - 0xef6, 0xfff, 0xcf5, 0xdfc, 0x6fa, 0x7f3, 0x4f9, 0x5f0, - 0xb60, 0xa69, 0x963, 0x86a, 0x36c, 0x265, 0x16f, 0x066, - 0xf66, 0xe6f, 0xd65, 0xc6c, 0x76a, 0x663, 0x569, 0x460, - 0x460, 0x569, 0x663, 0x76a, 0xc6c, 0xd65, 0xe6f, 0xf66, - 0x066, 0x16f, 0x265, 0x36c, 0x86a, 0x963, 0xa69, 0xb60, - 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0xdfc, 0xcf5, 0xfff, 0xef6, - 0x1f6, 0x0ff, 0x3f5, 0x2fc, 0x9fa, 0x8f3, 0xbf9, 0xaf0, - 0x650, 0x759, 0x453, 0x55a, 0xe5c, 0xf55, 0xc5f, 0xd56, - 0x256, 0x35f, 0x055, 0x15c, 0xa5a, 0xb53, 0x859, 0x950, - 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0xfcc, 0xec5, 0xdcf, 0xcc6, - 0x3c6, 0x2cf, 0x1c5, 0x0cc, 0xbca, 0xac3, 0x9c9, 0x8c0, - 0xca0, 0xda9, 0xea3, 0xfaa, 0x4ac, 0x5a5, 0x6af, 0x7a6, - 0x8a6, 0x9af, 0xaa5, 0xbac, 0x0aa, 0x1a3, 0x2a9, 0x3a0, - 0xd30, 0xc39, 0xf33, 0xe3a, 0x53c, 0x435, 0x73f, 0x636, - 0x936, 0x83f, 0xb35, 0xa3c, 0x13a, 0x033, 0x339, 0x230, - 0xe90, 0xf99, 0xc93, 0xd9a, 0x69c, 0x795, 0x49f, 0x596, - 0xa96, 0xb9f, 0x895, 0x99c, 0x29a, 0x393, 0x099, 0x190, - 0xf00, 0xe09, 0xd03, 0xc0a, 0x70c, 0x605, 0x50f, 0x406, - 0xb06, 0xa0f, 0x905, 0x80c, 0x30a, 0x203, 0x109, 0x000 - }; - - const int8_t triTable[256][16] = - { - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, }, - { 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, }, - { 3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, }, - { 4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, }, - { 4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, }, - { 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, }, - {10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, }, - { 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, }, - { 5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, }, - { 2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, }, - {11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, }, - {10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, }, - { 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, }, - { 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, }, - { 5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, }, - {11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, }, - {11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, }, - {10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, }, - {10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, }, - {10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, }, - { 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, }, - { 7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, }, - { 8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, }, - { 1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, }, - { 4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, }, - {10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, }, - { 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, }, - {10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, }, - {10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, }, - {11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, }, - { 7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, }, - { 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, }, - { 6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, }, - { 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, }, - { 7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, }, - { 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, }, - { 9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, }, - { 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, }, - { 4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, }, - { 7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, }, - { 6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, }, - { 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, }, - { 6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, }, - { 9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, }, - { 1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, }, - { 0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, }, - {11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, }, - { 6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, }, - { 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, }, - {10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, }, - { 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, }, - { 1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, }, - { 6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, }, - { 3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, }, - { 6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, }, - {10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, }, - { 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, }, - { 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, }, - { 9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, }, - { 6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, }, - { 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, }, - { 7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, }, - { 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, }, - { 5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, }, - { 0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, }, - { 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, }, - {10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, }, - {10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, }, - {10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, }, - { 3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, }, - { 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, }, - { 1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, }, - { 0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, }, - { 8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, }, - { 3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, }, - { 6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, }, - {10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, }, - {10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, }, - { 2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, }, - { 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, }, - {11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, }, - { 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, }, - { 2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, }, - { 7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, }, - { 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, }, - { 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, }, - {10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, }, - { 2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, }, - { 9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, }, - { 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, }, - {11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, }, - { 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, }, - { 7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, }, - { 1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, }, - { 0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, }, - {10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, }, - { 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, }, - { 5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, }, - { 5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, }, - { 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, }, - { 0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, }, - { 0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, }, - { 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, }, - { 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, }, - { 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, }, - { 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, }, - { 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, }, - { 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, }, - { 3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, }, - { 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, }, - { 9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, }, - {11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, }, - {11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, }, - { 4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, }, - { 4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, }, - { 9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, }, - { 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, }, - { 0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - { 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, } - }; -} From 8cff2bb2da97d0225a25847379e55b570a15c2cd Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 16:43:29 +0100 Subject: [PATCH 244/259] Moved random vectors to header files. --- library/PolyVoxCore/CMakeLists.txt | 4 +- .../PolyVoxCore/Impl/RandomUnitVectors.h | 1028 +++++++++++++++- .../include/PolyVoxCore/Impl/RandomVectors.h | 1028 +++++++++++++++- .../source/Impl/RandomUnitVectors.cpp | 1055 ----------------- .../PolyVoxCore/source/Impl/RandomVectors.cpp | 1055 ----------------- 5 files changed, 2056 insertions(+), 2114 deletions(-) delete mode 100644 library/PolyVoxCore/source/Impl/RandomUnitVectors.cpp delete mode 100644 library/PolyVoxCore/source/Impl/RandomVectors.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index ed717e07..2e2cb8b0 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -85,8 +85,8 @@ SET(IMPL_SRC_FILES source/Impl/ErrorHandling.cpp source/Impl/Logging.cpp #source/Impl/MarchingCubesTables.cpp - source/Impl/RandomUnitVectors.cpp - source/Impl/RandomVectors.cpp + #source/Impl/RandomUnitVectors.cpp + #source/Impl/RandomVectors.cpp source/Impl/Timer.cpp source/Impl/Utility.cpp ) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h index 69d2af1e..aac04c05 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h @@ -30,7 +30,1033 @@ freely, subject to the following restrictions: namespace PolyVox { - extern POLYVOX_API const Vector3DFloat randomUnitVectors[]; + const Vector3DFloat randomUnitVectors[1024] = + { + Vector3DFloat(+0.339922f, +0.827727f, -0.446454f), + Vector3DFloat(+0.084104f, -0.552666f, -0.829148f), + Vector3DFloat(+0.272549f, -0.946890f, +0.170637f), + Vector3DFloat(-0.366941f, -0.785500f, -0.498341f), + Vector3DFloat(-0.566493f, -0.533056f, +0.628440f), + Vector3DFloat(+0.964857f, -0.261032f, -0.030203f), + Vector3DFloat(+0.692249f, -0.251370f, +0.676465f), + Vector3DFloat(-0.962508f, -0.173232f, -0.208734f), + Vector3DFloat(-0.659700f, +0.712315f, +0.239589f), + Vector3DFloat(+0.818392f, -0.574522f, +0.012631f), + Vector3DFloat(+0.560367f, -0.792890f, -0.239405f), + Vector3DFloat(+0.906429f, -0.307885f, +0.289127f), + Vector3DFloat(-0.159051f, +0.461737f, +0.872641f), + Vector3DFloat(-0.231332f, +0.080769f, +0.969516f), + Vector3DFloat(-0.053423f, +0.774833f, +0.629904f), + Vector3DFloat(+0.824248f, -0.144982f, +0.547353f), + Vector3DFloat(+0.174020f, -0.439121f, -0.881413f), + Vector3DFloat(+0.467553f, +0.882007f, -0.058800f), + Vector3DFloat(+0.538442f, -0.808622f, +0.237089f), + Vector3DFloat(+0.502236f, +0.150786f, -0.851483f), + Vector3DFloat(+0.735645f, +0.569407f, -0.366882f), + Vector3DFloat(-0.855825f, -0.328077f, -0.399912f), + Vector3DFloat(-0.474060f, -0.211393f, +0.854740f), + Vector3DFloat(+0.828518f, -0.114561f, +0.548119f), + Vector3DFloat(+0.740223f, -0.663929f, +0.106149f), + Vector3DFloat(-0.604006f, -0.756687f, +0.250204f), + Vector3DFloat(+0.382515f, -0.373773f, -0.844971f), + Vector3DFloat(-0.819034f, -0.162715f, -0.550188f), + Vector3DFloat(-0.982375f, +0.169525f, -0.078743f), + Vector3DFloat(+0.367097f, +0.380576f, +0.848765f), + Vector3DFloat(+0.569529f, +0.516287f, +0.639597f), + Vector3DFloat(-0.853575f, -0.243752f, +0.460429f), + Vector3DFloat(+0.678039f, -0.729861f, -0.086982f), + Vector3DFloat(-0.869225f, +0.393408f, +0.299462f), + Vector3DFloat(-0.916254f, -0.295218f, +0.270784f), + Vector3DFloat(-0.070601f, +0.873182f, +0.482253f), + Vector3DFloat(-0.863217f, +0.189580f, +0.467885f), + Vector3DFloat(-0.691774f, -0.687382f, -0.221257f), + Vector3DFloat(-0.229393f, -0.552390f, +0.801402f), + Vector3DFloat(+0.463007f, -0.161958f, -0.871432f), + Vector3DFloat(-0.952260f, +0.214379f, +0.217352f), + Vector3DFloat(+0.052543f, -0.983907f, +0.170781f), + Vector3DFloat(+0.286530f, +0.546131f, -0.787173f), + Vector3DFloat(+0.975618f, -0.202665f, +0.084242f), + Vector3DFloat(-0.946903f, +0.193782f, -0.256561f), + Vector3DFloat(+0.602392f, +0.563710f, +0.565115f), + Vector3DFloat(-0.419515f, -0.334134f, -0.844015f), + Vector3DFloat(+0.032529f, -0.018906f, -0.999292f), + Vector3DFloat(+0.683276f, +0.293783f, -0.668450f), + Vector3DFloat(+0.194348f, +0.974682f, +0.110565f), + Vector3DFloat(-0.140892f, +0.831281f, +0.537700f), + Vector3DFloat(+0.685721f, -0.335248f, -0.646062f), + Vector3DFloat(+0.308294f, +0.062479f, -0.949237f), + Vector3DFloat(-0.619897f, +0.133633f, -0.773220f), + Vector3DFloat(+0.568018f, -0.694982f, +0.440858f), + Vector3DFloat(+0.014460f, +0.810882f, -0.585031f), + Vector3DFloat(-0.939900f, +0.051870f, +0.337488f), + Vector3DFloat(+0.886477f, -0.450612f, -0.105395f), + Vector3DFloat(-0.787830f, +0.158037f, -0.595271f), + Vector3DFloat(-0.318153f, -0.830670f, -0.456910f), + Vector3DFloat(-0.106830f, -0.755766f, -0.646069f), + Vector3DFloat(-0.077610f, -0.893295f, -0.442720f), + Vector3DFloat(+0.321718f, -0.338373f, +0.884309f), + Vector3DFloat(+0.405993f, -0.037181f, +0.913119f), + Vector3DFloat(+0.635434f, -0.612340f, +0.470387f), + Vector3DFloat(-0.440661f, +0.527619f, -0.726248f), + Vector3DFloat(+0.682630f, +0.730693f, +0.010181f), + Vector3DFloat(+0.364300f, -0.398796f, -0.841574f), + Vector3DFloat(+0.023390f, -0.827974f, +0.560279f), + Vector3DFloat(-0.647533f, -0.750712f, +0.130894f), + Vector3DFloat(+0.618352f, +0.694153f, +0.368499f), + Vector3DFloat(+0.087485f, -0.552555f, +0.828872f), + Vector3DFloat(-0.317011f, -0.740865f, -0.592134f), + Vector3DFloat(+0.992075f, +0.089501f, +0.088190f), + Vector3DFloat(+0.660945f, -0.628212f, -0.410490f), + Vector3DFloat(-0.376167f, +0.394528f, -0.838359f), + Vector3DFloat(+0.761817f, -0.647395f, -0.022690f), + Vector3DFloat(+0.839361f, -0.432911f, -0.328727f), + Vector3DFloat(-0.411275f, +0.046377f, -0.910331f), + Vector3DFloat(+0.078506f, -0.797408f, +0.598312f), + Vector3DFloat(-0.381022f, +0.922073f, +0.067844f), + Vector3DFloat(-0.837489f, -0.501853f, +0.216232f), + Vector3DFloat(-0.993133f, +0.055873f, -0.102786f), + Vector3DFloat(+0.927419f, -0.354639f, -0.118844f), + Vector3DFloat(+0.159676f, +0.614049f, -0.772947f), + Vector3DFloat(-0.187074f, +0.846574f, +0.498312f), + Vector3DFloat(+0.516069f, +0.728369f, -0.450724f), + Vector3DFloat(-0.960108f, -0.233106f, -0.154447f), + Vector3DFloat(-0.987760f, -0.112007f, +0.108557f), + Vector3DFloat(+0.049202f, +0.998738f, -0.010071f), + Vector3DFloat(-0.821445f, +0.254709f, +0.510247f), + Vector3DFloat(+0.252350f, -0.204056f, +0.945876f), + Vector3DFloat(-0.398037f, +0.781383f, -0.480633f), + Vector3DFloat(+0.527785f, +0.747611f, -0.403137f), + Vector3DFloat(-0.998566f, +0.043248f, +0.031542f), + Vector3DFloat(+0.548139f, +0.684886f, +0.480078f), + Vector3DFloat(-0.566315f, -0.745438f, +0.351581f), + Vector3DFloat(-0.848496f, -0.030994f, +0.528294f), + Vector3DFloat(-0.070703f, +0.825305f, -0.560244f), + Vector3DFloat(+0.624014f, -0.043543f, +0.780199f), + Vector3DFloat(+0.964602f, -0.189230f, -0.183670f), + Vector3DFloat(+0.637905f, -0.539396f, +0.549663f), + Vector3DFloat(+0.114321f, +0.904904f, -0.409974f), + Vector3DFloat(-0.021617f, +0.186501f, +0.982217f), + Vector3DFloat(+0.469141f, -0.747866f, +0.469685f), + Vector3DFloat(+0.132117f, +0.385378f, +0.913252f), + Vector3DFloat(-0.252634f, -0.349595f, +0.902197f), + Vector3DFloat(-0.145421f, +0.945344f, +0.291851f), + Vector3DFloat(-0.600604f, +0.448416f, -0.661965f), + Vector3DFloat(+0.381683f, -0.700133f, -0.603433f), + Vector3DFloat(+0.569938f, -0.030470f, +0.821122f), + Vector3DFloat(+0.112037f, +0.915575f, +0.386225f), + Vector3DFloat(+0.059716f, -0.821586f, -0.566949f), + Vector3DFloat(-0.158273f, -0.639328f, -0.752468f), + Vector3DFloat(+0.001205f, -0.990747f, -0.135715f), + Vector3DFloat(-0.100969f, -0.176804f, -0.979054f), + Vector3DFloat(+0.169578f, -0.733794f, -0.657868f), + Vector3DFloat(+0.474056f, +0.669558f, -0.571807f), + Vector3DFloat(+0.014190f, -0.179546f, -0.983647f), + Vector3DFloat(-0.506680f, +0.784137f, -0.358337f), + Vector3DFloat(+0.402466f, +0.736544f, -0.543621f), + Vector3DFloat(-0.740589f, +0.430129f, +0.516252f), + Vector3DFloat(-0.731489f, -0.411418f, +0.543745f), + Vector3DFloat(-0.372220f, +0.822132f, -0.430756f), + Vector3DFloat(-0.403935f, +0.195178f, +0.893724f), + Vector3DFloat(+0.893255f, -0.191946f, +0.406512f), + Vector3DFloat(+0.257182f, +0.933321f, +0.250537f), + Vector3DFloat(-0.946047f, -0.252800f, +0.202699f), + Vector3DFloat(+0.287823f, -0.484935f, +0.825830f), + Vector3DFloat(+0.880378f, +0.321649f, +0.348535f), + Vector3DFloat(-0.820150f, +0.481236f, +0.309460f), + Vector3DFloat(-0.888465f, +0.169680f, -0.426425f), + Vector3DFloat(+0.761535f, -0.481027f, +0.434371f), + Vector3DFloat(+0.581314f, +0.037144f, -0.812831f), + Vector3DFloat(-0.014257f, -0.470925f, +0.882058f), + Vector3DFloat(+0.327440f, +0.265095f, -0.906922f), + Vector3DFloat(+0.445945f, +0.877176f, +0.178034f), + Vector3DFloat(+0.724926f, -0.523194f, -0.448052f), + Vector3DFloat(-0.649973f, +0.748818f, -0.129641f), + Vector3DFloat(-0.862141f, -0.181190f, -0.473163f), + Vector3DFloat(+0.546248f, -0.486978f, -0.681517f), + Vector3DFloat(-0.466403f, -0.132595f, +0.874578f), + Vector3DFloat(-0.726486f, +0.640533f, -0.248868f), + Vector3DFloat(-0.717238f, -0.164892f, +0.677038f), + Vector3DFloat(-0.173482f, -0.912751f, -0.369852f), + Vector3DFloat(+0.151425f, +0.097703f, +0.983628f), + Vector3DFloat(-0.367962f, +0.286588f, -0.884574f), + Vector3DFloat(-0.269776f, -0.681349f, +0.680430f), + Vector3DFloat(+0.587256f, +0.243525f, +0.771898f), + Vector3DFloat(+0.052027f, +0.391610f, -0.918659f), + Vector3DFloat(+0.991548f, -0.106357f, +0.074308f), + Vector3DFloat(+0.659039f, +0.457360f, -0.597067f), + Vector3DFloat(-0.626734f, -0.682082f, -0.376787f), + Vector3DFloat(-0.353101f, +0.033567f, -0.934983f), + Vector3DFloat(+0.621237f, -0.289495f, +0.728188f), + Vector3DFloat(+0.490845f, -0.189807f, +0.850320f), + Vector3DFloat(-0.699031f, -0.710681f, -0.079302f), + Vector3DFloat(-0.050094f, +0.880791f, +0.470847f), + Vector3DFloat(+0.070288f, -0.086374f, +0.993780f), + Vector3DFloat(+0.853154f, +0.022317f, +0.521181f), + Vector3DFloat(+0.230886f, +0.693269f, -0.682693f), + Vector3DFloat(-0.466130f, +0.883868f, -0.038727f), + Vector3DFloat(-0.551610f, +0.824661f, +0.125144f), + Vector3DFloat(-0.137494f, +0.409326f, -0.901968f), + Vector3DFloat(-0.890857f, -0.180159f, +0.417034f), + Vector3DFloat(+0.553659f, -0.392300f, +0.734549f), + Vector3DFloat(+0.406329f, -0.048366f, +0.912446f), + Vector3DFloat(-0.270581f, +0.233748f, -0.933888f), + Vector3DFloat(-0.197245f, +0.810087f, -0.552136f), + Vector3DFloat(+0.295429f, +0.704757f, +0.645011f), + Vector3DFloat(+0.717722f, -0.581869f, -0.382496f), + Vector3DFloat(+0.626543f, -0.539930f, +0.562067f), + Vector3DFloat(+0.971598f, -0.144608f, +0.187311f), + Vector3DFloat(-0.697722f, -0.464932f, -0.544998f), + Vector3DFloat(+0.457003f, +0.780926f, +0.425797f), + Vector3DFloat(+0.183694f, +0.717668f, -0.671720f), + Vector3DFloat(+0.251615f, -0.738280f, -0.625805f), + Vector3DFloat(+0.545768f, +0.806104f, +0.228766f), + Vector3DFloat(-0.928760f, -0.348049f, +0.127545f), + Vector3DFloat(+0.137432f, -0.972652f, -0.187242f), + Vector3DFloat(-0.804669f, -0.253834f, +0.536727f), + Vector3DFloat(-0.931569f, -0.252185f, -0.261882f), + Vector3DFloat(-0.604266f, -0.710349f, +0.360924f), + Vector3DFloat(-0.687860f, -0.535154f, -0.490367f), + Vector3DFloat(+0.017091f, +0.824354f, -0.565817f), + Vector3DFloat(+0.978598f, +0.134960f, +0.155346f), + Vector3DFloat(-0.802635f, +0.545353f, -0.241595f), + Vector3DFloat(+0.155235f, +0.909842f, +0.384824f), + Vector3DFloat(+0.499090f, -0.206100f, -0.841684f), + Vector3DFloat(-0.474793f, -0.216500f, +0.853053f), + Vector3DFloat(-0.317506f, -0.762610f, -0.563575f), + Vector3DFloat(-0.914433f, +0.049911f, -0.401649f), + Vector3DFloat(+0.209168f, +0.632836f, -0.745498f), + Vector3DFloat(+0.571789f, +0.197009f, -0.796395f), + Vector3DFloat(-0.364670f, +0.917590f, -0.158254f), + Vector3DFloat(-0.966271f, +0.140594f, -0.215761f), + Vector3DFloat(-0.915867f, +0.394413f, +0.075008f), + Vector3DFloat(+0.035516f, +0.991982f, -0.121285f), + Vector3DFloat(+0.334756f, -0.834260f, +0.438120f), + Vector3DFloat(+0.471469f, +0.810497f, -0.347579f), + Vector3DFloat(-0.630204f, -0.370799f, -0.682166f), + Vector3DFloat(+0.752076f, -0.232512f, +0.616701f), + Vector3DFloat(+0.780218f, -0.524134f, +0.341385f), + Vector3DFloat(-0.717151f, -0.558684f, -0.416614f), + Vector3DFloat(+0.026975f, +0.354843f, +0.934537f), + Vector3DFloat(+0.660713f, -0.205604f, +0.721931f), + Vector3DFloat(+0.569071f, -0.717916f, +0.400942f), + Vector3DFloat(+0.345670f, +0.917475f, -0.196853f), + Vector3DFloat(+0.109370f, +0.150700f, -0.982511f), + Vector3DFloat(-0.075296f, +0.867593f, -0.491541f), + Vector3DFloat(+0.427583f, +0.181258f, -0.885617f), + Vector3DFloat(-0.423011f, -0.536708f, +0.730073f), + Vector3DFloat(+0.410061f, +0.902819f, +0.129491f), + Vector3DFloat(+0.783330f, +0.352044f, -0.512307f), + Vector3DFloat(+0.019660f, +0.294402f, +0.955480f), + Vector3DFloat(+0.370284f, +0.795152f, -0.480232f), + Vector3DFloat(+0.620337f, +0.569302f, -0.539516f), + Vector3DFloat(-0.947343f, -0.008934f, +0.320097f), + Vector3DFloat(-0.093679f, +0.931693f, -0.350960f), + Vector3DFloat(-0.555730f, +0.665103f, +0.498802f), + Vector3DFloat(+0.319960f, +0.176651f, -0.930817f), + Vector3DFloat(-0.679840f, +0.281903f, +0.677014f), + Vector3DFloat(-0.954067f, +0.193782f, +0.228484f), + Vector3DFloat(+0.592922f, -0.708226f, +0.383222f), + Vector3DFloat(-0.759157f, -0.391265f, +0.520184f), + Vector3DFloat(-0.256083f, +0.304044f, +0.917594f), + Vector3DFloat(-0.462124f, +0.481197f, +0.744910f), + Vector3DFloat(-0.679480f, +0.733098f, +0.029563f), + Vector3DFloat(+0.025552f, -0.585890f, -0.809987f), + Vector3DFloat(-0.060045f, +0.002791f, +0.998192f), + Vector3DFloat(-0.507954f, +0.858736f, +0.067494f), + Vector3DFloat(-0.060525f, +0.636414f, -0.768969f), + Vector3DFloat(-0.874884f, +0.448472f, -0.182895f), + Vector3DFloat(+0.643562f, +0.762645f, -0.064807f), + Vector3DFloat(-0.516967f, -0.154231f, +0.841996f), + Vector3DFloat(+0.448249f, -0.717116f, -0.533683f), + Vector3DFloat(+0.536270f, -0.786853f, +0.305411f), + Vector3DFloat(+0.000761f, +0.527854f, -0.849335f), + Vector3DFloat(+0.723561f, -0.634332f, +0.272181f), + Vector3DFloat(+0.112740f, -0.371782f, -0.921449f), + Vector3DFloat(+0.966055f, +0.051903f, +0.253070f), + Vector3DFloat(-0.600327f, +0.248981f, -0.760011f), + Vector3DFloat(+0.091875f, +0.041693f, -0.994897f), + Vector3DFloat(-0.302152f, +0.607269f, +0.734798f), + Vector3DFloat(+0.287662f, -0.651858f, -0.701663f), + Vector3DFloat(-0.004536f, +0.679631f, +0.733540f), + Vector3DFloat(+0.526143f, +0.799583f, -0.289551f), + Vector3DFloat(-0.603927f, +0.789648f, -0.108294f), + Vector3DFloat(-0.033126f, +0.944024f, -0.328210f), + Vector3DFloat(-0.167102f, -0.851884f, -0.496358f), + Vector3DFloat(+0.288185f, -0.113731f, +0.950797f), + Vector3DFloat(+0.578194f, -0.436702f, -0.689190f), + Vector3DFloat(+0.217496f, +0.313876f, +0.924217f), + Vector3DFloat(-0.915961f, -0.158736f, -0.368535f), + Vector3DFloat(-0.498651f, +0.155245f, +0.852787f), + Vector3DFloat(-0.248762f, +0.679310f, -0.690403f), + Vector3DFloat(-0.582908f, +0.077123f, +0.808870f), + Vector3DFloat(+0.686950f, +0.229251f, -0.689597f), + Vector3DFloat(-0.647296f, +0.760051f, +0.057711f), + Vector3DFloat(-0.485938f, -0.092580f, +0.869076f), + Vector3DFloat(+0.418369f, +0.089460f, -0.903861f), + Vector3DFloat(-0.047269f, +0.350493f, -0.935372f), + Vector3DFloat(-0.242049f, -0.214469f, +0.946264f), + Vector3DFloat(-0.804456f, +0.566448f, +0.178852f), + Vector3DFloat(+0.097365f, -0.900938f, +0.422885f), + Vector3DFloat(+0.956649f, +0.290563f, +0.019905f), + Vector3DFloat(-0.783547f, +0.574387f, -0.236925f), + Vector3DFloat(-0.308724f, -0.086733f, -0.947189f), + Vector3DFloat(-0.035715f, +0.856029f, -0.515692f), + Vector3DFloat(+0.920461f, +0.190617f, +0.341199f), + Vector3DFloat(+0.637306f, +0.769628f, -0.038913f), + Vector3DFloat(-0.040111f, +0.877976f, +0.477021f), + Vector3DFloat(+0.110588f, +0.251198f, +0.961598f), + Vector3DFloat(-0.391595f, +0.858960f, +0.329911f), + Vector3DFloat(+0.159040f, +0.801465f, -0.576507f), + Vector3DFloat(-0.420361f, +0.896705f, +0.138623f), + Vector3DFloat(-0.706685f, -0.506701f, -0.493812f), + Vector3DFloat(+0.589701f, +0.807018f, -0.031213f), + Vector3DFloat(+0.613812f, +0.504595f, -0.607140f), + Vector3DFloat(+0.453930f, +0.802963f, +0.386261f), + Vector3DFloat(+0.034816f, +0.204525f, +0.978242f), + Vector3DFloat(+0.557178f, -0.795610f, +0.237816f), + Vector3DFloat(+0.694672f, -0.364363f, +0.620218f), + Vector3DFloat(+0.703004f, +0.571702f, +0.423015f), + Vector3DFloat(-0.821828f, -0.569379f, +0.020152f), + Vector3DFloat(+0.999573f, +0.011862f, +0.026716f), + Vector3DFloat(+0.045244f, +0.476148f, +0.878201f), + Vector3DFloat(-0.879083f, +0.458490f, +0.130387f), + Vector3DFloat(-0.548204f, +0.534573f, -0.643198f), + Vector3DFloat(+0.371419f, +0.536568f, +0.757722f), + Vector3DFloat(-0.121365f, +0.656202f, -0.744761f), + Vector3DFloat(-0.594210f, +0.803019f, -0.045540f), + Vector3DFloat(+0.249812f, +0.564218f, -0.786926f), + Vector3DFloat(+0.807295f, +0.588715f, -0.041117f), + Vector3DFloat(-0.333582f, +0.911830f, +0.239350f), + Vector3DFloat(+0.437116f, -0.527554f, -0.728434f), + Vector3DFloat(+0.061956f, +0.967757f, +0.244147f), + Vector3DFloat(+0.511582f, -0.822519f, -0.248487f), + Vector3DFloat(-0.341118f, -0.068048f, -0.937554f), + Vector3DFloat(+0.387840f, +0.793197f, +0.469487f), + Vector3DFloat(+0.682570f, +0.445391f, -0.579418f), + Vector3DFloat(+0.769534f, -0.445299f, -0.457740f), + Vector3DFloat(-0.883027f, -0.468901f, -0.019884f), + Vector3DFloat(-0.595228f, +0.589924f, +0.545613f), + Vector3DFloat(+0.123593f, +0.850082f, +0.511943f), + Vector3DFloat(+0.428617f, -0.326588f, -0.842394f), + Vector3DFloat(-0.838837f, +0.492096f, +0.232796f), + Vector3DFloat(-0.912950f, -0.283450f, -0.293562f), + Vector3DFloat(-0.701007f, +0.660260f, +0.269527f), + Vector3DFloat(-0.726761f, -0.673596f, -0.134488f), + Vector3DFloat(+0.969362f, -0.234200f, +0.074084f), + Vector3DFloat(-0.249448f, -0.056271f, +0.966752f), + Vector3DFloat(+0.996651f, -0.018843f, +0.079570f), + Vector3DFloat(+0.807648f, +0.476489f, +0.347367f), + Vector3DFloat(-0.749837f, -0.398796f, -0.527926f), + Vector3DFloat(+0.739222f, +0.268296f, +0.617712f), + Vector3DFloat(+0.770822f, -0.517357f, -0.371720f), + Vector3DFloat(-0.799675f, +0.207189f, +0.563554f), + Vector3DFloat(+0.858095f, +0.081493f, +0.506983f), + Vector3DFloat(+0.677579f, -0.727246f, +0.109543f), + Vector3DFloat(-0.745912f, -0.097643f, +0.658848f), + Vector3DFloat(+0.923446f, -0.321145f, +0.210033f), + Vector3DFloat(+0.633275f, +0.749248f, -0.193880f), + Vector3DFloat(+0.445950f, +0.115095f, +0.887627f), + Vector3DFloat(-0.813021f, +0.255444f, -0.523207f), + Vector3DFloat(-0.872976f, -0.483345f, -0.065502f), + Vector3DFloat(+0.587776f, +0.807323f, -0.052440f), + Vector3DFloat(-0.324123f, +0.518088f, -0.791536f), + Vector3DFloat(+0.041866f, +0.935359f, -0.351214f), + Vector3DFloat(-0.745819f, -0.037221f, -0.665108f), + Vector3DFloat(-0.625395f, -0.780290f, -0.005274f), + Vector3DFloat(-0.949212f, -0.125200f, -0.288653f), + Vector3DFloat(+0.746352f, +0.513825f, -0.423016f), + Vector3DFloat(+0.165203f, -0.819308f, -0.549038f), + Vector3DFloat(+0.749447f, -0.199908f, +0.631162f), + Vector3DFloat(-0.935221f, +0.313398f, +0.164751f), + Vector3DFloat(+0.574888f, +0.577243f, -0.579908f), + Vector3DFloat(+0.213935f, -0.439668f, +0.872309f), + Vector3DFloat(-0.067281f, -0.429365f, -0.900621f), + Vector3DFloat(-0.675176f, -0.265100f, -0.688374f), + Vector3DFloat(-0.940780f, -0.187993f, +0.282119f), + Vector3DFloat(+0.608412f, -0.674603f, -0.418026f), + Vector3DFloat(+0.226805f, -0.971072f, -0.074690f), + Vector3DFloat(-0.922002f, -0.058313f, -0.382768f), + Vector3DFloat(-0.889078f, -0.285307f, +0.357968f), + Vector3DFloat(-0.463386f, -0.780956f, +0.418785f), + Vector3DFloat(+0.480335f, -0.863968f, +0.151120f), + Vector3DFloat(-0.467641f, -0.601770f, -0.647444f), + Vector3DFloat(+0.752364f, -0.628982f, +0.195781f), + Vector3DFloat(+0.068107f, -0.990481f, -0.119616f), + Vector3DFloat(+0.225170f, -0.147543f, +0.963083f), + Vector3DFloat(+0.225228f, +0.971322f, +0.076195f), + Vector3DFloat(-0.991397f, -0.118660f, +0.055239f), + Vector3DFloat(-0.160493f, -0.746967f, +0.645200f), + Vector3DFloat(-0.458821f, -0.208468f, +0.863727f), + Vector3DFloat(+0.333033f, +0.516134f, +0.789110f), + Vector3DFloat(+0.732654f, +0.260905f, -0.628607f), + Vector3DFloat(-0.669918f, -0.656301f, -0.347102f), + Vector3DFloat(-0.786699f, +0.543142f, -0.293431f), + Vector3DFloat(+0.347036f, +0.004466f, +0.937841f), + Vector3DFloat(-0.484482f, -0.771461f, +0.412463f), + Vector3DFloat(+0.103332f, +0.547687f, -0.830278f), + Vector3DFloat(+0.119923f, -0.930107f, -0.347159f), + Vector3DFloat(+0.005754f, +0.994568f, +0.103930f), + Vector3DFloat(-0.033282f, +0.896829f, +0.441124f), + Vector3DFloat(+0.457958f, +0.771949f, +0.440874f), + Vector3DFloat(-0.519990f, +0.369290f, -0.770218f), + Vector3DFloat(-0.171662f, -0.061337f, -0.983245f), + Vector3DFloat(+0.250848f, +0.937167f, -0.242472f), + Vector3DFloat(-0.527961f, -0.608927f, +0.592001f), + Vector3DFloat(+0.524343f, -0.097826f, +0.845869f), + Vector3DFloat(-0.900974f, +0.373399f, +0.220951f), + Vector3DFloat(+0.287497f, +0.561963f, +0.775592f), + Vector3DFloat(+0.540008f, +0.803719f, -0.249855f), + Vector3DFloat(+0.566511f, +0.497948f, -0.656592f), + Vector3DFloat(+0.337228f, +0.656232f, -0.675009f), + Vector3DFloat(+0.978888f, -0.153522f, -0.134940f), + Vector3DFloat(+0.720676f, +0.649026f, +0.243702f), + Vector3DFloat(+0.530737f, +0.228155f, -0.816250f), + Vector3DFloat(+0.429492f, +0.091242f, -0.898449f), + Vector3DFloat(-0.572942f, +0.085360f, +0.815139f), + Vector3DFloat(+0.918652f, -0.255422f, +0.301395f), + Vector3DFloat(+0.947882f, -0.087598f, +0.306343f), + Vector3DFloat(+0.108362f, +0.969752f, -0.218719f), + Vector3DFloat(-0.471217f, +0.713578f, +0.518421f), + Vector3DFloat(+0.750274f, -0.244288f, -0.614339f), + Vector3DFloat(+0.560909f, -0.563116f, -0.606862f), + Vector3DFloat(+0.863412f, -0.431809f, +0.260886f), + Vector3DFloat(+0.316636f, +0.937246f, -0.145983f), + Vector3DFloat(-0.292652f, +0.171648f, +0.940687f), + Vector3DFloat(-0.636577f, +0.687143f, -0.350149f), + Vector3DFloat(+0.876483f, +0.262488f, +0.403581f), + Vector3DFloat(-0.477533f, +0.501607f, +0.721355f), + Vector3DFloat(+0.620654f, +0.186584f, +0.761561f), + Vector3DFloat(+0.085796f, +0.736783f, +0.670664f), + Vector3DFloat(-0.444489f, -0.220480f, -0.868227f), + Vector3DFloat(-0.380013f, +0.496385f, +0.780508f), + Vector3DFloat(+0.076912f, -0.385017f, -0.919699f), + Vector3DFloat(+0.148937f, -0.407401f, -0.901023f), + Vector3DFloat(+0.790103f, +0.361770f, -0.494833f), + Vector3DFloat(+0.206634f, +0.909197f, +0.361474f), + Vector3DFloat(+0.171861f, -0.895971f, -0.409512f), + Vector3DFloat(-0.961243f, +0.146552f, -0.233527f), + Vector3DFloat(-0.142180f, +0.815553f, +0.560944f), + Vector3DFloat(-0.423930f, -0.030949f, +0.905166f), + Vector3DFloat(+0.618879f, -0.685650f, +0.383241f), + Vector3DFloat(-0.209245f, +0.545013f, +0.811898f), + Vector3DFloat(+0.377987f, +0.747944f, -0.545624f), + Vector3DFloat(-0.791300f, +0.607509f, -0.069108f), + Vector3DFloat(+0.754199f, -0.113604f, -0.646744f), + Vector3DFloat(-0.583229f, -0.063801f, +0.809798f), + Vector3DFloat(-0.469901f, +0.015164f, +0.882589f), + Vector3DFloat(-0.978270f, +0.003442f, -0.207306f), + Vector3DFloat(+0.655500f, +0.726545f, +0.206039f), + Vector3DFloat(+0.967185f, -0.245972f, +0.063652f), + Vector3DFloat(-0.442760f, +0.675317f, +0.589840f), + Vector3DFloat(+0.403392f, +0.270425f, +0.874154f), + Vector3DFloat(+0.902052f, +0.135317f, +0.409868f), + Vector3DFloat(-0.210257f, -0.926257f, -0.312794f), + Vector3DFloat(-0.933559f, -0.225815f, -0.278344f), + Vector3DFloat(-0.635320f, +0.772243f, -0.003054f), + Vector3DFloat(-0.554821f, +0.812428f, -0.179259f), + Vector3DFloat(-0.844807f, +0.091109f, -0.527258f), + Vector3DFloat(-0.748601f, +0.549263f, -0.371358f), + Vector3DFloat(-0.081435f, +0.491490f, -0.867067f), + Vector3DFloat(+0.005014f, -0.658765f, +0.752332f), + Vector3DFloat(-0.384916f, +0.588836f, -0.710712f), + Vector3DFloat(-0.563287f, -0.436926f, -0.701287f), + Vector3DFloat(+0.075923f, -0.889985f, +0.449624f), + Vector3DFloat(+0.460179f, +0.240506f, -0.854630f), + Vector3DFloat(+0.133134f, +0.863013f, +0.487323f), + Vector3DFloat(-0.451891f, -0.691915f, +0.563071f), + Vector3DFloat(+0.482576f, +0.491924f, -0.724659f), + Vector3DFloat(-0.772395f, +0.503554f, +0.387091f), + Vector3DFloat(-0.861070f, -0.363456f, -0.355610f), + Vector3DFloat(-0.219092f, -0.539591f, +0.812921f), + Vector3DFloat(-0.232021f, +0.937887f, +0.257940f), + Vector3DFloat(+0.864410f, +0.411132f, +0.289425f), + Vector3DFloat(-0.657914f, +0.356283f, +0.663485f), + Vector3DFloat(-0.695536f, -0.354660f, -0.624856f), + Vector3DFloat(-0.984126f, +0.139830f, -0.109283f), + Vector3DFloat(-0.739931f, -0.568047f, +0.360312f), + Vector3DFloat(-0.422765f, +0.793857f, -0.437105f), + Vector3DFloat(+0.695244f, +0.499122f, +0.517216f), + Vector3DFloat(+0.620847f, +0.772096f, +0.135708f), + Vector3DFloat(+0.640543f, +0.693625f, -0.329529f), + Vector3DFloat(-0.716203f, +0.695845f, -0.053417f), + Vector3DFloat(+0.688286f, -0.614140f, +0.386127f), + Vector3DFloat(+0.990001f, -0.012803f, -0.140479f), + Vector3DFloat(-0.842904f, +0.537664f, +0.020753f), + Vector3DFloat(+0.008333f, +0.285713f, +0.958279f), + Vector3DFloat(-0.276086f, -0.823605f, +0.495431f), + Vector3DFloat(+0.795835f, -0.446944f, +0.408518f), + Vector3DFloat(-0.068520f, +0.989143f, -0.130001f), + Vector3DFloat(-0.995477f, -0.013318f, -0.094068f), + Vector3DFloat(-0.013256f, -0.205680f, +0.978530f), + Vector3DFloat(+0.286330f, +0.478558f, +0.830058f), + Vector3DFloat(-0.312670f, -0.000134f, +0.949862f), + Vector3DFloat(-0.992102f, -0.018784f, -0.124017f), + Vector3DFloat(-0.218201f, +0.471729f, +0.854318f), + Vector3DFloat(-0.885932f, -0.441603f, +0.141812f), + Vector3DFloat(+0.410418f, -0.903853f, +0.120862f), + Vector3DFloat(-0.046755f, -0.618559f, +0.784346f), + Vector3DFloat(+0.561077f, +0.827730f, +0.007490f), + Vector3DFloat(-0.264927f, +0.963738f, +0.031968f), + Vector3DFloat(+0.360743f, +0.887368f, -0.287127f), + Vector3DFloat(+0.829757f, -0.531319f, -0.170889f), + Vector3DFloat(-0.716516f, -0.646065f, +0.263068f), + Vector3DFloat(+0.557460f, +0.677923f, -0.479227f), + Vector3DFloat(-0.709849f, +0.694781f, -0.115733f), + Vector3DFloat(+0.853291f, -0.488531f, -0.182299f), + Vector3DFloat(+0.455284f, -0.849392f, -0.266925f), + Vector3DFloat(+0.417165f, +0.856319f, -0.304453f), + Vector3DFloat(+0.871881f, +0.388090f, +0.298681f), + Vector3DFloat(-0.103988f, +0.510844f, -0.853361f), + Vector3DFloat(+0.351047f, +0.889847f, -0.291441f), + Vector3DFloat(+0.389540f, -0.053379f, -0.919462f), + Vector3DFloat(-0.581684f, +0.075521f, +0.809901f), + Vector3DFloat(-0.422965f, -0.141455f, +0.895037f), + Vector3DFloat(+0.213377f, +0.454586f, -0.864767f), + Vector3DFloat(+0.159390f, +0.466820f, +0.869870f), + Vector3DFloat(+0.385902f, -0.013831f, +0.922436f), + Vector3DFloat(-0.360291f, -0.335817f, -0.870297f), + Vector3DFloat(-0.420892f, +0.570921f, -0.704910f), + Vector3DFloat(+0.046113f, -0.619140f, -0.783925f), + Vector3DFloat(+0.454440f, +0.871791f, -0.182935f), + Vector3DFloat(+0.523305f, -0.762818f, +0.379816f), + Vector3DFloat(-0.639517f, -0.634506f, -0.434073f), + Vector3DFloat(+0.286115f, -0.720485f, +0.631695f), + Vector3DFloat(+0.391046f, -0.912504f, -0.120079f), + Vector3DFloat(+0.562545f, +0.825619f, +0.043556f), + Vector3DFloat(+0.976939f, +0.145670f, -0.156113f), + Vector3DFloat(-0.197444f, -0.653530f, -0.730695f), + Vector3DFloat(-0.727176f, +0.159246f, +0.667724f), + Vector3DFloat(+0.977135f, +0.039408f, +0.208935f), + Vector3DFloat(+0.487883f, -0.668376f, -0.561466f), + Vector3DFloat(+0.081173f, -0.454129f, -0.887231f), + Vector3DFloat(+0.007776f, -0.558369f, -0.829556f), + Vector3DFloat(+0.392559f, -0.216208f, +0.893952f), + Vector3DFloat(+0.552351f, -0.797994f, -0.241067f), + Vector3DFloat(-0.812645f, +0.582758f, -0.000884f), + Vector3DFloat(+0.723477f, +0.425448f, +0.543668f), + Vector3DFloat(-0.290387f, -0.824836f, +0.485099f), + Vector3DFloat(-0.648037f, +0.731057f, +0.213549f), + Vector3DFloat(-0.112077f, +0.911214f, +0.396394f), + Vector3DFloat(-0.257374f, +0.878627f, +0.402212f), + Vector3DFloat(-0.871679f, -0.449228f, -0.195884f), + Vector3DFloat(-0.832643f, +0.503619f, -0.230377f), + Vector3DFloat(-0.750683f, +0.454826f, -0.479174f), + Vector3DFloat(+0.668945f, -0.737419f, +0.093412f), + Vector3DFloat(+0.232689f, -0.239415f, -0.942622f), + Vector3DFloat(+0.932416f, +0.058455f, -0.356629f), + Vector3DFloat(-0.266008f, -0.899388f, +0.346900f), + Vector3DFloat(+0.574940f, -0.817948f, -0.020127f), + Vector3DFloat(-0.332832f, +0.728233f, +0.599083f), + Vector3DFloat(+0.252574f, -0.202957f, +0.946052f), + Vector3DFloat(+0.614750f, -0.787545f, +0.043079f), + Vector3DFloat(+0.502885f, +0.757385f, -0.416503f), + Vector3DFloat(-0.829003f, +0.454711f, -0.325562f), + Vector3DFloat(-0.568805f, +0.542102f, +0.618536f), + Vector3DFloat(-0.024095f, -0.673837f, -0.738487f), + Vector3DFloat(+0.138735f, -0.428584f, -0.892787f), + Vector3DFloat(-0.535936f, -0.016858f, +0.844090f), + Vector3DFloat(-0.040976f, +0.588714f, +0.807302f), + Vector3DFloat(-0.691862f, -0.721945f, +0.011050f), + Vector3DFloat(+0.862563f, -0.438786f, -0.251897f), + Vector3DFloat(+0.278186f, +0.894754f, +0.349326f), + Vector3DFloat(-0.377682f, -0.908327f, +0.179719f), + Vector3DFloat(-0.632125f, -0.611940f, +0.475339f), + Vector3DFloat(-0.575327f, -0.789967f, -0.212015f), + Vector3DFloat(+0.112909f, -0.993543f, -0.011156f), + Vector3DFloat(+0.593082f, -0.037683f, -0.804260f), + Vector3DFloat(-0.067094f, -0.620832f, +0.781067f), + Vector3DFloat(-0.152754f, +0.253291f, -0.955254f), + Vector3DFloat(-0.325782f, +0.882758f, -0.338533f), + Vector3DFloat(+0.359581f, -0.906944f, +0.219441f), + Vector3DFloat(-0.436527f, +0.597887f, +0.672291f), + Vector3DFloat(-0.475060f, +0.315753f, +0.821351f), + Vector3DFloat(-0.504146f, +0.392763f, -0.769138f), + Vector3DFloat(+0.732747f, -0.275063f, -0.622432f), + Vector3DFloat(-0.222604f, +0.239178f, +0.945115f), + Vector3DFloat(+0.929953f, +0.212024f, +0.300389f), + Vector3DFloat(+0.212224f, -0.914623f, -0.344129f), + Vector3DFloat(+0.744091f, -0.069074f, +0.664498f), + Vector3DFloat(+0.378632f, +0.925135f, -0.027624f), + Vector3DFloat(-0.657970f, +0.042972f, +0.751817f), + Vector3DFloat(-0.475295f, -0.858227f, -0.193754f), + Vector3DFloat(-0.002138f, -0.163379f, -0.986561f), + Vector3DFloat(+0.762016f, +0.464503f, -0.451186f), + Vector3DFloat(+0.110962f, +0.350977f, +0.929786f), + Vector3DFloat(+0.359220f, -0.409270f, +0.838725f), + Vector3DFloat(+0.067679f, -0.492517f, -0.867667f), + Vector3DFloat(-0.765643f, -0.627245f, -0.142671f), + Vector3DFloat(-0.736364f, -0.613024f, -0.286304f), + Vector3DFloat(-0.404067f, -0.396451f, +0.824352f), + Vector3DFloat(-0.908793f, +0.158289f, +0.386057f), + Vector3DFloat(-0.582767f, +0.467557f, +0.664660f), + Vector3DFloat(+0.437506f, -0.078200f, -0.895809f), + Vector3DFloat(+0.079580f, -0.165593f, -0.982978f), + Vector3DFloat(-0.152308f, +0.193183f, +0.969269f), + Vector3DFloat(+0.537776f, -0.029450f, -0.842573f), + Vector3DFloat(+0.242145f, -0.450593f, +0.859262f), + Vector3DFloat(-0.731540f, -0.287459f, +0.618237f), + Vector3DFloat(-0.822775f, +0.200303f, +0.531903f), + Vector3DFloat(+0.814744f, -0.396544f, +0.423019f), + Vector3DFloat(+0.981241f, +0.108708f, -0.159215f), + Vector3DFloat(+0.435099f, -0.134466f, -0.890285f), + Vector3DFloat(-0.863642f, -0.333093f, +0.378379f), + Vector3DFloat(+0.975214f, -0.007932f, +0.221121f), + Vector3DFloat(+0.562312f, +0.756514f, -0.333904f), + Vector3DFloat(-0.860757f, -0.321366f, -0.394743f), + Vector3DFloat(+0.202468f, +0.651174f, +0.731423f), + Vector3DFloat(+0.070835f, -0.997485f, -0.002525f), + Vector3DFloat(-0.282142f, -0.646099f, +0.709191f), + Vector3DFloat(+0.734636f, +0.546486f, -0.402073f), + Vector3DFloat(-0.792802f, +0.359455f, -0.492196f), + Vector3DFloat(+0.064556f, -0.768826f, +0.636192f), + Vector3DFloat(-0.387159f, -0.539262f, +0.747867f), + Vector3DFloat(-0.321231f, +0.945995f, +0.043642f), + Vector3DFloat(-0.051543f, -0.358058f, +0.932276f), + Vector3DFloat(+0.463676f, -0.211202f, +0.860464f), + Vector3DFloat(-0.985546f, -0.040806f, -0.164421f), + Vector3DFloat(-0.956965f, +0.289910f, -0.013071f), + Vector3DFloat(-0.575614f, -0.401429f, -0.712406f), + Vector3DFloat(+0.005411f, +0.912319f, +0.409443f), + Vector3DFloat(-0.147120f, +0.145609f, +0.978342f), + Vector3DFloat(+0.381181f, -0.303247f, +0.873351f), + Vector3DFloat(+0.646964f, -0.669990f, -0.364076f), + Vector3DFloat(+0.335662f, -0.334853f, +0.880457f), + Vector3DFloat(+0.812790f, -0.515621f, -0.271122f), + Vector3DFloat(+0.406265f, +0.443117f, -0.799122f), + Vector3DFloat(+0.818068f, +0.142779f, +0.557117f), + Vector3DFloat(-0.202146f, +0.482979f, +0.851979f), + Vector3DFloat(-0.359491f, -0.834883f, +0.416817f), + Vector3DFloat(+0.897243f, +0.373837f, -0.234949f), + Vector3DFloat(+0.734938f, -0.377211f, -0.563541f), + Vector3DFloat(+0.938936f, +0.089082f, +0.332362f), + Vector3DFloat(+0.847286f, +0.101367f, -0.521375f), + Vector3DFloat(+0.976962f, +0.212808f, -0.016060f), + Vector3DFloat(-0.484037f, -0.785288f, -0.386045f), + Vector3DFloat(+0.412432f, -0.846393f, -0.336925f), + Vector3DFloat(-0.290605f, -0.951829f, +0.097828f), + Vector3DFloat(+0.522856f, +0.099925f, -0.846544f), + Vector3DFloat(-0.268624f, -0.592962f, +0.759103f), + Vector3DFloat(+0.532873f, -0.247493f, +0.809193f), + Vector3DFloat(-0.313247f, +0.857502f, -0.408126f), + Vector3DFloat(-0.279136f, +0.481391f, +0.830870f), + Vector3DFloat(-0.648063f, -0.437447f, -0.623422f), + Vector3DFloat(+0.693159f, -0.411042f, +0.592094f), + Vector3DFloat(-0.361556f, -0.008347f, -0.932313f), + Vector3DFloat(-0.706752f, -0.017905f, +0.707235f), + Vector3DFloat(+0.277671f, +0.588210f, +0.759544f), + Vector3DFloat(+0.706147f, +0.436673f, -0.557380f), + Vector3DFloat(+0.329465f, -0.938612f, -0.102275f), + Vector3DFloat(+0.941491f, +0.304731f, -0.143996f), + Vector3DFloat(-0.530440f, -0.419970f, -0.736382f), + Vector3DFloat(-0.933059f, +0.333768f, -0.134161f), + Vector3DFloat(-0.799598f, -0.383384f, -0.462234f), + Vector3DFloat(+0.589799f, +0.017619f, -0.807358f), + Vector3DFloat(-0.157486f, -0.147213f, +0.976487f), + Vector3DFloat(+0.144612f, -0.765441f, +0.627046f), + Vector3DFloat(-0.224062f, +0.971686f, +0.074988f), + Vector3DFloat(-0.525446f, +0.743496f, +0.413666f), + Vector3DFloat(+0.913834f, -0.396502f, +0.087711f), + Vector3DFloat(+0.551810f, +0.713484f, -0.431793f), + Vector3DFloat(-0.988855f, +0.027355f, +0.146346f), + Vector3DFloat(+0.129678f, -0.922163f, +0.364417f), + Vector3DFloat(-0.443546f, +0.337851f, +0.830135f), + Vector3DFloat(-0.076099f, -0.128182f, -0.988827f), + Vector3DFloat(-0.930714f, -0.363326f, +0.042022f), + Vector3DFloat(-0.062724f, +0.597013f, -0.799776f), + Vector3DFloat(+0.674612f, -0.080125f, +0.733811f), + Vector3DFloat(-0.732149f, -0.106968f, -0.672693f), + Vector3DFloat(-0.477404f, -0.735544f, +0.480688f), + Vector3DFloat(+0.720306f, +0.691043f, +0.060162f), + Vector3DFloat(-0.480694f, -0.691928f, -0.538673f), + Vector3DFloat(+0.284364f, -0.490827f, +0.823545f), + Vector3DFloat(-0.467068f, -0.635840f, +0.614455f), + Vector3DFloat(+0.259424f, +0.728928f, +0.633532f), + Vector3DFloat(-0.829024f, +0.499711f, +0.251015f), + Vector3DFloat(+0.918101f, +0.199840f, +0.342278f), + Vector3DFloat(-0.132256f, +0.844697f, -0.518648f), + Vector3DFloat(-0.880945f, +0.470246f, +0.052958f), + Vector3DFloat(-0.907893f, +0.418701f, -0.020494f), + Vector3DFloat(-0.898489f, +0.435552f, -0.054882f), + Vector3DFloat(-0.181486f, -0.981241f, -0.065032f), + Vector3DFloat(+0.612484f, -0.390415f, -0.687342f), + Vector3DFloat(-0.674745f, +0.504350f, +0.538841f), + Vector3DFloat(-0.489037f, -0.427926f, +0.760080f), + Vector3DFloat(-0.629283f, +0.776741f, +0.026012f), + Vector3DFloat(-0.327015f, +0.559793f, +0.761375f), + Vector3DFloat(+0.143982f, -0.052568f, +0.988183f), + Vector3DFloat(+0.963642f, +0.246339f, -0.103498f), + Vector3DFloat(+0.083550f, +0.206217f, +0.974933f), + Vector3DFloat(+0.985008f, +0.097629f, -0.142221f), + Vector3DFloat(+0.386516f, -0.544556f, +0.744355f), + Vector3DFloat(-0.390134f, -0.377051f, +0.840017f), + Vector3DFloat(+0.188428f, -0.872526f, -0.450770f), + Vector3DFloat(-0.249415f, +0.963139f, +0.100774f), + Vector3DFloat(-0.246900f, -0.688081f, +0.682338f), + Vector3DFloat(-0.815515f, -0.341331f, -0.467363f), + Vector3DFloat(-0.828295f, -0.545972f, +0.125866f), + Vector3DFloat(-0.251196f, +0.860882f, +0.442473f), + Vector3DFloat(+0.787130f, -0.124629f, -0.604065f), + Vector3DFloat(-0.546825f, -0.350565f, +0.760320f), + Vector3DFloat(+0.910761f, +0.326941f, +0.252237f), + Vector3DFloat(-0.822947f, -0.029868f, +0.567332f), + Vector3DFloat(-0.119863f, -0.101264f, +0.987612f), + Vector3DFloat(+0.338978f, +0.251339f, +0.906600f), + Vector3DFloat(-0.168116f, +0.130641f, +0.977072f), + Vector3DFloat(+0.630274f, -0.051172f, +0.774685f), + Vector3DFloat(+0.509020f, +0.860289f, -0.028316f), + Vector3DFloat(-0.741184f, +0.614383f, -0.270518f), + Vector3DFloat(+0.783367f, +0.216068f, -0.582796f), + Vector3DFloat(-0.917044f, -0.239253f, -0.319042f), + Vector3DFloat(+0.326503f, +0.605534f, +0.725758f), + Vector3DFloat(-0.858028f, +0.033090f, +0.512536f), + Vector3DFloat(+0.920390f, +0.341687f, +0.190084f), + Vector3DFloat(+0.184870f, +0.206034f, -0.960923f), + Vector3DFloat(-0.320575f, -0.873361f, -0.366704f), + Vector3DFloat(-0.908564f, +0.179683f, -0.377129f), + Vector3DFloat(-0.995162f, +0.060094f, -0.077721f), + Vector3DFloat(-0.970805f, +0.057864f, +0.232786f), + Vector3DFloat(-0.438989f, -0.719230f, -0.538514f), + Vector3DFloat(-0.305764f, +0.586163f, +0.750281f), + Vector3DFloat(+0.813263f, +0.070638f, +0.577593f), + Vector3DFloat(-0.856072f, +0.356367f, -0.374356f), + Vector3DFloat(-0.291393f, -0.496711f, -0.817538f), + Vector3DFloat(-0.465919f, +0.423021f, +0.777157f), + Vector3DFloat(-0.197288f, +0.747479f, +0.634312f), + Vector3DFloat(+0.459532f, -0.294706f, +0.837842f), + Vector3DFloat(-0.669432f, -0.715572f, -0.199543f), + Vector3DFloat(+0.651361f, +0.729418f, -0.208995f), + Vector3DFloat(+0.899675f, -0.409092f, +0.152409f), + Vector3DFloat(-0.909013f, +0.374561f, +0.182756f), + Vector3DFloat(+0.584390f, +0.675714f, -0.449332f), + Vector3DFloat(-0.679644f, +0.693287f, -0.239658f), + Vector3DFloat(-0.447022f, -0.041260f, +0.893571f), + Vector3DFloat(-0.116547f, +0.050542f, -0.991898f), + Vector3DFloat(+0.395893f, +0.741111f, -0.542239f), + Vector3DFloat(+0.350204f, -0.445076f, -0.824175f), + Vector3DFloat(-0.172775f, +0.743090f, -0.646503f), + Vector3DFloat(+0.990144f, +0.139743f, -0.009361f), + Vector3DFloat(+0.519086f, +0.780496f, -0.348389f), + Vector3DFloat(-0.437746f, -0.398253f, +0.806085f), + Vector3DFloat(-0.008119f, +0.986280f, -0.164880f), + Vector3DFloat(+0.597715f, -0.604411f, -0.526711f), + Vector3DFloat(-0.097509f, +0.175580f, -0.979624f), + Vector3DFloat(+0.660655f, -0.124974f, +0.740214f), + Vector3DFloat(-0.206022f, +0.283440f, -0.936599f), + Vector3DFloat(-0.702342f, +0.672455f, -0.233496f), + Vector3DFloat(+0.306125f, -0.350950f, -0.884942f), + Vector3DFloat(+0.572172f, -0.424424f, -0.701772f), + Vector3DFloat(-0.218533f, -0.939401f, -0.264138f), + Vector3DFloat(+0.409469f, -0.491877f, -0.768370f), + Vector3DFloat(-0.651781f, -0.191800f, +0.733754f), + Vector3DFloat(+0.900352f, -0.242264f, -0.361490f), + Vector3DFloat(+0.809489f, +0.255902f, -0.528434f), + Vector3DFloat(+0.615724f, -0.777952f, +0.125199f), + Vector3DFloat(-0.337892f, -0.510143f, -0.790938f), + Vector3DFloat(-0.326182f, -0.695879f, +0.639811f), + Vector3DFloat(-0.877877f, -0.220692f, +0.425002f), + Vector3DFloat(+0.837897f, -0.278492f, -0.469436f), + Vector3DFloat(-0.802587f, -0.151114f, +0.577077f), + Vector3DFloat(+0.409855f, +0.796889f, -0.443832f), + Vector3DFloat(-0.374483f, +0.669830f, -0.641164f), + Vector3DFloat(-0.745860f, +0.343937f, -0.570438f), + Vector3DFloat(-0.202905f, +0.156353f, +0.966635f), + Vector3DFloat(+0.556026f, +0.322254f, -0.766151f), + Vector3DFloat(+0.776714f, +0.240272f, -0.582224f), + Vector3DFloat(-0.125301f, +0.638214f, -0.759594f), + Vector3DFloat(+0.399976f, +0.226329f, -0.888141f), + Vector3DFloat(-0.704797f, +0.579196f, -0.409625f), + Vector3DFloat(-0.007629f, +0.072037f, +0.997373f), + Vector3DFloat(-0.284284f, +0.861559f, +0.420592f), + Vector3DFloat(+0.775941f, +0.385137f, -0.499586f), + Vector3DFloat(-0.234994f, +0.400120f, +0.885823f), + Vector3DFloat(+0.575813f, +0.632406f, +0.518172f), + Vector3DFloat(+0.076477f, +0.592931f, -0.801613f), + Vector3DFloat(+0.603536f, -0.788719f, -0.116900f), + Vector3DFloat(-0.301173f, -0.779883f, -0.548705f), + Vector3DFloat(-0.315064f, -0.948217f, +0.040230f), + Vector3DFloat(+0.332902f, +0.851413f, -0.405304f), + Vector3DFloat(-0.403429f, +0.778318f, +0.481110f), + Vector3DFloat(-0.213870f, +0.976545f, +0.024873f), + Vector3DFloat(-0.753760f, -0.519440f, +0.402528f), + Vector3DFloat(-0.293424f, +0.935690f, -0.195925f), + Vector3DFloat(-0.370354f, +0.922391f, -0.109697f), + Vector3DFloat(+0.278418f, +0.666623f, +0.691445f), + Vector3DFloat(-0.284329f, +0.930765f, +0.229857f), + Vector3DFloat(+0.860824f, -0.367097f, -0.352452f), + Vector3DFloat(+0.541854f, -0.702580f, -0.461275f), + Vector3DFloat(+0.912176f, +0.185368f, -0.365478f), + Vector3DFloat(+0.168057f, +0.931969f, -0.321232f), + Vector3DFloat(-0.267320f, +0.845122f, +0.462934f), + Vector3DFloat(-0.201487f, +0.198600f, +0.959146f), + Vector3DFloat(-0.839945f, -0.276826f, -0.466754f), + Vector3DFloat(-0.740956f, -0.484640f, +0.464874f), + Vector3DFloat(-0.383491f, +0.705487f, -0.596006f), + Vector3DFloat(-0.954405f, -0.026765f, -0.297313f), + Vector3DFloat(+0.468574f, +0.859438f, +0.204460f), + Vector3DFloat(-0.940360f, +0.331786f, +0.075105f), + Vector3DFloat(-0.852277f, +0.454172f, -0.259522f), + Vector3DFloat(-0.759647f, +0.519837f, -0.390776f), + Vector3DFloat(+0.111525f, -0.475265f, -0.872746f), + Vector3DFloat(-0.452079f, -0.035104f, +0.891287f), + Vector3DFloat(+0.390392f, -0.669936f, -0.631490f), + Vector3DFloat(-0.292073f, +0.321693f, -0.900670f), + Vector3DFloat(+0.104005f, +0.994338f, +0.021788f), + Vector3DFloat(+0.960865f, +0.271665f, +0.054189f), + Vector3DFloat(-0.723235f, +0.690428f, +0.015487f), + Vector3DFloat(+0.179328f, -0.278614f, +0.943513f), + Vector3DFloat(+0.673808f, +0.589682f, +0.445263f), + Vector3DFloat(+0.731197f, +0.497511f, +0.466726f), + Vector3DFloat(+0.153734f, -0.134017f, +0.978982f), + Vector3DFloat(+0.456781f, -0.221267f, -0.861622f), + Vector3DFloat(+0.688864f, +0.648593f, +0.323719f), + Vector3DFloat(-0.036351f, +0.715024f, -0.698155f), + Vector3DFloat(+0.979208f, -0.118292f, +0.164797f), + Vector3DFloat(-0.543655f, -0.797469f, -0.261692f), + Vector3DFloat(+0.474224f, -0.342549f, -0.811031f), + Vector3DFloat(+0.455954f, +0.830262f, +0.320580f), + Vector3DFloat(+0.050584f, -0.993831f, -0.098696f), + Vector3DFloat(-0.061916f, +0.662832f, +0.746204f), + Vector3DFloat(+0.153491f, -0.981695f, +0.112766f), + Vector3DFloat(-0.303003f, +0.664435f, +0.683165f), + Vector3DFloat(+0.490302f, +0.248088f, -0.835497f), + Vector3DFloat(-0.909045f, +0.282351f, -0.306455f), + Vector3DFloat(+0.412988f, -0.552647f, +0.723894f), + Vector3DFloat(-0.254003f, -0.874419f, +0.413370f), + Vector3DFloat(-0.254922f, +0.922643f, -0.289387f), + Vector3DFloat(+0.788379f, -0.515671f, +0.335474f), + Vector3DFloat(+0.704882f, -0.446475f, -0.551182f), + Vector3DFloat(+0.446454f, +0.893141f, -0.054572f), + Vector3DFloat(-0.139484f, +0.078095f, -0.987140f), + Vector3DFloat(+0.196257f, -0.117325f, -0.973508f), + Vector3DFloat(-0.887951f, -0.452728f, +0.081119f), + Vector3DFloat(+0.482286f, +0.838290f, -0.254304f), + Vector3DFloat(-0.085400f, +0.836828f, +0.540764f), + Vector3DFloat(-0.033243f, -0.288034f, +0.957043f), + Vector3DFloat(+0.262770f, -0.771585f, +0.579318f), + Vector3DFloat(-0.911785f, -0.235533f, +0.336411f), + Vector3DFloat(+0.927275f, +0.367451f, -0.071696f), + Vector3DFloat(+0.771172f, -0.229858f, +0.593683f), + Vector3DFloat(-0.375316f, -0.068341f, -0.924374f), + Vector3DFloat(-0.735343f, +0.284450f, -0.615109f), + Vector3DFloat(-0.985363f, +0.154529f, +0.071973f), + Vector3DFloat(-0.544949f, +0.792232f, -0.274589f), + Vector3DFloat(-0.565066f, -0.783807f, -0.257579f), + Vector3DFloat(-0.188990f, +0.764476f, -0.616328f), + Vector3DFloat(+0.011964f, -0.681395f, +0.731818f), + Vector3DFloat(+0.647082f, +0.652894f, -0.393719f), + Vector3DFloat(-0.883463f, +0.088810f, -0.460006f), + Vector3DFloat(-0.443140f, -0.048579f, -0.895135f), + Vector3DFloat(+0.925708f, +0.333853f, -0.177785f), + Vector3DFloat(-0.057825f, -0.850139f, +0.523373f), + Vector3DFloat(+0.376782f, +0.740216f, +0.556881f), + Vector3DFloat(-0.711665f, -0.184658f, -0.677816f), + Vector3DFloat(+0.410214f, -0.115790f, -0.904609f), + Vector3DFloat(+0.382722f, +0.646393f, -0.660076f), + Vector3DFloat(-0.300767f, -0.354337f, +0.885429f), + Vector3DFloat(+0.568398f, +0.272778f, +0.776219f), + Vector3DFloat(-0.157935f, +0.980750f, +0.114830f), + Vector3DFloat(+0.359219f, +0.495150f, -0.791068f), + Vector3DFloat(-0.349238f, +0.056262f, -0.935344f), + Vector3DFloat(-0.633800f, +0.743629f, +0.212869f), + Vector3DFloat(+0.097107f, -0.993326f, -0.062246f), + Vector3DFloat(+0.372454f, -0.806078f, -0.459908f), + Vector3DFloat(-0.263428f, +0.934015f, +0.241290f), + Vector3DFloat(-0.943443f, +0.122444f, +0.308095f), + Vector3DFloat(+0.408781f, +0.502375f, -0.761917f), + Vector3DFloat(+0.697179f, -0.332546f, -0.635102f), + Vector3DFloat(-0.491802f, +0.870583f, -0.014715f), + Vector3DFloat(+0.737536f, -0.656902f, +0.156592f), + Vector3DFloat(+0.827336f, -0.246097f, +0.504928f), + Vector3DFloat(-0.446202f, +0.667651f, +0.595941f), + Vector3DFloat(-0.964936f, -0.243630f, +0.097691f), + Vector3DFloat(+0.897134f, -0.435766f, -0.072518f), + Vector3DFloat(-0.669699f, -0.151247f, -0.727068f), + Vector3DFloat(-0.016765f, -0.955618f, +0.294130f), + Vector3DFloat(-0.230630f, +0.832879f, -0.503112f), + Vector3DFloat(+0.899464f, +0.318825f, -0.298856f), + Vector3DFloat(+0.058885f, -0.789911f, +0.610388f), + Vector3DFloat(+0.659402f, +0.666930f, +0.346977f), + Vector3DFloat(+0.284813f, -0.414001f, -0.864572f), + Vector3DFloat(+0.484149f, -0.789140f, -0.377964f), + Vector3DFloat(+0.738956f, +0.298547f, -0.603998f), + Vector3DFloat(+0.136326f, +0.352541f, -0.925813f), + Vector3DFloat(+0.868090f, +0.478579f, +0.131841f), + Vector3DFloat(+0.446372f, -0.633533f, -0.631972f), + Vector3DFloat(-0.464744f, -0.873724f, +0.143596f), + Vector3DFloat(-0.157889f, +0.556623f, -0.815624f), + Vector3DFloat(-0.916952f, -0.270205f, +0.293579f), + Vector3DFloat(-0.968515f, +0.157169f, -0.193071f), + Vector3DFloat(-0.428526f, -0.889206f, +0.160242f), + Vector3DFloat(+0.396152f, +0.173085f, +0.901724f), + Vector3DFloat(+0.966792f, +0.160015f, -0.199271f), + Vector3DFloat(-0.912490f, -0.111826f, +0.393519f), + Vector3DFloat(+0.866392f, -0.192509f, -0.460765f), + Vector3DFloat(+0.480992f, +0.492893f, -0.725054f), + Vector3DFloat(-0.355535f, +0.884194f, +0.302977f), + Vector3DFloat(+0.980976f, -0.055915f, +0.185905f), + Vector3DFloat(-0.740688f, +0.154276f, -0.653896f), + Vector3DFloat(+0.193789f, -0.135151f, -0.971689f), + Vector3DFloat(-0.301940f, -0.417607f, -0.856993f), + Vector3DFloat(-0.519232f, +0.773966f, -0.362455f), + Vector3DFloat(+0.938672f, -0.020909f, -0.344177f), + Vector3DFloat(+0.637853f, -0.449939f, +0.625058f), + Vector3DFloat(+0.544105f, -0.664601f, -0.512109f), + Vector3DFloat(-0.170728f, -0.774921f, +0.608563f), + Vector3DFloat(+0.669668f, +0.441721f, -0.597016f), + Vector3DFloat(-0.311388f, -0.044999f, -0.949217f), + Vector3DFloat(+0.146744f, +0.375501f, +0.915131f), + Vector3DFloat(-0.703678f, -0.557559f, -0.440414f), + Vector3DFloat(-0.470187f, +0.695298f, +0.543585f), + Vector3DFloat(-0.254132f, -0.184139f, +0.949479f), + Vector3DFloat(-0.900622f, +0.005714f, +0.434565f), + Vector3DFloat(-0.014656f, +0.303063f, -0.952858f), + Vector3DFloat(-0.865696f, -0.264074f, +0.425247f), + Vector3DFloat(+0.481061f, +0.842497f, +0.242445f), + Vector3DFloat(-0.450784f, +0.137271f, +0.882015f), + Vector3DFloat(+0.091619f, +0.964503f, +0.247669f), + Vector3DFloat(-0.135659f, -0.122365f, +0.983170f), + Vector3DFloat(-0.322292f, +0.502269f, +0.802405f), + Vector3DFloat(+0.157842f, +0.435303f, +0.886339f), + Vector3DFloat(+0.158697f, -0.622087f, -0.766696f), + Vector3DFloat(+0.427134f, -0.647168f, -0.631451f), + Vector3DFloat(-0.101271f, +0.917326f, +0.385042f), + Vector3DFloat(-0.351641f, -0.653340f, -0.670445f), + Vector3DFloat(-0.903498f, -0.392917f, +0.171195f), + Vector3DFloat(+0.227012f, -0.849095f, -0.476974f), + Vector3DFloat(-0.094069f, -0.890637f, +0.444878f), + Vector3DFloat(+0.803352f, -0.594284f, -0.038110f), + Vector3DFloat(-0.094739f, -0.865030f, -0.492695f), + Vector3DFloat(+0.264702f, -0.854667f, +0.446629f), + Vector3DFloat(-0.897678f, +0.277821f, -0.342037f), + Vector3DFloat(-0.327036f, +0.939653f, +0.100497f), + Vector3DFloat(-0.826248f, -0.337885f, -0.450719f), + Vector3DFloat(+0.066622f, -0.956883f, +0.282730f), + Vector3DFloat(-0.746913f, -0.121996f, +0.653635f), + Vector3DFloat(-0.671734f, +0.736418f, +0.080385f), + Vector3DFloat(+0.693715f, +0.576755f, -0.431408f), + Vector3DFloat(-0.788320f, -0.082995f, -0.609642f), + Vector3DFloat(-0.456573f, +0.863290f, -0.215108f), + Vector3DFloat(-0.622201f, +0.453957f, +0.637800f), + Vector3DFloat(+0.723922f, +0.655748f, +0.214319f), + Vector3DFloat(+0.882913f, -0.420816f, -0.208276f), + Vector3DFloat(-0.926551f, +0.212056f, -0.310703f), + Vector3DFloat(+0.388695f, -0.691965f, +0.608358f), + Vector3DFloat(+0.728427f, +0.198534f, -0.655728f), + Vector3DFloat(+0.319262f, +0.105299f, +0.941798f), + Vector3DFloat(-0.333911f, +0.881805f, +0.333050f), + Vector3DFloat(+0.245338f, -0.611922f, -0.751904f), + Vector3DFloat(+0.220061f, -0.101481f, -0.970193f), + Vector3DFloat(+0.930032f, -0.311841f, +0.194412f), + Vector3DFloat(+0.048087f, -0.993913f, +0.099115f), + Vector3DFloat(-0.275537f, +0.705669f, +0.652772f), + Vector3DFloat(+0.383019f, -0.163631f, -0.909132f), + Vector3DFloat(-0.135900f, -0.988939f, +0.059414f), + Vector3DFloat(-0.662199f, +0.747009f, +0.058896f), + Vector3DFloat(-0.124689f, +0.015288f, +0.992078f), + Vector3DFloat(+0.489432f, -0.555663f, -0.672082f), + Vector3DFloat(-0.780927f, -0.255976f, +0.569763f), + Vector3DFloat(+0.694171f, +0.278571f, -0.663720f), + Vector3DFloat(-0.604581f, -0.463542f, -0.647774f), + Vector3DFloat(-0.676259f, -0.684602f, -0.272018f), + Vector3DFloat(+0.494855f, -0.701192f, -0.513272f), + Vector3DFloat(+0.565633f, +0.823079f, +0.050993f), + Vector3DFloat(+0.050237f, -0.998492f, +0.022122f), + Vector3DFloat(-0.386389f, -0.893963f, -0.227011f), + Vector3DFloat(+0.888703f, -0.437519f, -0.137056f), + Vector3DFloat(-0.914197f, +0.390980f, +0.106670f), + Vector3DFloat(+0.778906f, -0.627140f, -0.001437f), + Vector3DFloat(-0.603014f, +0.672265f, -0.429458f), + Vector3DFloat(+0.501042f, -0.665212f, +0.553579f), + Vector3DFloat(-0.995164f, +0.092308f, -0.033577f), + Vector3DFloat(-0.998104f, +0.018497f, +0.058712f), + Vector3DFloat(+0.929569f, +0.123842f, -0.347225f), + Vector3DFloat(+0.235077f, -0.609238f, +0.757343f), + Vector3DFloat(-0.452902f, -0.887545f, +0.084525f), + Vector3DFloat(-0.137550f, -0.488131f, -0.861863f), + Vector3DFloat(+0.660545f, -0.371465f, +0.652453f), + Vector3DFloat(+0.747313f, -0.657236f, +0.097799f), + Vector3DFloat(-0.543312f, -0.315699f, -0.777911f), + Vector3DFloat(+0.189959f, -0.346861f, +0.918478f), + Vector3DFloat(+0.323571f, +0.300781f, +0.897125f), + Vector3DFloat(-0.482606f, +0.875832f, -0.003165f), + Vector3DFloat(-0.936502f, +0.291824f, -0.194430f), + Vector3DFloat(-0.503609f, -0.390560f, +0.770610f), + Vector3DFloat(-0.540142f, +0.002774f, -0.841569f), + Vector3DFloat(-0.085055f, -0.996376f, -0.000148f), + Vector3DFloat(-0.615309f, +0.059981f, -0.786000f), + Vector3DFloat(+0.718191f, +0.505958f, -0.477711f), + Vector3DFloat(-0.167397f, +0.844465f, -0.508780f), + Vector3DFloat(+0.636446f, -0.344036f, -0.690345f), + Vector3DFloat(+0.663267f, +0.700418f, -0.263613f), + Vector3DFloat(+0.602334f, +0.435514f, +0.668970f), + Vector3DFloat(-0.275820f, -0.393792f, +0.876842f), + Vector3DFloat(+0.437736f, -0.747931f, +0.498986f), + Vector3DFloat(+0.882319f, +0.417138f, +0.217965f), + Vector3DFloat(-0.851108f, -0.482384f, -0.207174f), + Vector3DFloat(+0.320590f, +0.898664f, +0.299375f), + Vector3DFloat(-0.621201f, -0.614972f, +0.485714f), + Vector3DFloat(+0.911173f, +0.041873f, +0.409892f), + Vector3DFloat(+0.729444f, +0.142692f, -0.668992f), + Vector3DFloat(+0.666307f, -0.735324f, +0.123831f), + Vector3DFloat(+0.463591f, +0.847227f, -0.259402f), + Vector3DFloat(+0.894296f, +0.059634f, +0.443484f), + Vector3DFloat(-0.736335f, -0.674274f, +0.056256f), + Vector3DFloat(+0.469502f, -0.733536f, +0.491420f), + Vector3DFloat(-0.391723f, -0.837099f, +0.381861f), + Vector3DFloat(-0.437372f, -0.437618f, -0.785618f), + Vector3DFloat(-0.203384f, -0.343038f, -0.917039f), + Vector3DFloat(-0.945306f, +0.221497f, +0.239450f), + Vector3DFloat(+0.773091f, +0.496793f, +0.394369f), + Vector3DFloat(-0.710103f, +0.093103f, +0.697915f), + Vector3DFloat(-0.456786f, +0.151779f, +0.876533f), + Vector3DFloat(+0.373153f, +0.587166f, -0.718326f), + Vector3DFloat(-0.559785f, -0.793881f, +0.237473f), + Vector3DFloat(-0.884665f, +0.422952f, +0.196163f), + Vector3DFloat(-0.468879f, +0.300549f, -0.830556f), + Vector3DFloat(+0.958105f, +0.285330f, -0.024919f), + Vector3DFloat(+0.825326f, -0.423197f, -0.373819f), + Vector3DFloat(-0.034122f, +0.999414f, +0.002781f), + Vector3DFloat(-0.904795f, -0.041789f, -0.423792f), + Vector3DFloat(-0.799927f, +0.541477f, -0.258687f), + Vector3DFloat(+0.995132f, +0.000543f, -0.098546f), + Vector3DFloat(+0.843984f, -0.507103f, -0.174749f), + Vector3DFloat(-0.640934f, +0.618163f, +0.455058f), + Vector3DFloat(+0.543397f, +0.492878f, +0.679553f), + Vector3DFloat(+0.408980f, -0.467105f, +0.783932f), + Vector3DFloat(+0.219682f, +0.823953f, +0.522343f), + Vector3DFloat(+0.845523f, +0.410442f, -0.341509f), + Vector3DFloat(-0.997099f, +0.057254f, -0.050159f), + Vector3DFloat(+0.535588f, +0.112415f, +0.836964f), + Vector3DFloat(+0.139015f, +0.182777f, +0.973277f), + Vector3DFloat(+0.681261f, +0.731126f, -0.036585f), + Vector3DFloat(-0.161589f, +0.986188f, -0.036352f), + Vector3DFloat(-0.294098f, +0.640063f, +0.709806f), + Vector3DFloat(+0.213370f, -0.880985f, -0.422301f), + Vector3DFloat(-0.903331f, +0.383376f, +0.192395f), + Vector3DFloat(+0.020283f, +0.989297f, -0.144498f), + Vector3DFloat(+0.550858f, -0.603955f, +0.576016f), + Vector3DFloat(-0.297499f, -0.396883f, -0.868319f), + Vector3DFloat(-0.125581f, +0.971238f, +0.202303f), + Vector3DFloat(+0.994606f, -0.096856f, +0.037125f), + Vector3DFloat(+0.959844f, -0.254636f, -0.117729f), + Vector3DFloat(-0.332961f, +0.808031f, +0.486028f), + Vector3DFloat(+0.118411f, -0.818829f, +0.561692f), + Vector3DFloat(-0.329010f, +0.932571f, +0.148536f), + Vector3DFloat(+0.386616f, -0.386923f, -0.837149f), + Vector3DFloat(+0.501223f, -0.201907f, -0.841433f), + Vector3DFloat(+0.555119f, -0.793008f, -0.250959f), + Vector3DFloat(-0.512485f, +0.850268f, -0.120011f), + Vector3DFloat(+0.573352f, +0.737293f, +0.357306f), + Vector3DFloat(+0.315311f, -0.182192f, +0.931335f), + Vector3DFloat(+0.156167f, -0.963694f, -0.216579f), + Vector3DFloat(-0.285174f, -0.542273f, +0.790326f), + Vector3DFloat(-0.277593f, +0.668866f, +0.689609f), + Vector3DFloat(+0.319798f, -0.921924f, +0.218599f), + Vector3DFloat(-0.727455f, -0.686116f, -0.007338f), + Vector3DFloat(+0.219712f, -0.952663f, +0.210141f), + Vector3DFloat(+0.491792f, +0.552463f, -0.672997f), + Vector3DFloat(-0.526640f, +0.820445f, +0.222533f) + }; } #endif //__PolyVox_RandomUnitVectors_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h index a4d2d4bd..a18d5e1f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h @@ -30,7 +30,1033 @@ freely, subject to the following restrictions: namespace PolyVox { - extern POLYVOX_API const Vector3DFloat randomVectors[]; + const Vector3DFloat randomVectors[1024] = + { + Vector3DFloat(+0.348918f, -0.385662f, +0.650197f), + Vector3DFloat(-0.259255f, +0.791559f, +0.920957f), + Vector3DFloat(+0.940733f, -0.101535f, +0.250160f), + Vector3DFloat(-0.308939f, +0.367656f, +0.877987f), + Vector3DFloat(+0.112949f, -0.047090f, -0.730277f), + Vector3DFloat(-0.605579f, +0.039705f, +0.310160f), + Vector3DFloat(+0.086459f, +0.376446f, -0.496078f), + Vector3DFloat(+0.565661f, -0.261574f, -0.924986f), + Vector3DFloat(-0.285745f, -0.792047f, -0.582568f), + Vector3DFloat(+0.943175f, +0.226844f, +0.823481f), + Vector3DFloat(+0.599414f, +0.846797f, -0.438215f), + Vector3DFloat(-0.502731f, -0.907407f, +0.170751f), + Vector3DFloat(+0.136204f, -0.735527f, -0.066622f), + Vector3DFloat(-0.618763f, +0.825617f, -0.325053f), + Vector3DFloat(+0.942076f, +0.608325f, -0.532517f), + Vector3DFloat(-0.466414f, -0.248756f, -0.189856f), + Vector3DFloat(+0.618213f, +0.879513f, +0.120090f), + Vector3DFloat(-0.918393f, +0.876522f, +0.265114f), + Vector3DFloat(+0.345195f, +0.670705f, -0.914243f), + Vector3DFloat(-0.600757f, -0.417646f, -0.736747f), + Vector3DFloat(-0.271828f, +0.215674f, +0.890622f), + Vector3DFloat(+0.100986f, +0.821955f, +0.429975f), + Vector3DFloat(+0.811823f, -0.506943f, +0.635853f), + Vector3DFloat(+0.647084f, +0.297403f, -0.714774f), + Vector3DFloat(+0.531907f, -0.917417f, +0.795770f), + Vector3DFloat(-0.151585f, +0.250038f, +0.959105f), + Vector3DFloat(+0.311747f, -0.850948f, +0.946348f), + Vector3DFloat(+0.641407f, -0.747978f, +0.464583f), + Vector3DFloat(+0.297769f, -0.427839f, +0.867489f), + Vector3DFloat(+0.305032f, +0.985900f, +0.071261f), + Vector3DFloat(+0.105930f, -0.895016f, +0.871700f), + Vector3DFloat(+0.060335f, -0.312235f, +0.247475f), + Vector3DFloat(+0.174718f, +0.776055f, -0.783563f), + Vector3DFloat(-0.018342f, -0.031343f, +0.533982f), + Vector3DFloat(+0.136753f, -0.201575f, -0.694998f), + Vector3DFloat(+0.606006f, +0.353069f, -0.174841f), + Vector3DFloat(-0.720573f, +0.272805f, -0.679189f), + Vector3DFloat(+0.802484f, -0.649281f, -0.884274f), + Vector3DFloat(-0.577807f, -0.794610f, +0.227332f), + Vector3DFloat(-0.391644f, +0.440474f, -0.927854f), + Vector3DFloat(+0.631825f, +0.072115f, +0.943785f), + Vector3DFloat(-0.898312f, +0.257363f, -0.942930f), + Vector3DFloat(-0.608264f, +0.583667f, +0.228126f), + Vector3DFloat(-0.788202f, +0.777764f, +0.722953f), + Vector3DFloat(-0.624622f, -0.296976f, -0.382122f), + Vector3DFloat(+0.921323f, -0.356365f, -0.750542f), + Vector3DFloat(-0.899106f, +0.578234f, +0.937132f), + Vector3DFloat(+0.830744f, -0.789422f, -0.026154f), + Vector3DFloat(+0.720634f, +0.135166f, -0.366985f), + Vector3DFloat(+0.796930f, +0.687124f, +0.807855f), + Vector3DFloat(+0.262001f, -0.120945f, -0.196631f), + Vector3DFloat(+0.562426f, -0.886166f, +0.699149f), + Vector3DFloat(+0.047945f, -0.781793f, +0.465987f), + Vector3DFloat(+0.219275f, +0.152440f, +0.726127f), + Vector3DFloat(-0.970641f, -0.384136f, -0.340739f), + Vector3DFloat(+0.244606f, +0.969848f, +0.466903f), + Vector3DFloat(+0.608753f, +0.329936f, -0.411542f), + Vector3DFloat(+0.959593f, -0.833186f, -0.698721f), + Vector3DFloat(+0.475692f, -0.320658f, +0.507675f), + Vector3DFloat(-0.155431f, -0.050447f, -0.455855f), + Vector3DFloat(-0.738456f, +0.917173f, -0.407758f), + Vector3DFloat(-0.555284f, +0.842891f, -0.984619f), + Vector3DFloat(+0.696951f, +0.155553f, -0.031526f), + Vector3DFloat(-0.131565f, -0.563707f, +0.076815f), + Vector3DFloat(-0.319376f, +0.620106f, +0.567614f), + Vector3DFloat(-0.628163f, -0.813959f, -0.438581f), + Vector3DFloat(+0.484115f, +0.060640f, -0.176183f), + Vector3DFloat(-0.523240f, -0.572314f, +0.633778f), + Vector3DFloat(-0.524949f, -0.334574f, -0.326701f), + Vector3DFloat(+0.747673f, +0.725944f, +0.701651f), + Vector3DFloat(-0.500961f, +0.564867f, -0.902341f), + Vector3DFloat(+0.995422f, -0.245949f, +0.301065f), + Vector3DFloat(+0.655080f, -0.783380f, +0.835871f), + Vector3DFloat(+0.541795f, -0.693472f, -0.355083f), + Vector3DFloat(+0.891110f, +0.891171f, -0.891903f), + Vector3DFloat(+0.507675f, -0.949034f, -0.485214f), + Vector3DFloat(-0.116123f, +0.368999f, +0.514756f), + Vector3DFloat(-0.859432f, -0.525071f, +0.632008f), + Vector3DFloat(-0.707205f, +0.077914f, +0.930540f), + Vector3DFloat(-0.783380f, -0.577074f, -0.180212f), + Vector3DFloat(-0.047884f, -0.523789f, +0.471664f), + Vector3DFloat(-0.210791f, +0.904904f, -0.585864f), + Vector3DFloat(+0.132664f, +0.792230f, +0.707266f), + Vector3DFloat(-0.735710f, -0.263710f, -0.258827f), + Vector3DFloat(+0.912290f, +0.497421f, -0.518845f), + Vector3DFloat(-0.790521f, -0.707144f, +0.314982f), + Vector3DFloat(-0.799249f, +0.381207f, -0.756462f), + Vector3DFloat(+0.694998f, -0.521836f, +0.957213f), + Vector3DFloat(+0.310709f, +0.049837f, +0.920652f), + Vector3DFloat(+0.581530f, +0.164647f, +0.560900f), + Vector3DFloat(+0.406903f, -0.650563f, -0.674551f), + Vector3DFloat(-0.749016f, +0.119663f, -0.040193f), + Vector3DFloat(+0.955260f, -0.142552f, +0.175756f), + Vector3DFloat(-0.925108f, -0.970824f, -0.430952f), + Vector3DFloat(+0.666372f, +0.449507f, -0.801813f), + Vector3DFloat(-0.311991f, -0.079928f, -0.608142f), + Vector3DFloat(-0.344829f, +0.280862f, +0.800775f), + Vector3DFloat(-0.880123f, +0.318217f, -0.120212f), + Vector3DFloat(-0.146519f, +0.573412f, -0.358013f), + Vector3DFloat(+0.297220f, -0.889523f, +0.246620f), + Vector3DFloat(-0.628834f, -0.383404f, -0.630360f), + Vector3DFloat(-0.397382f, +0.547533f, -0.579150f), + Vector3DFloat(+0.758049f, +0.631947f, -0.916807f), + Vector3DFloat(-0.678030f, -0.606433f, -0.881527f), + Vector3DFloat(+0.213233f, +0.854060f, -0.043428f), + Vector3DFloat(+0.175085f, +0.139500f, -0.208472f), + Vector3DFloat(+0.983520f, -0.389386f, +0.178076f), + Vector3DFloat(+0.956603f, +0.696951f, -0.307657f), + Vector3DFloat(-0.276345f, +0.576220f, +0.182104f), + Vector3DFloat(+0.864742f, -0.657582f, +0.253639f), + Vector3DFloat(-0.275735f, -0.012177f, +0.306619f), + Vector3DFloat(-0.385235f, -0.881649f, +0.658071f), + Vector3DFloat(-0.117466f, -0.306681f, -0.235755f), + Vector3DFloat(+0.173254f, +0.685720f, +0.116733f), + Vector3DFloat(-0.641041f, +0.704642f, -0.585864f), + Vector3DFloat(+0.154820f, +0.999939f, -0.761345f), + Vector3DFloat(-0.726310f, +0.695181f, -0.490036f), + Vector3DFloat(-0.149510f, -0.593188f, -0.794122f), + Vector3DFloat(+0.798212f, +0.872555f, -0.361980f), + Vector3DFloat(+0.749687f, -0.931944f, +0.519211f), + Vector3DFloat(-0.151952f, -0.889096f, -0.313822f), + Vector3DFloat(-0.467879f, +0.289651f, -0.901242f), + Vector3DFloat(+0.522752f, +0.406781f, +0.157079f), + Vector3DFloat(+0.088534f, -0.421735f, -0.236122f), + Vector3DFloat(+0.722221f, -0.136692f, -0.292825f), + Vector3DFloat(-0.572436f, +0.349162f, +0.819697f), + Vector3DFloat(+0.252113f, +0.773614f, -0.299051f), + Vector3DFloat(-0.401410f, +0.400250f, -0.091037f), + Vector3DFloat(+0.449507f, +0.205115f, +0.075533f), + Vector3DFloat(+0.246803f, -0.197851f, -0.322123f), + Vector3DFloat(-0.822077f, +0.037263f, +0.157445f), + Vector3DFloat(+0.373455f, +0.983154f, -0.580920f), + Vector3DFloat(+0.201758f, -0.075289f, +0.514878f), + Vector3DFloat(+0.552477f, +0.760430f, +0.938963f), + Vector3DFloat(-0.297525f, -0.603504f, -0.285318f), + Vector3DFloat(-0.504257f, +0.135899f, +0.694021f), + Vector3DFloat(-0.701895f, +0.509140f, -0.768914f), + Vector3DFloat(+0.725639f, +0.083834f, -0.985961f), + Vector3DFloat(+0.617847f, -0.604114f, +0.976440f), + Vector3DFloat(-0.557115f, +0.562853f, +0.214087f), + Vector3DFloat(-0.480819f, -0.048738f, -0.759392f), + Vector3DFloat(-0.268105f, -0.168493f, -0.141881f), + Vector3DFloat(+0.664357f, -0.999207f, +0.486740f), + Vector3DFloat(-0.739128f, +0.089328f, +0.611194f), + Vector3DFloat(-0.355876f, +0.889523f, +0.701895f), + Vector3DFloat(-0.123692f, -0.252358f, -0.739250f), + Vector3DFloat(+0.405438f, -0.276772f, -0.896786f), + Vector3DFloat(-0.803644f, +0.517563f, -0.146886f), + Vector3DFloat(+0.647511f, +0.766289f, -0.811518f), + Vector3DFloat(-0.266457f, -0.779534f, +0.720634f), + Vector3DFloat(-0.643849f, -0.014130f, -0.345134f), + Vector3DFloat(-0.527390f, +0.047700f, -0.271340f), + Vector3DFloat(+0.993957f, -0.305643f, +0.841731f), + Vector3DFloat(+0.441816f, -0.849117f, -0.411664f), + Vector3DFloat(+0.303323f, -0.088473f, -0.677602f), + Vector3DFloat(+0.897824f, +0.203833f, +0.821039f), + Vector3DFloat(+0.468123f, +0.717338f, +0.338542f), + Vector3DFloat(-0.452986f, -0.830622f, -0.832942f), + Vector3DFloat(-0.245582f, -0.273171f, -0.820612f), + Vector3DFloat(-0.007660f, -0.799371f, +0.156896f), + Vector3DFloat(-0.022919f, +0.152013f, +0.614246f), + Vector3DFloat(-0.414045f, +0.637440f, -0.542711f), + Vector3DFloat(+0.453108f, -0.034516f, +0.330607f), + Vector3DFloat(+0.324015f, +0.689505f, +0.719108f), + Vector3DFloat(-0.236854f, +0.700491f, +0.276406f), + Vector3DFloat(-0.405316f, +0.871944f, +0.233863f), + Vector3DFloat(+0.898373f, +0.660756f, -0.914609f), + Vector3DFloat(+0.737114f, -0.179601f, -0.990539f), + Vector3DFloat(-0.536241f, -0.980712f, -0.352702f), + Vector3DFloat(+0.730094f, -0.970214f, -0.857967f), + Vector3DFloat(-0.194800f, -0.286782f, +0.604236f), + Vector3DFloat(+0.163366f, -0.441755f, -0.149022f), + Vector3DFloat(+0.457564f, +0.433149f, -0.626698f), + Vector3DFloat(+0.192846f, -0.909848f, +0.501572f), + Vector3DFloat(+0.444563f, -0.377789f, -0.545213f), + Vector3DFloat(-0.296670f, -0.809259f, +0.614246f), + Vector3DFloat(-0.068209f, +0.480148f, +0.537828f), + Vector3DFloat(+0.638173f, +0.371685f, -0.495956f), + Vector3DFloat(+0.798822f, +0.767510f, +0.516282f), + Vector3DFloat(-0.336161f, -0.035615f, +0.058687f), + Vector3DFloat(-0.888852f, -0.022370f, +0.215552f), + Vector3DFloat(-0.737541f, -0.977783f, -0.506638f), + Vector3DFloat(+0.471969f, +0.429670f, +0.668508f), + Vector3DFloat(+0.240394f, -0.212500f, -0.026215f), + Vector3DFloat(-0.916379f, -0.706229f, -0.593799f), + Vector3DFloat(-0.246681f, +0.919736f, -0.984741f), + Vector3DFloat(+0.291055f, -0.263771f, +0.703726f), + Vector3DFloat(-0.468245f, -0.062777f, +0.808527f), + Vector3DFloat(+0.661245f, +0.514817f, -0.715995f), + Vector3DFloat(-0.709830f, -0.580920f, +0.323710f), + Vector3DFloat(-0.463912f, -0.279092f, -0.101291f), + Vector3DFloat(-0.426252f, -0.292520f, -0.523057f), + Vector3DFloat(-0.285928f, -0.806574f, +0.701468f), + Vector3DFloat(-0.216468f, +0.385968f, +0.031953f), + Vector3DFloat(+0.737053f, +0.683767f, +0.684561f), + Vector3DFloat(+0.080172f, -0.063753f, +0.526902f), + Vector3DFloat(+0.414228f, +0.367351f, +0.884335f), + Vector3DFloat(-0.460677f, -0.048189f, -0.403851f), + Vector3DFloat(+0.973998f, +0.039399f, -0.148839f), + Vector3DFloat(+0.578539f, -0.651173f, +0.859432f), + Vector3DFloat(-0.172948f, +0.534593f, +0.255531f), + Vector3DFloat(+0.537584f, -0.570116f, +0.317606f), + Vector3DFloat(-0.380535f, +0.841548f, -0.274880f), + Vector3DFloat(+0.627247f, +0.655507f, -0.813532f), + Vector3DFloat(+0.288186f, +0.273171f, -0.674123f), + Vector3DFloat(-0.489303f, +0.828913f, +0.552599f), + Vector3DFloat(-0.541002f, +0.170019f, -0.242836f), + Vector3DFloat(+0.802972f, +0.340190f, +0.414716f), + Vector3DFloat(-0.997253f, -0.806635f, +0.588122f), + Vector3DFloat(+0.011017f, -0.599109f, -0.183325f), + Vector3DFloat(-0.871578f, -0.430708f, -0.042634f), + Vector3DFloat(+0.144627f, -0.921751f, +0.142003f), + Vector3DFloat(-0.695059f, -0.091037f, -0.647694f), + Vector3DFloat(-0.346477f, +0.663381f, -0.528977f), + Vector3DFloat(-0.194739f, +0.724967f, +0.615894f), + Vector3DFloat(+0.741874f, +0.720695f, -0.544847f), + Vector3DFloat(-0.984863f, +0.715445f, +0.461287f), + Vector3DFloat(-0.277871f, +0.329936f, +0.678091f), + Vector3DFloat(+0.090854f, +0.565905f, -0.254250f), + Vector3DFloat(-0.844050f, +0.781915f, -0.783929f), + Vector3DFloat(+0.332377f, -0.336528f, +0.820673f), + Vector3DFloat(-0.673391f, +0.589953f, -0.685598f), + Vector3DFloat(+0.022370f, +0.979980f, +0.686453f), + Vector3DFloat(-0.640065f, +0.369488f, +0.022919f), + Vector3DFloat(+0.699088f, -0.286355f, +0.684378f), + Vector3DFloat(-0.702139f, -0.827754f, +0.528367f), + Vector3DFloat(+0.150365f, -0.669851f, -0.695486f), + Vector3DFloat(+0.885617f, +0.492416f, -0.964599f), + Vector3DFloat(-0.923643f, -0.338847f, -0.369060f), + Vector3DFloat(+0.009064f, +0.632435f, +0.628956f), + Vector3DFloat(+0.620411f, +0.959777f, -0.769890f), + Vector3DFloat(+0.865413f, +0.685659f, -0.149327f), + Vector3DFloat(-0.933042f, +0.517258f, +0.168493f), + Vector3DFloat(+0.309732f, +0.299417f, +0.995361f), + Vector3DFloat(+0.196814f, -0.128025f, +0.565233f), + Vector3DFloat(-0.343669f, +0.889157f, +0.616688f), + Vector3DFloat(-0.676870f, +0.035432f, +0.906430f), + Vector3DFloat(-0.238868f, +0.320475f, -0.307596f), + Vector3DFloat(+0.164159f, +0.774468f, +0.502792f), + Vector3DFloat(+0.733146f, +0.517563f, +0.572741f), + Vector3DFloat(+0.676931f, -0.930235f, +0.231056f), + Vector3DFloat(-0.640370f, +0.241127f, -0.518479f), + Vector3DFloat(-0.953795f, +0.673086f, -0.706656f), + Vector3DFloat(+0.538621f, -0.340495f, +0.202124f), + Vector3DFloat(+0.431501f, +0.452315f, +0.422651f), + Vector3DFloat(+0.935606f, -0.442793f, -0.087191f), + Vector3DFloat(-0.921873f, -0.794733f, -0.003388f), + Vector3DFloat(+0.978576f, +0.342814f, -0.813898f), + Vector3DFloat(-0.750969f, +0.077853f, -0.849117f), + Vector3DFloat(+0.416120f, +0.678030f, +0.187475f), + Vector3DFloat(+0.370342f, -0.101901f, -0.544053f), + Vector3DFloat(+0.248512f, +0.803766f, -0.654042f), + Vector3DFloat(-0.925230f, +0.883480f, +0.287698f), + Vector3DFloat(-0.861873f, -0.263771f, +0.476730f), + Vector3DFloat(-0.298868f, -0.459517f, +0.932798f), + Vector3DFloat(+0.680532f, +0.697928f, +0.761162f), + Vector3DFloat(-0.466964f, -0.590625f, +0.972716f), + Vector3DFloat(+0.400067f, -0.316507f, +0.385418f), + Vector3DFloat(-0.123814f, -0.144444f, -0.161290f), + Vector3DFloat(-0.703726f, +0.189489f, +0.250099f), + Vector3DFloat(-0.766533f, -0.369854f, +0.871395f), + Vector3DFloat(-0.561205f, -0.891415f, +0.247658f), + Vector3DFloat(+0.590991f, +0.661489f, -0.996887f), + Vector3DFloat(-0.244667f, +0.857723f, +0.402692f), + Vector3DFloat(-0.574572f, -0.257790f, +0.561449f), + Vector3DFloat(+0.020600f, -0.784173f, -0.057711f), + Vector3DFloat(+0.735954f, +0.708487f, +0.913022f), + Vector3DFloat(-0.615101f, -0.643666f, +0.350017f), + Vector3DFloat(+0.436933f, +0.596423f, +0.985412f), + Vector3DFloat(-0.167577f, +0.400555f, +0.914670f), + Vector3DFloat(-0.920896f, -0.621570f, -0.637074f), + Vector3DFloat(-0.020356f, -0.234657f, +0.460860f), + Vector3DFloat(+0.336650f, -0.537767f, +0.907712f), + Vector3DFloat(-0.138768f, +0.860653f, +0.093661f), + Vector3DFloat(-0.733512f, -0.564196f, -0.046724f), + Vector3DFloat(+0.058260f, -0.429060f, +0.150792f), + Vector3DFloat(+0.255837f, -0.187780f, +0.312601f), + Vector3DFloat(-0.050081f, +0.680105f, -0.609485f), + Vector3DFloat(+0.075411f, +0.016511f, -0.127293f), + Vector3DFloat(-0.735710f, -0.787957f, +0.992248f), + Vector3DFloat(-0.191931f, +0.812311f, +0.681692f), + Vector3DFloat(-0.284402f, -0.177160f, -0.533128f), + Vector3DFloat(+0.859432f, +0.042940f, +0.404096f), + Vector3DFloat(+0.599841f, +0.131260f, +0.313028f), + Vector3DFloat(-0.955809f, -0.792474f, +0.086947f), + Vector3DFloat(-0.980712f, -0.525498f, -0.539598f), + Vector3DFloat(-0.877377f, -0.748222f, +0.590320f), + Vector3DFloat(-0.822443f, -0.733634f, -0.529588f), + Vector3DFloat(+0.379620f, -0.710013f, +0.038484f), + Vector3DFloat(-0.826472f, -0.831050f, -0.645436f), + Vector3DFloat(+0.160131f, -0.977050f, -0.502609f), + Vector3DFloat(-0.818964f, +0.921567f, -0.011261f), + Vector3DFloat(+0.932005f, -0.364727f, +0.023103f), + Vector3DFloat(-0.923826f, -0.862300f, +0.680410f), + Vector3DFloat(-0.298379f, +0.196936f, -0.486618f), + Vector3DFloat(-0.281411f, -0.045747f, -0.252602f), + Vector3DFloat(+0.706534f, +0.296976f, +0.672292f), + Vector3DFloat(-0.543077f, +0.319376f, +0.238075f), + Vector3DFloat(-0.501938f, +0.067293f, +0.119602f), + Vector3DFloat(-0.740287f, -0.783197f, +0.407514f), + Vector3DFloat(-0.933470f, -0.855098f, -0.503952f), + Vector3DFloat(-0.574877f, -0.533067f, +0.525437f), + Vector3DFloat(+0.785394f, -0.262612f, +0.571642f), + Vector3DFloat(-0.659108f, -0.811396f, +0.264138f), + Vector3DFloat(+0.926695f, -0.963622f, +0.121372f), + Vector3DFloat(+0.505661f, -0.209815f, -0.439131f), + Vector3DFloat(-0.433882f, +0.026887f, +0.928953f), + Vector3DFloat(-0.771599f, +0.737785f, -0.288003f), + Vector3DFloat(-0.894406f, +0.505905f, +0.971068f), + Vector3DFloat(+0.350383f, +0.570421f, -0.211646f), + Vector3DFloat(+0.644093f, -0.882748f, -0.131382f), + Vector3DFloat(+0.225745f, +0.948973f, -0.488327f), + Vector3DFloat(+0.277810f, -0.337748f, +0.322672f), + Vector3DFloat(-0.686514f, +0.185766f, +0.752129f), + Vector3DFloat(+0.350566f, +0.122959f, +0.722526f), + Vector3DFloat(-0.687002f, +0.955260f, -0.955687f), + Vector3DFloat(+0.958983f, -0.019074f, -0.317118f), + Vector3DFloat(+0.076937f, -0.015839f, -0.772027f), + Vector3DFloat(+0.899777f, -0.224647f, +0.174230f), + Vector3DFloat(+0.805719f, -0.288797f, +0.742119f), + Vector3DFloat(+0.964904f, -0.322794f, +0.416486f), + Vector3DFloat(-0.485641f, -0.559130f, -0.500168f), + Vector3DFloat(+0.310282f, +0.408185f, -0.946471f), + Vector3DFloat(-0.279031f, +0.645131f, -0.118259f), + Vector3DFloat(+0.780694f, -0.650136f, -0.433943f), + Vector3DFloat(+0.981262f, +0.039521f, -0.532395f), + Vector3DFloat(+0.830866f, +0.430769f, -0.333293f), + Vector3DFloat(-0.462081f, -0.872799f, -0.070711f), + Vector3DFloat(+0.276894f, -0.418683f, -0.198767f), + Vector3DFloat(+0.217750f, +0.312662f, -0.725211f), + Vector3DFloat(-0.193091f, -0.522752f, -0.901486f), + Vector3DFloat(+0.040071f, -0.307291f, +0.622669f), + Vector3DFloat(-0.788446f, -0.817438f, -0.566027f), + Vector3DFloat(-0.947508f, -0.519822f, +0.143468f), + Vector3DFloat(-0.072970f, -0.580920f, +0.925230f), + Vector3DFloat(-0.072359f, +0.954772f, +0.980163f), + Vector3DFloat(+0.954344f, -0.229774f, -0.562059f), + Vector3DFloat(+0.095004f, +0.123020f, +0.103366f), + Vector3DFloat(+0.784478f, -0.571764f, +0.774529f), + Vector3DFloat(-0.113498f, -0.852229f, +0.422468f), + Vector3DFloat(-0.128941f, -0.637196f, -0.590869f), + Vector3DFloat(+0.603259f, -0.670766f, +0.303201f), + Vector3DFloat(+0.693960f, +0.278542f, +0.171422f), + Vector3DFloat(+0.801813f, +0.236671f, +0.195227f), + Vector3DFloat(-0.193823f, +0.684072f, -0.594714f), + Vector3DFloat(+0.715201f, +0.750725f, +0.591479f), + Vector3DFloat(+0.698782f, +0.073214f, +0.106052f), + Vector3DFloat(+0.803522f, -0.470809f, +0.279763f), + Vector3DFloat(+0.099704f, +0.861385f, -0.397687f), + Vector3DFloat(+0.230506f, -0.993286f, +0.054292f), + Vector3DFloat(-0.292398f, +0.585376f, +0.762139f), + Vector3DFloat(-0.168004f, +0.731132f, -0.020051f), + Vector3DFloat(+0.577441f, +0.205359f, +0.703848f), + Vector3DFloat(-0.869076f, +0.873653f, -0.802301f), + Vector3DFloat(+0.697256f, +0.399335f, +0.842708f), + Vector3DFloat(-0.590258f, -0.620777f, -0.628040f), + Vector3DFloat(-0.048982f, +0.759697f, -0.957335f), + Vector3DFloat(+0.026582f, +0.696402f, -0.537645f), + Vector3DFloat(+0.919431f, +0.040254f, +0.931394f), + Vector3DFloat(+0.308512f, +0.591052f, -0.194739f), + Vector3DFloat(-0.934202f, +0.307718f, -0.688894f), + Vector3DFloat(-0.285318f, +0.460860f, +0.757012f), + Vector3DFloat(+0.048799f, -0.720389f, +0.325968f), + Vector3DFloat(-0.202246f, +0.068697f, +0.641407f), + Vector3DFloat(-0.566088f, +0.523301f, +0.857295f), + Vector3DFloat(+0.040193f, -0.036836f, +0.699881f), + Vector3DFloat(-0.789422f, -0.195959f, -0.217505f), + Vector3DFloat(-0.836665f, +0.293741f, +0.418867f), + Vector3DFloat(+0.489486f, +0.954344f, +0.486007f), + Vector3DFloat(-0.755913f, -0.485153f, +0.253822f), + Vector3DFloat(+0.823420f, -0.565722f, -0.393353f), + Vector3DFloat(-0.817560f, +0.851436f, -0.368755f), + Vector3DFloat(+0.004791f, -0.474899f, -0.299417f), + Vector3DFloat(-0.012726f, +0.620289f, -0.555773f), + Vector3DFloat(+0.197058f, -0.916318f, -0.469466f), + Vector3DFloat(+0.243812f, +0.820734f, -0.694021f), + Vector3DFloat(-0.896359f, -0.753716f, -0.676321f), + Vector3DFloat(-0.761589f, -0.936033f, -0.154149f), + Vector3DFloat(+0.821528f, +0.641224f, -0.188025f), + Vector3DFloat(+0.799432f, +0.168981f, +0.571520f), + Vector3DFloat(+0.309793f, -0.181005f, -0.565416f), + Vector3DFloat(+0.211890f, -0.153539f, -0.473312f), + Vector3DFloat(+0.284097f, +0.968444f, -0.005829f), + Vector3DFloat(+0.835994f, +0.087374f, -0.599780f), + Vector3DFloat(+0.068270f, -0.178930f, -0.439741f), + Vector3DFloat(-0.455611f, +0.404218f, -0.862911f), + Vector3DFloat(+0.754143f, +0.197058f, +0.762749f), + Vector3DFloat(+0.053499f, -0.794549f, -0.285257f), + Vector3DFloat(+0.176916f, +0.163121f, -0.941954f), + Vector3DFloat(-0.102817f, -0.446944f, +0.830195f), + Vector3DFloat(+0.970824f, -0.484848f, -0.661977f), + Vector3DFloat(-0.561998f, -0.377544f, -0.955321f), + Vector3DFloat(-0.434980f, +0.501022f, +0.627186f), + Vector3DFloat(-0.828120f, +0.591540f, +0.701895f), + Vector3DFloat(-0.327555f, +0.628346f, -0.159581f), + Vector3DFloat(-0.082980f, -0.308084f, -0.077731f), + Vector3DFloat(+0.858150f, -0.706473f, +0.886532f), + Vector3DFloat(+0.526475f, +0.001373f, +0.438276f), + Vector3DFloat(-0.594958f, +0.084994f, -0.935057f), + Vector3DFloat(+0.783746f, -0.501877f, -0.797052f), + Vector3DFloat(-0.835566f, -0.808405f, +0.956359f), + Vector3DFloat(+0.380169f, +0.184118f, +0.857540f), + Vector3DFloat(+0.647206f, +0.652089f, -0.895383f), + Vector3DFloat(-0.421369f, -0.038667f, +0.500046f), + Vector3DFloat(-0.478133f, +0.447432f, +0.981750f), + Vector3DFloat(+0.593921f, -0.330485f, -0.966674f), + Vector3DFloat(-0.811823f, +0.928892f, -0.741935f), + Vector3DFloat(+0.115879f, -0.490707f, -0.080355f), + Vector3DFloat(+0.443159f, +0.030061f, -0.465560f), + Vector3DFloat(+0.013703f, -0.765435f, -0.311502f), + Vector3DFloat(+0.698782f, -0.612903f, +0.660207f), + Vector3DFloat(+0.341227f, -0.746940f, +0.284341f), + Vector3DFloat(-0.005036f, -0.863460f, -0.168432f), + Vector3DFloat(-0.434370f, -0.629933f, +0.545152f), + Vector3DFloat(-0.570544f, +0.023591f, +0.072970f), + Vector3DFloat(+0.709830f, +0.603626f, +0.031831f), + Vector3DFloat(-0.148961f, +0.783807f, -0.292154f), + Vector3DFloat(+0.088107f, -0.467818f, +0.319498f), + Vector3DFloat(+0.976623f, -0.185339f, +0.274087f), + Vector3DFloat(+0.770867f, +0.267861f, -0.022004f), + Vector3DFloat(-0.245338f, +0.171056f, -0.720389f), + Vector3DFloat(-0.909299f, +0.616993f, -0.950926f), + Vector3DFloat(+0.050935f, -0.842341f, -0.519944f), + Vector3DFloat(+0.646779f, +0.560839f, +0.129673f), + Vector3DFloat(-0.171361f, -0.501328f, -0.762749f), + Vector3DFloat(-0.374065f, -0.905209f, -0.561144f), + Vector3DFloat(-0.811029f, -0.510483f, -0.757073f), + Vector3DFloat(-0.905332f, -0.027924f, -0.263649f), + Vector3DFloat(-0.828730f, -0.067721f, -0.295206f), + Vector3DFloat(-0.538133f, +0.242714f, +0.914914f), + Vector3DFloat(-0.657949f, -0.732658f, -0.743584f), + Vector3DFloat(+0.837214f, -0.077181f, +0.767449f), + Vector3DFloat(+0.174047f, +0.397687f, +0.602405f), + Vector3DFloat(-0.256996f, +0.911435f, -0.927915f), + Vector3DFloat(+0.282754f, +0.500900f, +0.510178f), + Vector3DFloat(+0.849971f, +0.652821f, +0.002838f), + Vector3DFloat(-1.000000f, -0.103305f, -0.548814f), + Vector3DFloat(-0.673208f, -0.734489f, +0.204749f), + Vector3DFloat(-0.235511f, -0.977477f, -0.771538f), + Vector3DFloat(+0.294412f, +0.173009f, -0.075533f), + Vector3DFloat(-0.339946f, -0.970946f, -0.443525f), + Vector3DFloat(-0.016144f, -0.066134f, -0.394635f), + Vector3DFloat(-0.627003f, +0.683401f, -0.967101f), + Vector3DFloat(-0.217994f, -0.777642f, -0.404584f), + Vector3DFloat(+0.123447f, -0.590747f, +0.507614f), + Vector3DFloat(+0.648610f, +0.006806f, -0.677969f), + Vector3DFloat(+0.006561f, +0.662648f, -0.236305f), + Vector3DFloat(+0.658132f, +0.166173f, -0.283975f), + Vector3DFloat(-0.098178f, +0.665273f, -0.068636f), + Vector3DFloat(-0.091891f, +0.319620f, +0.058870f), + Vector3DFloat(+0.922666f, +0.077731f, +0.399701f), + Vector3DFloat(-0.007050f, +0.772942f, -0.957945f), + Vector3DFloat(-0.456832f, -0.293313f, +0.437300f), + Vector3DFloat(+0.917173f, -0.542100f, +0.909665f), + Vector3DFloat(-0.711722f, -0.917356f, +0.513169f), + Vector3DFloat(-0.032624f, +0.808100f, +0.354472f), + Vector3DFloat(-0.526597f, -0.049409f, +0.691702f), + Vector3DFloat(-0.073946f, +0.923521f, -0.389813f), + Vector3DFloat(+0.172216f, +0.642140f, -0.302896f), + Vector3DFloat(-0.660024f, +0.381329f, -0.833064f), + Vector3DFloat(+0.622791f, -0.809076f, +0.557787f), + Vector3DFloat(+0.609790f, +0.897702f, +0.998352f), + Vector3DFloat(-0.084384f, +0.169042f, -0.596667f), + Vector3DFloat(-0.315470f, -0.014618f, -0.640187f), + Vector3DFloat(+0.275552f, -0.199438f, -0.759941f), + Vector3DFloat(-0.615223f, -0.960021f, +0.367901f), + Vector3DFloat(+0.819514f, -0.787225f, +0.627308f), + Vector3DFloat(+0.083834f, -0.836299f, +0.926450f), + Vector3DFloat(-0.420637f, -0.047273f, +0.370281f), + Vector3DFloat(-0.097629f, -0.240577f, -0.594836f), + Vector3DFloat(+0.085604f, +0.385601f, -0.121189f), + Vector3DFloat(+0.968444f, -0.255104f, +0.021027f), + Vector3DFloat(+0.152440f, -0.450484f, +0.971496f), + Vector3DFloat(-0.095737f, +0.395672f, -0.605213f), + Vector3DFloat(+0.949278f, -0.284951f, +0.875118f), + Vector3DFloat(+0.787286f, +0.580248f, +0.494613f), + Vector3DFloat(+0.225990f, -0.455123f, +0.239540f), + Vector3DFloat(+0.630238f, -0.251747f, -0.617725f), + Vector3DFloat(+0.940733f, -0.390484f, +0.394024f), + Vector3DFloat(+0.197851f, -0.276345f, -0.893368f), + Vector3DFloat(-0.240883f, +0.349651f, -0.922178f), + Vector3DFloat(-0.037080f, -0.609119f, -0.018342f), + Vector3DFloat(-0.787042f, +0.624500f, -0.274880f), + Vector3DFloat(-0.536485f, +0.989746f, -0.400128f), + Vector3DFloat(+0.963988f, +0.006012f, +0.323649f), + Vector3DFloat(-0.501022f, -0.791864f, +0.514817f), + Vector3DFloat(-0.126316f, -0.782769f, +0.155553f), + Vector3DFloat(-0.254921f, +0.828547f, -0.173925f), + Vector3DFloat(-0.321512f, -0.180822f, +0.603198f), + Vector3DFloat(+0.733757f, -0.407514f, +0.170385f), + Vector3DFloat(-0.741691f, -0.322611f, -0.070956f), + Vector3DFloat(-0.025300f, +0.454329f, -0.889767f), + Vector3DFloat(+0.024751f, +0.133518f, -0.246498f), + Vector3DFloat(+0.545701f, -0.260842f, +0.869747f), + Vector3DFloat(+0.082247f, -0.579638f, -0.885495f), + Vector3DFloat(-0.000885f, -0.834346f, +0.040254f), + Vector3DFloat(-0.211097f, -0.059297f, +0.747856f), + Vector3DFloat(-0.829646f, +0.475753f, +0.527451f), + Vector3DFloat(+0.409162f, -0.167882f, -0.177099f), + Vector3DFloat(-0.319865f, -0.205664f, -0.130222f), + Vector3DFloat(+0.962523f, -0.992615f, +0.062655f), + Vector3DFloat(+0.849361f, -0.935301f, +0.394024f), + Vector3DFloat(+0.373699f, -0.148350f, +0.208594f), + Vector3DFloat(+0.639332f, +0.220557f, -0.277444f), + Vector3DFloat(+0.880734f, +0.209937f, -0.576708f), + Vector3DFloat(+0.342814f, +0.416364f, -0.832453f), + Vector3DFloat(+0.594958f, +0.479843f, -0.306070f), + Vector3DFloat(+0.335002f, -0.107334f, +0.784173f), + Vector3DFloat(+0.395917f, +0.763604f, +0.866756f), + Vector3DFloat(-0.507553f, +0.148717f, -0.436750f), + Vector3DFloat(-0.780450f, -0.599048f, -0.146031f), + Vector3DFloat(-0.841304f, -0.712577f, -0.329997f), + Vector3DFloat(+0.524033f, +0.033845f, +0.057100f), + Vector3DFloat(-0.976562f, -0.066866f, +0.026887f), + Vector3DFloat(-0.469405f, -0.094394f, +0.398175f), + Vector3DFloat(+0.238685f, -0.750237f, +0.156713f), + Vector3DFloat(+0.000702f, +0.617298f, -0.206397f), + Vector3DFloat(-0.228553f, +0.562548f, -0.719840f), + Vector3DFloat(-0.939451f, -0.698782f, +0.688162f), + Vector3DFloat(+0.637623f, +0.149022f, -0.536058f), + Vector3DFloat(-0.814386f, +0.379315f, +0.647145f), + Vector3DFloat(+0.523179f, -0.820368f, +0.386517f), + Vector3DFloat(+0.146092f, +0.999146f, +0.227332f), + Vector3DFloat(-0.366924f, -0.211707f, +0.274697f), + Vector3DFloat(+0.751640f, +0.136509f, +0.662648f), + Vector3DFloat(+0.657888f, +0.102695f, +0.022736f), + Vector3DFloat(+0.861019f, -0.535813f, +0.561449f), + Vector3DFloat(+0.766839f, +0.006317f, +0.681204f), + Vector3DFloat(+0.596301f, +0.671255f, -0.933470f), + Vector3DFloat(+0.776910f, -0.313211f, -0.353923f), + Vector3DFloat(+0.266213f, +0.215796f, +0.026093f), + Vector3DFloat(-0.648732f, +0.907407f, -0.755425f), + Vector3DFloat(-0.585498f, -0.234535f, -0.085421f), + Vector3DFloat(-0.490890f, +0.657582f, +0.242897f), + Vector3DFloat(+0.913450f, +0.066622f, -0.220252f), + Vector3DFloat(+0.121067f, +0.658193f, -0.645314f), + Vector3DFloat(+0.367779f, +0.941588f, +0.618702f), + Vector3DFloat(-0.320231f, +0.354900f, -0.653005f), + Vector3DFloat(+0.540147f, -0.212317f, +0.559374f), + Vector3DFloat(+0.715812f, -0.211951f, +0.078646f), + Vector3DFloat(-0.711051f, +0.598132f, -0.708914f), + Vector3DFloat(+0.029756f, +0.324809f, +0.014924f), + Vector3DFloat(-0.106418f, +0.386090f, +0.596301f), + Vector3DFloat(-0.317179f, -0.068880f, -0.315165f), + Vector3DFloat(+0.860164f, -0.772881f, -0.158788f), + Vector3DFloat(-0.326640f, -0.304239f, +0.445906f), + Vector3DFloat(+0.621265f, -0.815729f, +0.129429f), + Vector3DFloat(+0.687063f, -0.052767f, -0.969481f), + Vector3DFloat(-0.800043f, -0.598621f, +0.764702f), + Vector3DFloat(-0.518052f, -0.221534f, -0.066256f), + Vector3DFloat(+0.164953f, +0.886898f, +0.954100f), + Vector3DFloat(-0.384808f, -0.641102f, -1.000000f), + Vector3DFloat(+0.299051f, +0.218360f, +0.561205f), + Vector3DFloat(-0.419050f, +0.324992f, -0.161779f), + Vector3DFloat(-0.403241f, -0.176305f, +0.442976f), + Vector3DFloat(+0.262001f, +0.042817f, -0.818842f), + Vector3DFloat(+0.740410f, +0.888852f, -0.281716f), + Vector3DFloat(-0.853084f, +0.886227f, -0.736442f), + Vector3DFloat(-0.666616f, +0.555956f, +0.477950f), + Vector3DFloat(-0.714164f, +0.112156f, -0.032197f), + Vector3DFloat(+0.142674f, -0.842341f, +0.199744f), + Vector3DFloat(-0.305948f, -0.295999f, +0.131504f), + Vector3DFloat(+0.667470f, -0.966674f, +0.728629f), + Vector3DFloat(+0.122166f, +0.928281f, -0.725028f), + Vector3DFloat(-0.236854f, -0.756096f, +0.374798f), + Vector3DFloat(+0.035432f, -0.423505f, -0.663747f), + Vector3DFloat(+0.051973f, -0.510910f, +0.716849f), + Vector3DFloat(+0.540208f, -0.821711f, +0.055757f), + Vector3DFloat(+0.699149f, +0.988098f, +0.326579f), + Vector3DFloat(+0.108188f, -0.867367f, +0.668996f), + Vector3DFloat(+0.077181f, -0.738884f, +0.103671f), + Vector3DFloat(-0.467391f, +0.957335f, -0.194494f), + Vector3DFloat(+0.123386f, +0.893674f, -0.523118f), + Vector3DFloat(-0.151036f, +0.955809f, +0.199622f), + Vector3DFloat(+0.075411f, +0.726493f, -0.363994f), + Vector3DFloat(+0.224647f, -0.208960f, +0.242531f), + Vector3DFloat(+0.993591f, +0.751213f, -0.535203f), + Vector3DFloat(+0.308512f, +0.990905f, -0.197241f), + Vector3DFloat(+0.292886f, +0.536180f, +0.191748f), + Vector3DFloat(+0.489853f, -0.461531f, +0.351665f), + Vector3DFloat(-0.329447f, +0.531602f, +0.216834f), + Vector3DFloat(-0.809320f, +0.675649f, +0.516037f), + Vector3DFloat(+0.565172f, -0.661184f, +0.359111f), + Vector3DFloat(-0.039460f, +0.110080f, +0.978698f), + Vector3DFloat(+0.885372f, -0.763787f, +0.145726f), + Vector3DFloat(+0.006195f, +0.231117f, +0.417585f), + Vector3DFloat(-0.566027f, +0.179846f, -0.010407f), + Vector3DFloat(-0.879391f, +0.940123f, +0.163305f), + Vector3DFloat(+0.490646f, +0.391949f, +0.415998f), + Vector3DFloat(-0.973815f, +0.550096f, +0.710868f), + Vector3DFloat(+0.643544f, +0.763543f, +0.160375f), + Vector3DFloat(-0.832759f, +0.150792f, -0.602466f), + Vector3DFloat(-0.564745f, -0.121982f, +0.213172f), + Vector3DFloat(-0.775750f, +0.120640f, +0.703970f), + Vector3DFloat(+0.952208f, -0.233375f, +0.984619f), + Vector3DFloat(+0.330241f, +0.344707f, -0.002472f), + Vector3DFloat(-0.601489f, +0.772454f, +0.954527f), + Vector3DFloat(-0.605335f, +0.422590f, -0.629261f), + Vector3DFloat(+0.199011f, +0.389996f, -0.293069f), + Vector3DFloat(-0.664479f, +0.964110f, -0.223731f), + Vector3DFloat(-0.477340f, +0.905515f, +0.378521f), + Vector3DFloat(-0.366741f, +0.233497f, +0.181860f), + Vector3DFloat(-0.438826f, -0.664724f, +0.521653f), + Vector3DFloat(-0.298990f, +0.153844f, -0.795587f), + Vector3DFloat(+0.679983f, -0.192114f, +0.451033f), + Vector3DFloat(-0.630360f, +0.283303f, +0.892270f), + Vector3DFloat(+0.940489f, +0.396222f, +0.550890f), + Vector3DFloat(-0.448653f, +0.065889f, -0.753105f), + Vector3DFloat(+0.712821f, +0.740410f, +0.025178f), + Vector3DFloat(-0.862606f, +0.692923f, +0.973937f), + Vector3DFloat(-0.583789f, +0.849544f, -0.579455f), + Vector3DFloat(+0.640675f, +0.542711f, +0.062960f), + Vector3DFloat(-0.916196f, +0.493881f, +0.192602f), + Vector3DFloat(+0.270119f, +0.636525f, +0.380108f), + Vector3DFloat(-0.297952f, -0.165502f, +0.871578f), + Vector3DFloat(-0.731132f, -0.883175f, +0.756951f), + Vector3DFloat(+0.373760f, +0.645436f, -0.736503f), + Vector3DFloat(-0.289407f, +0.663259f, +0.329142f), + Vector3DFloat(+0.544115f, +0.908933f, -0.156713f), + Vector3DFloat(+0.780816f, +0.264870f, -0.632984f), + Vector3DFloat(-0.935667f, +0.959899f, -0.686148f), + Vector3DFloat(+0.121250f, -0.882687f, -0.204260f), + Vector3DFloat(-0.002106f, -0.032807f, -0.532334f), + Vector3DFloat(+0.334208f, -0.147862f, -0.719474f), + Vector3DFloat(-0.956114f, +0.622791f, -0.764702f), + Vector3DFloat(+0.482162f, -0.907651f, +0.396100f), + Vector3DFloat(-0.477645f, +0.710196f, -0.589221f), + Vector3DFloat(-0.374676f, -0.293008f, -0.738578f), + Vector3DFloat(+0.273232f, -0.007050f, +0.227454f), + Vector3DFloat(-0.634449f, -0.640675f, -0.644276f), + Vector3DFloat(-0.173315f, +0.852840f, -0.000580f), + Vector3DFloat(+0.258766f, +0.261086f, -0.720450f), + Vector3DFloat(+0.048921f, +0.562609f, +0.668569f), + Vector3DFloat(+0.072970f, -0.296182f, -0.753594f), + Vector3DFloat(+0.409528f, -0.742302f, -0.429365f), + Vector3DFloat(-0.551012f, +0.193579f, -0.672414f), + Vector3DFloat(-0.698111f, -0.188940f, +0.302896f), + Vector3DFloat(-0.176366f, +0.111606f, +0.180273f), + Vector3DFloat(-0.273537f, -0.817988f, -0.519028f), + Vector3DFloat(+0.742546f, -0.983154f, -0.585864f), + Vector3DFloat(-0.631031f, +0.641469f, +0.681936f), + Vector3DFloat(+0.181127f, +0.238929f, -0.851680f), + Vector3DFloat(-0.075655f, -0.175085f, +0.213904f), + Vector3DFloat(-0.554369f, -0.458724f, -0.080172f), + Vector3DFloat(-0.326273f, +0.086398f, -0.203162f), + Vector3DFloat(+0.905332f, +0.605762f, +0.191443f), + Vector3DFloat(-0.920835f, -0.636525f, -0.977844f), + Vector3DFloat(-0.552110f, +0.156102f, +0.504135f), + Vector3DFloat(-0.243934f, +0.970763f, -0.160070f), + Vector3DFloat(+0.418195f, -0.050996f, +0.090060f), + Vector3DFloat(+0.875729f, -0.335307f, +0.542589f), + Vector3DFloat(-0.873226f, -0.135777f, +0.750908f), + Vector3DFloat(+0.086032f, -0.780999f, +0.032624f), + Vector3DFloat(-0.929746f, +0.173376f, -0.738212f), + Vector3DFloat(+0.665639f, -0.140172f, +0.821223f), + Vector3DFloat(-0.977416f, +0.008698f, +0.739372f), + Vector3DFloat(-0.899045f, +0.494980f, -0.542833f), + Vector3DFloat(+0.395062f, -0.662465f, +0.553148f), + Vector3DFloat(-0.157689f, +0.970824f, +0.186377f), + Vector3DFloat(+0.969970f, -0.372051f, +0.728263f), + Vector3DFloat(+0.902463f, +0.860225f, -0.170141f), + Vector3DFloat(+0.539415f, +0.112949f, -0.387066f), + Vector3DFloat(-0.530259f, +0.773553f, -0.593554f), + Vector3DFloat(-0.626392f, +0.377483f, +0.141209f), + Vector3DFloat(-0.949278f, -0.859554f, -0.846858f), + Vector3DFloat(-0.942442f, +0.152562f, -0.463973f), + Vector3DFloat(-0.897763f, -0.911557f, +0.570482f), + Vector3DFloat(+0.317179f, -0.045076f, -0.960204f), + Vector3DFloat(+0.895077f, -0.314066f, +0.184240f), + Vector3DFloat(-0.744621f, -0.192602f, -0.536485f), + Vector3DFloat(-0.266274f, +0.682974f, -0.871090f), + Vector3DFloat(-0.809748f, -0.032258f, +0.273232f), + Vector3DFloat(-0.124363f, -0.786309f, +0.657216f), + Vector3DFloat(-0.726981f, -0.371563f, -0.172521f), + Vector3DFloat(+0.812860f, -0.024384f, +0.532212f), + Vector3DFloat(+0.523545f, -0.821589f, -0.509934f), + Vector3DFloat(+0.236671f, +0.420148f, -0.802911f), + Vector3DFloat(+0.093783f, -0.909177f, -0.071932f), + Vector3DFloat(+0.262429f, +0.728141f, -0.095798f), + Vector3DFloat(+0.717826f, +0.067171f, -0.797784f), + Vector3DFloat(-0.413678f, +0.049593f, -0.137364f), + Vector3DFloat(-0.334391f, +0.978515f, +0.529893f), + Vector3DFloat(-0.559862f, +0.913511f, +0.188513f), + Vector3DFloat(-0.644642f, -0.352214f, +0.085849f), + Vector3DFloat(-0.257302f, +0.108371f, -0.744804f), + Vector3DFloat(-0.676015f, +0.866207f, -0.834712f), + Vector3DFloat(-0.021882f, -0.053072f, -0.795160f), + Vector3DFloat(-0.219214f, +0.475448f, -0.291055f), + Vector3DFloat(-0.698721f, -0.089816f, -0.867977f), + Vector3DFloat(-0.297403f, +0.136876f, +0.832881f), + Vector3DFloat(+0.438887f, +0.468001f, -0.946959f), + Vector3DFloat(+0.638905f, +0.782952f, -0.127903f), + Vector3DFloat(+0.363811f, -0.358745f, +0.460494f), + Vector3DFloat(+0.320109f, -0.028047f, -0.223365f), + Vector3DFloat(-0.274758f, -0.139256f, +0.302469f), + Vector3DFloat(-0.943297f, -0.316263f, +0.749382f), + Vector3DFloat(+0.863704f, -0.867183f, -0.148473f), + Vector3DFloat(+0.030122f, +0.751030f, -0.963439f), + Vector3DFloat(-0.818232f, -0.299966f, +0.403485f), + Vector3DFloat(-0.841548f, +0.378826f, -0.981689f), + Vector3DFloat(+0.927671f, +0.527696f, +0.309549f), + Vector3DFloat(+0.521897f, +0.299844f, -0.545579f), + Vector3DFloat(+0.324992f, +0.310648f, +0.759880f), + Vector3DFloat(+0.599170f, -0.695303f, +0.165380f), + Vector3DFloat(+0.708914f, +0.528916f, -0.764336f), + Vector3DFloat(+0.059297f, -0.576586f, +0.825312f), + Vector3DFloat(+0.139805f, +0.627247f, -0.101657f), + Vector3DFloat(+0.805414f, +0.160619f, +0.154210f), + Vector3DFloat(+0.131443f, +0.918393f, -0.376629f), + Vector3DFloat(-0.354289f, +0.161534f, +0.880612f), + Vector3DFloat(+0.880184f, +0.543138f, -0.826594f), + Vector3DFloat(-0.388714f, +0.751946f, +0.645680f), + Vector3DFloat(-0.018586f, -0.968078f, -0.617969f), + Vector3DFloat(+0.802057f, -0.795648f, +0.790704f), + Vector3DFloat(+0.311075f, -0.065828f, +0.444746f), + Vector3DFloat(-0.024201f, -0.412152f, +0.955382f), + Vector3DFloat(+0.783868f, +0.879452f, +0.727409f), + Vector3DFloat(-0.854427f, -0.093844f, +0.874935f), + Vector3DFloat(-0.670522f, -0.453780f, +0.165014f), + Vector3DFloat(-0.530381f, +0.169836f, +0.937071f), + Vector3DFloat(+0.902158f, +0.596423f, +0.575976f), + Vector3DFloat(+0.957152f, -0.666372f, -0.794610f), + Vector3DFloat(+0.901425f, -0.066378f, -0.684988f), + Vector3DFloat(+0.219581f, -0.090426f, -0.020356f), + Vector3DFloat(+0.297342f, +0.915708f, -0.119419f), + Vector3DFloat(+0.923887f, -0.212622f, +0.793695f), + Vector3DFloat(-0.747124f, -0.364666f, -0.375591f), + Vector3DFloat(-0.003021f, -0.386944f, +0.304849f), + Vector3DFloat(-0.614368f, +0.345805f, +0.845210f), + Vector3DFloat(+0.245827f, -0.766961f, +0.046358f), + Vector3DFloat(-0.746818f, +0.777642f, -0.485580f), + Vector3DFloat(+0.138524f, +0.468673f, -0.247108f), + Vector3DFloat(-0.569628f, -0.256020f, -0.044465f), + Vector3DFloat(-0.707572f, +0.080599f, +0.177892f), + Vector3DFloat(+0.925657f, -0.710807f, +0.201453f), + Vector3DFloat(+0.986267f, +0.476547f, +0.244362f), + Vector3DFloat(-0.092746f, -0.028718f, -0.235450f), + Vector3DFloat(-0.001740f, +0.748466f, +0.268288f), + Vector3DFloat(-0.974181f, -0.081942f, -0.602161f), + Vector3DFloat(+0.534898f, -0.743217f, -0.895077f), + Vector3DFloat(-0.720573f, -0.683096f, -0.631825f), + Vector3DFloat(+0.183569f, -0.549913f, -0.348125f), + Vector3DFloat(+0.623341f, -0.764275f, -0.951964f), + Vector3DFloat(+0.973693f, -0.825251f, -0.558580f), + Vector3DFloat(+0.620350f, +0.380169f, +0.510849f), + Vector3DFloat(+0.989074f, +0.641774f, +0.327128f), + Vector3DFloat(+0.624805f, +0.817988f, +0.537339f), + Vector3DFloat(+0.809870f, -0.280984f, +0.755486f), + Vector3DFloat(+0.521531f, -0.903928f, -0.742851f), + Vector3DFloat(-0.389325f, -0.433699f, -0.928343f), + Vector3DFloat(+0.176366f, -0.211768f, -0.189428f), + Vector3DFloat(-0.737602f, -0.928159f, -0.016449f), + Vector3DFloat(+0.723380f, -0.405866f, +0.167211f), + Vector3DFloat(+0.523301f, -0.666372f, -0.046480f), + Vector3DFloat(-0.118259f, +0.912290f, -0.160985f), + Vector3DFloat(+0.611927f, -0.191748f, +0.149998f), + Vector3DFloat(+0.905881f, -0.424482f, +0.913816f), + Vector3DFloat(-0.620411f, -0.027131f, +0.923276f), + Vector3DFloat(+0.774957f, -0.569140f, +0.871944f), + Vector3DFloat(-0.804193f, +0.661061f, +0.820795f), + Vector3DFloat(+0.077059f, -0.102023f, +0.278054f), + Vector3DFloat(+0.772637f, -0.104831f, -0.823847f), + Vector3DFloat(+0.983947f, +0.818659f, -0.089267f), + Vector3DFloat(+0.735221f, -0.709586f, -0.454268f), + Vector3DFloat(+0.996643f, -0.944945f, -0.538316f), + Vector3DFloat(+0.049165f, -0.796014f, +0.971374f), + Vector3DFloat(-0.976623f, +0.655263f, -0.156163f), + Vector3DFloat(+0.681143f, -0.005585f, +0.476547f), + Vector3DFloat(-0.928159f, +0.237648f, -0.346538f), + Vector3DFloat(+0.361003f, -0.709586f, +0.595325f), + Vector3DFloat(-0.345927f, +0.798700f, -0.321390f), + Vector3DFloat(-0.731803f, -0.701346f, -0.652272f), + Vector3DFloat(+0.164708f, -0.335795f, -0.213599f), + Vector3DFloat(-0.857601f, +0.151463f, +0.157689f), + Vector3DFloat(-0.754692f, -0.954283f, +0.308939f), + Vector3DFloat(-0.037446f, -0.637562f, -0.991150f), + Vector3DFloat(+0.744987f, -0.130894f, -0.575610f), + Vector3DFloat(-0.799249f, -0.131687f, +0.906247f), + Vector3DFloat(+0.580004f, +0.468734f, -0.745232f), + Vector3DFloat(+0.991882f, +0.138401f, +0.694693f), + Vector3DFloat(+0.830195f, +0.634877f, +0.715140f), + Vector3DFloat(+0.607532f, -0.317972f, -0.250710f), + Vector3DFloat(+0.037629f, -0.384320f, +0.812922f), + Vector3DFloat(+0.645009f, +0.224036f, -0.778924f), + Vector3DFloat(-0.852779f, -0.743522f, +0.346843f), + Vector3DFloat(+0.578478f, -0.894955f, -0.327616f), + Vector3DFloat(-0.905759f, -0.239296f, -0.945799f), + Vector3DFloat(+0.028352f, -0.658254f, -0.705313f), + Vector3DFloat(+0.954405f, +0.825434f, -0.553575f), + Vector3DFloat(-0.471480f, +0.504440f, -0.262856f), + Vector3DFloat(-0.924131f, +0.393353f, +0.106967f), + Vector3DFloat(-0.032685f, +0.385846f, -0.877255f), + Vector3DFloat(-0.039094f, +0.220557f, +0.356731f), + Vector3DFloat(+0.490890f, -0.403790f, -0.650624f), + Vector3DFloat(-0.896115f, -0.866817f, -0.837825f), + Vector3DFloat(-0.260842f, -0.027558f, +0.511582f), + Vector3DFloat(+0.782037f, +0.493759f, +0.229835f), + Vector3DFloat(+0.086337f, -0.713431f, +0.484664f), + Vector3DFloat(+0.168615f, -0.742058f, +0.639637f), + Vector3DFloat(+0.325968f, -0.567919f, -0.359294f), + Vector3DFloat(-0.633717f, -0.662709f, +0.374615f), + Vector3DFloat(+0.230995f, -0.701041f, +0.557970f), + Vector3DFloat(-0.729911f, -0.967650f, +0.951170f), + Vector3DFloat(-0.126011f, -0.819819f, -0.299539f), + Vector3DFloat(-0.166540f, +0.321024f, -0.704398f), + Vector3DFloat(+0.769890f, -0.977111f, -0.374187f), + Vector3DFloat(+0.562120f, +0.025300f, +0.299234f), + Vector3DFloat(+0.048189f, +0.404462f, -0.420026f), + Vector3DFloat(-0.840632f, +0.586291f, +0.360515f), + Vector3DFloat(+0.223792f, +0.024140f, +0.607593f), + Vector3DFloat(-0.562120f, +0.602771f, +0.948302f), + Vector3DFloat(+0.968627f, -0.994263f, -0.206030f), + Vector3DFloat(+0.146886f, -0.315287f, +0.034455f), + Vector3DFloat(+0.836848f, -0.348613f, +0.213904f), + Vector3DFloat(+0.494980f, -0.216041f, +0.405927f), + Vector3DFloat(-0.584338f, -0.268715f, -0.165258f), + Vector3DFloat(+0.118686f, -0.751091f, -0.381817f), + Vector3DFloat(-0.887753f, +0.178686f, -0.730216f), + Vector3DFloat(-0.684194f, -0.351543f, +0.952330f), + Vector3DFloat(-0.006256f, -0.564562f, +0.137974f), + Vector3DFloat(-0.229408f, +0.182470f, +0.427168f), + Vector3DFloat(+0.024445f, +0.920713f, +0.119724f), + Vector3DFloat(-0.996948f, -0.518784f, -0.045991f), + Vector3DFloat(-0.062166f, -0.592090f, +0.849117f), + Vector3DFloat(-0.377422f, -0.942808f, -0.649770f), + Vector3DFloat(+0.093478f, -0.242470f, -0.198096f), + Vector3DFloat(-0.594348f, -0.156102f, +0.401105f), + Vector3DFloat(-0.746574f, -0.294351f, +0.577685f), + Vector3DFloat(+0.504929f, +0.405194f, +0.724296f), + Vector3DFloat(-0.489059f, -0.492294f, +0.680288f), + Vector3DFloat(-0.025971f, -0.241127f, +0.103977f), + Vector3DFloat(+0.875301f, -0.574206f, -0.671804f), + Vector3DFloat(-0.483444f, +0.592029f, -0.537339f), + Vector3DFloat(+0.504257f, -0.413984f, -0.779839f), + Vector3DFloat(+0.182043f, -0.805292f, +0.988403f), + Vector3DFloat(+0.533372f, -0.142064f, +0.793512f), + Vector3DFloat(-0.105380f, -0.039338f, -0.624317f), + Vector3DFloat(+0.125950f, +0.384259f, +0.596973f), + Vector3DFloat(+0.452071f, +0.039216f, +0.924802f), + Vector3DFloat(-0.986694f, +0.452498f, +0.199194f), + Vector3DFloat(+0.230323f, +0.931516f, -0.380596f), + Vector3DFloat(+0.657277f, +0.811945f, -0.176733f), + Vector3DFloat(-0.477767f, -0.251137f, -0.468734f), + Vector3DFloat(+0.499252f, +0.543260f, +0.886898f), + Vector3DFloat(-0.528855f, +0.747124f, -0.789300f), + Vector3DFloat(-0.188330f, +0.434675f, -0.915891f), + Vector3DFloat(-0.807733f, +0.861080f, +0.386029f), + Vector3DFloat(-0.314615f, +0.761223f, -0.177953f), + Vector3DFloat(-0.855098f, +0.549486f, +0.547227f), + Vector3DFloat(-0.072970f, +0.647816f, -0.034089f), + Vector3DFloat(+0.385784f, +0.557482f, -0.912534f), + Vector3DFloat(-0.654530f, -0.923032f, -0.783624f), + Vector3DFloat(-0.755425f, -0.523789f, -0.132725f), + Vector3DFloat(+0.333781f, +0.322733f, +0.267678f), + Vector3DFloat(-0.533982f, -0.534471f, -0.399884f), + Vector3DFloat(-0.953673f, -0.589465f, +0.450423f), + Vector3DFloat(-0.789911f, -0.535936f, -0.409833f), + Vector3DFloat(+0.085726f, +0.363079f, +0.082003f), + Vector3DFloat(+0.744194f, -0.114292f, +0.322245f), + Vector3DFloat(+0.693472f, -0.256447f, -0.516160f), + Vector3DFloat(+0.446028f, -0.553026f, +0.471908f), + Vector3DFloat(-0.757561f, +0.608997f, +0.833064f), + Vector3DFloat(+0.115024f, +0.632191f, +0.314493f), + Vector3DFloat(-0.403851f, -0.325663f, -0.057161f), + Vector3DFloat(-0.188696f, +0.636097f, +0.514756f), + Vector3DFloat(-0.110813f, -0.473861f, -0.041597f), + Vector3DFloat(-0.239540f, +0.673940f, -0.874325f), + Vector3DFloat(+0.739982f, +0.350932f, -0.930418f), + Vector3DFloat(+0.519639f, -0.430952f, +0.569262f), + Vector3DFloat(-0.916807f, +0.117832f, +0.924070f), + Vector3DFloat(+0.856136f, +0.764763f, +0.653798f), + Vector3DFloat(+0.953185f, +0.721061f, +0.723441f), + Vector3DFloat(-0.113010f, +0.617176f, -0.436140f), + Vector3DFloat(+0.912839f, +0.496811f, -0.742058f), + Vector3DFloat(+0.219275f, -0.751701f, +0.479965f), + Vector3DFloat(+0.655690f, -0.964538f, +0.619312f), + Vector3DFloat(+0.364971f, +0.635975f, -0.697989f), + Vector3DFloat(-0.142247f, +0.554918f, +0.291238f), + Vector3DFloat(-0.163732f, -0.772820f, -0.887997f), + Vector3DFloat(-0.122593f, -0.456404f, -0.006989f), + Vector3DFloat(-0.704154f, -0.551378f, -0.237770f), + Vector3DFloat(+0.637501f, -0.831843f, -0.706534f), + Vector3DFloat(-0.794061f, -0.717887f, +0.576464f), + Vector3DFloat(+0.233558f, -0.683218f, +0.879147f), + Vector3DFloat(-0.170934f, +0.848811f, +0.840510f), + Vector3DFloat(+0.735282f, -0.625965f, -0.309732f), + Vector3DFloat(-0.562975f, +0.929746f, +0.794794f), + Vector3DFloat(-0.455611f, -0.860836f, -0.810114f), + Vector3DFloat(+0.433882f, -0.190222f, -0.529405f), + Vector3DFloat(+0.785638f, -0.040864f, +0.050569f), + Vector3DFloat(-0.963134f, -0.993713f, -0.817011f), + Vector3DFloat(+0.787347f, -0.598071f, +0.782220f), + Vector3DFloat(-0.551378f, +0.589526f, +0.061983f), + Vector3DFloat(-0.987243f, +0.894589f, -0.469649f), + Vector3DFloat(+0.329264f, +0.164464f, -0.088656f), + Vector3DFloat(+0.068270f, +0.938841f, +0.700858f), + Vector3DFloat(+0.101535f, -0.583850f, -0.809503f), + Vector3DFloat(+0.906980f, -0.943724f, +0.461592f), + Vector3DFloat(+0.438520f, -0.329264f, +0.261086f), + Vector3DFloat(-0.700003f, -0.259316f, +0.784356f), + Vector3DFloat(+0.442305f, +0.444502f, +0.481185f), + Vector3DFloat(+0.326701f, -0.331523f, -0.227393f), + Vector3DFloat(-0.222327f, -0.308390f, +0.517136f), + Vector3DFloat(+0.275369f, -0.513169f, -0.177892f), + Vector3DFloat(-0.378887f, +0.668203f, +0.619312f), + Vector3DFloat(-0.785455f, -0.093661f, -0.071322f), + Vector3DFloat(-0.022309f, -0.744987f, +0.832820f), + Vector3DFloat(-0.177892f, +0.829707f, -0.550218f), + Vector3DFloat(+0.952879f, +0.477767f, +0.428999f), + Vector3DFloat(+0.113376f, +0.097568f, -0.921201f), + Vector3DFloat(+0.195898f, -0.924619f, -0.494613f), + Vector3DFloat(+0.727592f, -0.628956f, -0.029756f), + Vector3DFloat(-0.796197f, -0.450484f, -0.045686f), + Vector3DFloat(+0.670888f, +0.958068f, -0.902402f), + Vector3DFloat(-0.259194f, -0.570666f, +0.098422f), + Vector3DFloat(+0.120273f, -0.732475f, -0.712272f), + Vector3DFloat(+0.539109f, +0.754753f, -0.517075f), + Vector3DFloat(+0.320170f, +0.300821f, -0.790643f), + Vector3DFloat(-0.049287f, +0.269814f, -0.149998f), + Vector3DFloat(-0.004120f, +0.402081f, -0.856807f), + Vector3DFloat(+0.566881f, -0.224464f, -0.552049f), + Vector3DFloat(+0.323405f, -0.345317f, -0.119114f), + Vector3DFloat(-0.736198f, -0.234352f, +0.803278f), + Vector3DFloat(-0.424421f, +0.059358f, -0.162389f), + Vector3DFloat(+0.918516f, -0.884640f, -0.853511f), + Vector3DFloat(-0.633717f, +0.231239f, +0.672170f), + Vector3DFloat(+0.417096f, +0.454878f, +0.097201f), + Vector3DFloat(+0.183630f, -0.957030f, -0.368938f), + Vector3DFloat(-0.199133f, +0.191687f, -0.787774f), + Vector3DFloat(-0.109104f, +0.676077f, +0.731193f), + Vector3DFloat(-0.288186f, -0.801691f, +0.855037f), + Vector3DFloat(+0.332133f, -0.828730f, +0.005402f), + Vector3DFloat(+0.959166f, +0.197790f, -0.221107f), + Vector3DFloat(-0.646046f, +0.043428f, -0.379254f), + Vector3DFloat(-0.717338f, +0.122105f, +0.107883f), + Vector3DFloat(-0.299783f, +0.089389f, +0.977172f), + Vector3DFloat(+0.486862f, -0.577990f, -0.726615f), + Vector3DFloat(-0.400922f, +0.430769f, -0.834956f), + Vector3DFloat(+0.308756f, +0.735221f, -0.809076f), + Vector3DFloat(-0.304605f, +0.335551f, -0.350627f), + Vector3DFloat(-0.078219f, -0.288491f, -0.225318f), + Vector3DFloat(+0.529099f, +0.710562f, +0.002960f), + Vector3DFloat(+0.102695f, +0.410932f, -0.950072f), + Vector3DFloat(-0.715751f, +0.598621f, +0.188879f), + Vector3DFloat(-0.936460f, -0.232398f, -0.123203f), + Vector3DFloat(-0.733146f, -0.201819f, -0.463851f), + Vector3DFloat(-0.982971f, -0.581347f, -0.104953f), + Vector3DFloat(-0.219459f, +0.104648f, +0.416425f), + Vector3DFloat(+0.952391f, -0.038789f, +0.993530f), + Vector3DFloat(+0.992370f, +0.891537f, +0.959227f), + Vector3DFloat(+0.104221f, -0.305704f, -0.359722f), + Vector3DFloat(-0.722770f, +0.069735f, -0.801447f), + Vector3DFloat(+0.444563f, +0.354961f, +0.041414f), + Vector3DFloat(+0.642018f, -0.878903f, +0.058809f), + Vector3DFloat(-0.532579f, -0.463668f, +0.565233f), + Vector3DFloat(+0.411176f, -0.843379f, -0.172704f), + Vector3DFloat(+0.823908f, +0.619922f, +0.439863f), + Vector3DFloat(-0.340007f, +0.048189f, -0.529160f), + Vector3DFloat(+0.241310f, -0.585070f, +0.637135f), + Vector3DFloat(+0.146886f, +0.873226f, -0.425153f), + Vector3DFloat(-0.114658f, -0.465621f, +0.364483f), + Vector3DFloat(+0.987121f, -0.552599f, -0.918821f), + Vector3DFloat(+0.138401f, -0.917722f, +0.930479f), + Vector3DFloat(-0.732536f, -0.150731f, +0.613269f), + Vector3DFloat(-0.071139f, +0.752373f, +0.192541f), + Vector3DFloat(+0.475143f, -0.187353f, +0.258950f), + Vector3DFloat(-0.500412f, -0.829157f, -0.418073f), + Vector3DFloat(+0.260414f, +0.930479f, +0.483016f), + Vector3DFloat(-0.899106f, +0.528550f, +0.076510f), + Vector3DFloat(-0.084384f, +0.022614f, +0.609180f), + Vector3DFloat(-0.213843f, -0.532334f, -0.282022f), + Vector3DFloat(-0.715323f, +0.025117f, -0.698477f), + Vector3DFloat(+0.521348f, +0.088656f, -0.415265f), + Vector3DFloat(-0.131809f, -0.395672f, +0.932432f), + Vector3DFloat(-0.549364f, -0.948363f, -0.207862f), + Vector3DFloat(+0.908322f, +0.643605f, -0.103732f), + Vector3DFloat(+0.632496f, +0.330973f, +0.345622f), + Vector3DFloat(-0.522141f, +0.031892f, -0.920713f), + Vector3DFloat(-0.875912f, +0.481918f, -0.229408f), + Vector3DFloat(-0.698172f, -0.934202f, +0.051668f), + Vector3DFloat(-0.791070f, -0.452193f, -0.366680f), + Vector3DFloat(-0.531907f, +0.497299f, +0.386517f), + Vector3DFloat(-0.942808f, -0.775811f, -0.397320f), + Vector3DFloat(+0.577563f, +0.075289f, -0.943297f), + Vector3DFloat(+0.464827f, -0.145848f, -0.167638f), + Vector3DFloat(-0.503220f, +0.592273f, -0.617359f), + Vector3DFloat(+0.752739f, +0.503464f, -0.586230f), + Vector3DFloat(-0.040315f, +0.197180f, -0.259072f), + Vector3DFloat(-0.304422f, -0.989380f, -0.281289f), + Vector3DFloat(+0.063387f, -0.662954f, +0.451338f), + Vector3DFloat(-0.272744f, +0.768914f, -0.141270f), + Vector3DFloat(+0.475021f, +0.378033f, +0.186010f), + Vector3DFloat(+0.893613f, -0.671560f, +0.494491f), + Vector3DFloat(+0.154027f, +0.994873f, +0.138096f), + Vector3DFloat(-0.661061f, -0.039094f, +0.072787f), + Vector3DFloat(+0.849666f, -0.956298f, +0.300699f), + Vector3DFloat(-0.227027f, +0.343913f, +0.514512f), + Vector3DFloat(+0.812738f, -0.891659f, +0.790277f), + Vector3DFloat(+0.619251f, -0.234779f, -0.342448f), + Vector3DFloat(-0.698904f, -0.525620f, -0.553331f), + Vector3DFloat(-0.357524f, +0.950194f, -0.358623f), + Vector3DFloat(-0.174352f, -0.802911f, +0.215552f), + Vector3DFloat(+0.046175f, +0.043794f, +0.139927f), + Vector3DFloat(+0.911924f, +0.433149f, +0.302286f), + Vector3DFloat(+0.563463f, -0.326823f, -0.832759f), + Vector3DFloat(-0.293741f, -0.448103f, -0.951781f), + Vector3DFloat(+0.196448f, +0.627979f, +0.340800f), + Vector3DFloat(-0.727042f, -0.013886f, -0.847346f), + Vector3DFloat(-0.769707f, +0.780084f, +0.239174f), + Vector3DFloat(+0.168493f, +0.564806f, +0.509690f), + Vector3DFloat(-0.786126f, +0.663564f, -0.908261f), + Vector3DFloat(+0.084017f, -0.548631f, -0.207312f), + Vector3DFloat(+0.011567f, +0.906552f, +0.726188f), + Vector3DFloat(-0.723746f, +0.031648f, +0.250587f), + Vector3DFloat(+0.031892f, +0.693045f, -0.263283f), + Vector3DFloat(-0.601856f, -0.585742f, -0.769280f), + Vector3DFloat(+0.588122f, -0.108127f, -0.535020f), + Vector3DFloat(+0.455672f, +0.864498f, +0.963378f), + Vector3DFloat(-0.712882f, -0.335490f, -0.143712f), + Vector3DFloat(+0.199194f, +0.747002f, +0.380840f), + Vector3DFloat(+0.626820f, +0.508042f, -0.177465f), + Vector3DFloat(-0.441816f, +0.652150f, -0.549058f), + Vector3DFloat(+0.862667f, +0.053377f, +0.652333f), + Vector3DFloat(-0.002289f, +0.568834f, -0.069185f) + }; } #endif //__PolyVox_RandomVectors_H__ diff --git a/library/PolyVoxCore/source/Impl/RandomUnitVectors.cpp b/library/PolyVoxCore/source/Impl/RandomUnitVectors.cpp deleted file mode 100644 index f1d3aabf..00000000 --- a/library/PolyVoxCore/source/Impl/RandomUnitVectors.cpp +++ /dev/null @@ -1,1055 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/RandomUnitVectors.h" - -namespace PolyVox -{ - extern const Vector3DFloat randomUnitVectors[1024] = - { - Vector3DFloat(+0.339922f, +0.827727f, -0.446454f), - Vector3DFloat(+0.084104f, -0.552666f, -0.829148f), - Vector3DFloat(+0.272549f, -0.946890f, +0.170637f), - Vector3DFloat(-0.366941f, -0.785500f, -0.498341f), - Vector3DFloat(-0.566493f, -0.533056f, +0.628440f), - Vector3DFloat(+0.964857f, -0.261032f, -0.030203f), - Vector3DFloat(+0.692249f, -0.251370f, +0.676465f), - Vector3DFloat(-0.962508f, -0.173232f, -0.208734f), - Vector3DFloat(-0.659700f, +0.712315f, +0.239589f), - Vector3DFloat(+0.818392f, -0.574522f, +0.012631f), - Vector3DFloat(+0.560367f, -0.792890f, -0.239405f), - Vector3DFloat(+0.906429f, -0.307885f, +0.289127f), - Vector3DFloat(-0.159051f, +0.461737f, +0.872641f), - Vector3DFloat(-0.231332f, +0.080769f, +0.969516f), - Vector3DFloat(-0.053423f, +0.774833f, +0.629904f), - Vector3DFloat(+0.824248f, -0.144982f, +0.547353f), - Vector3DFloat(+0.174020f, -0.439121f, -0.881413f), - Vector3DFloat(+0.467553f, +0.882007f, -0.058800f), - Vector3DFloat(+0.538442f, -0.808622f, +0.237089f), - Vector3DFloat(+0.502236f, +0.150786f, -0.851483f), - Vector3DFloat(+0.735645f, +0.569407f, -0.366882f), - Vector3DFloat(-0.855825f, -0.328077f, -0.399912f), - Vector3DFloat(-0.474060f, -0.211393f, +0.854740f), - Vector3DFloat(+0.828518f, -0.114561f, +0.548119f), - Vector3DFloat(+0.740223f, -0.663929f, +0.106149f), - Vector3DFloat(-0.604006f, -0.756687f, +0.250204f), - Vector3DFloat(+0.382515f, -0.373773f, -0.844971f), - Vector3DFloat(-0.819034f, -0.162715f, -0.550188f), - Vector3DFloat(-0.982375f, +0.169525f, -0.078743f), - Vector3DFloat(+0.367097f, +0.380576f, +0.848765f), - Vector3DFloat(+0.569529f, +0.516287f, +0.639597f), - Vector3DFloat(-0.853575f, -0.243752f, +0.460429f), - Vector3DFloat(+0.678039f, -0.729861f, -0.086982f), - Vector3DFloat(-0.869225f, +0.393408f, +0.299462f), - Vector3DFloat(-0.916254f, -0.295218f, +0.270784f), - Vector3DFloat(-0.070601f, +0.873182f, +0.482253f), - Vector3DFloat(-0.863217f, +0.189580f, +0.467885f), - Vector3DFloat(-0.691774f, -0.687382f, -0.221257f), - Vector3DFloat(-0.229393f, -0.552390f, +0.801402f), - Vector3DFloat(+0.463007f, -0.161958f, -0.871432f), - Vector3DFloat(-0.952260f, +0.214379f, +0.217352f), - Vector3DFloat(+0.052543f, -0.983907f, +0.170781f), - Vector3DFloat(+0.286530f, +0.546131f, -0.787173f), - Vector3DFloat(+0.975618f, -0.202665f, +0.084242f), - Vector3DFloat(-0.946903f, +0.193782f, -0.256561f), - Vector3DFloat(+0.602392f, +0.563710f, +0.565115f), - Vector3DFloat(-0.419515f, -0.334134f, -0.844015f), - Vector3DFloat(+0.032529f, -0.018906f, -0.999292f), - Vector3DFloat(+0.683276f, +0.293783f, -0.668450f), - Vector3DFloat(+0.194348f, +0.974682f, +0.110565f), - Vector3DFloat(-0.140892f, +0.831281f, +0.537700f), - Vector3DFloat(+0.685721f, -0.335248f, -0.646062f), - Vector3DFloat(+0.308294f, +0.062479f, -0.949237f), - Vector3DFloat(-0.619897f, +0.133633f, -0.773220f), - Vector3DFloat(+0.568018f, -0.694982f, +0.440858f), - Vector3DFloat(+0.014460f, +0.810882f, -0.585031f), - Vector3DFloat(-0.939900f, +0.051870f, +0.337488f), - Vector3DFloat(+0.886477f, -0.450612f, -0.105395f), - Vector3DFloat(-0.787830f, +0.158037f, -0.595271f), - Vector3DFloat(-0.318153f, -0.830670f, -0.456910f), - Vector3DFloat(-0.106830f, -0.755766f, -0.646069f), - Vector3DFloat(-0.077610f, -0.893295f, -0.442720f), - Vector3DFloat(+0.321718f, -0.338373f, +0.884309f), - Vector3DFloat(+0.405993f, -0.037181f, +0.913119f), - Vector3DFloat(+0.635434f, -0.612340f, +0.470387f), - Vector3DFloat(-0.440661f, +0.527619f, -0.726248f), - Vector3DFloat(+0.682630f, +0.730693f, +0.010181f), - Vector3DFloat(+0.364300f, -0.398796f, -0.841574f), - Vector3DFloat(+0.023390f, -0.827974f, +0.560279f), - Vector3DFloat(-0.647533f, -0.750712f, +0.130894f), - Vector3DFloat(+0.618352f, +0.694153f, +0.368499f), - Vector3DFloat(+0.087485f, -0.552555f, +0.828872f), - Vector3DFloat(-0.317011f, -0.740865f, -0.592134f), - Vector3DFloat(+0.992075f, +0.089501f, +0.088190f), - Vector3DFloat(+0.660945f, -0.628212f, -0.410490f), - Vector3DFloat(-0.376167f, +0.394528f, -0.838359f), - Vector3DFloat(+0.761817f, -0.647395f, -0.022690f), - Vector3DFloat(+0.839361f, -0.432911f, -0.328727f), - Vector3DFloat(-0.411275f, +0.046377f, -0.910331f), - Vector3DFloat(+0.078506f, -0.797408f, +0.598312f), - Vector3DFloat(-0.381022f, +0.922073f, +0.067844f), - Vector3DFloat(-0.837489f, -0.501853f, +0.216232f), - Vector3DFloat(-0.993133f, +0.055873f, -0.102786f), - Vector3DFloat(+0.927419f, -0.354639f, -0.118844f), - Vector3DFloat(+0.159676f, +0.614049f, -0.772947f), - Vector3DFloat(-0.187074f, +0.846574f, +0.498312f), - Vector3DFloat(+0.516069f, +0.728369f, -0.450724f), - Vector3DFloat(-0.960108f, -0.233106f, -0.154447f), - Vector3DFloat(-0.987760f, -0.112007f, +0.108557f), - Vector3DFloat(+0.049202f, +0.998738f, -0.010071f), - Vector3DFloat(-0.821445f, +0.254709f, +0.510247f), - Vector3DFloat(+0.252350f, -0.204056f, +0.945876f), - Vector3DFloat(-0.398037f, +0.781383f, -0.480633f), - Vector3DFloat(+0.527785f, +0.747611f, -0.403137f), - Vector3DFloat(-0.998566f, +0.043248f, +0.031542f), - Vector3DFloat(+0.548139f, +0.684886f, +0.480078f), - Vector3DFloat(-0.566315f, -0.745438f, +0.351581f), - Vector3DFloat(-0.848496f, -0.030994f, +0.528294f), - Vector3DFloat(-0.070703f, +0.825305f, -0.560244f), - Vector3DFloat(+0.624014f, -0.043543f, +0.780199f), - Vector3DFloat(+0.964602f, -0.189230f, -0.183670f), - Vector3DFloat(+0.637905f, -0.539396f, +0.549663f), - Vector3DFloat(+0.114321f, +0.904904f, -0.409974f), - Vector3DFloat(-0.021617f, +0.186501f, +0.982217f), - Vector3DFloat(+0.469141f, -0.747866f, +0.469685f), - Vector3DFloat(+0.132117f, +0.385378f, +0.913252f), - Vector3DFloat(-0.252634f, -0.349595f, +0.902197f), - Vector3DFloat(-0.145421f, +0.945344f, +0.291851f), - Vector3DFloat(-0.600604f, +0.448416f, -0.661965f), - Vector3DFloat(+0.381683f, -0.700133f, -0.603433f), - Vector3DFloat(+0.569938f, -0.030470f, +0.821122f), - Vector3DFloat(+0.112037f, +0.915575f, +0.386225f), - Vector3DFloat(+0.059716f, -0.821586f, -0.566949f), - Vector3DFloat(-0.158273f, -0.639328f, -0.752468f), - Vector3DFloat(+0.001205f, -0.990747f, -0.135715f), - Vector3DFloat(-0.100969f, -0.176804f, -0.979054f), - Vector3DFloat(+0.169578f, -0.733794f, -0.657868f), - Vector3DFloat(+0.474056f, +0.669558f, -0.571807f), - Vector3DFloat(+0.014190f, -0.179546f, -0.983647f), - Vector3DFloat(-0.506680f, +0.784137f, -0.358337f), - Vector3DFloat(+0.402466f, +0.736544f, -0.543621f), - Vector3DFloat(-0.740589f, +0.430129f, +0.516252f), - Vector3DFloat(-0.731489f, -0.411418f, +0.543745f), - Vector3DFloat(-0.372220f, +0.822132f, -0.430756f), - Vector3DFloat(-0.403935f, +0.195178f, +0.893724f), - Vector3DFloat(+0.893255f, -0.191946f, +0.406512f), - Vector3DFloat(+0.257182f, +0.933321f, +0.250537f), - Vector3DFloat(-0.946047f, -0.252800f, +0.202699f), - Vector3DFloat(+0.287823f, -0.484935f, +0.825830f), - Vector3DFloat(+0.880378f, +0.321649f, +0.348535f), - Vector3DFloat(-0.820150f, +0.481236f, +0.309460f), - Vector3DFloat(-0.888465f, +0.169680f, -0.426425f), - Vector3DFloat(+0.761535f, -0.481027f, +0.434371f), - Vector3DFloat(+0.581314f, +0.037144f, -0.812831f), - Vector3DFloat(-0.014257f, -0.470925f, +0.882058f), - Vector3DFloat(+0.327440f, +0.265095f, -0.906922f), - Vector3DFloat(+0.445945f, +0.877176f, +0.178034f), - Vector3DFloat(+0.724926f, -0.523194f, -0.448052f), - Vector3DFloat(-0.649973f, +0.748818f, -0.129641f), - Vector3DFloat(-0.862141f, -0.181190f, -0.473163f), - Vector3DFloat(+0.546248f, -0.486978f, -0.681517f), - Vector3DFloat(-0.466403f, -0.132595f, +0.874578f), - Vector3DFloat(-0.726486f, +0.640533f, -0.248868f), - Vector3DFloat(-0.717238f, -0.164892f, +0.677038f), - Vector3DFloat(-0.173482f, -0.912751f, -0.369852f), - Vector3DFloat(+0.151425f, +0.097703f, +0.983628f), - Vector3DFloat(-0.367962f, +0.286588f, -0.884574f), - Vector3DFloat(-0.269776f, -0.681349f, +0.680430f), - Vector3DFloat(+0.587256f, +0.243525f, +0.771898f), - Vector3DFloat(+0.052027f, +0.391610f, -0.918659f), - Vector3DFloat(+0.991548f, -0.106357f, +0.074308f), - Vector3DFloat(+0.659039f, +0.457360f, -0.597067f), - Vector3DFloat(-0.626734f, -0.682082f, -0.376787f), - Vector3DFloat(-0.353101f, +0.033567f, -0.934983f), - Vector3DFloat(+0.621237f, -0.289495f, +0.728188f), - Vector3DFloat(+0.490845f, -0.189807f, +0.850320f), - Vector3DFloat(-0.699031f, -0.710681f, -0.079302f), - Vector3DFloat(-0.050094f, +0.880791f, +0.470847f), - Vector3DFloat(+0.070288f, -0.086374f, +0.993780f), - Vector3DFloat(+0.853154f, +0.022317f, +0.521181f), - Vector3DFloat(+0.230886f, +0.693269f, -0.682693f), - Vector3DFloat(-0.466130f, +0.883868f, -0.038727f), - Vector3DFloat(-0.551610f, +0.824661f, +0.125144f), - Vector3DFloat(-0.137494f, +0.409326f, -0.901968f), - Vector3DFloat(-0.890857f, -0.180159f, +0.417034f), - Vector3DFloat(+0.553659f, -0.392300f, +0.734549f), - Vector3DFloat(+0.406329f, -0.048366f, +0.912446f), - Vector3DFloat(-0.270581f, +0.233748f, -0.933888f), - Vector3DFloat(-0.197245f, +0.810087f, -0.552136f), - Vector3DFloat(+0.295429f, +0.704757f, +0.645011f), - Vector3DFloat(+0.717722f, -0.581869f, -0.382496f), - Vector3DFloat(+0.626543f, -0.539930f, +0.562067f), - Vector3DFloat(+0.971598f, -0.144608f, +0.187311f), - Vector3DFloat(-0.697722f, -0.464932f, -0.544998f), - Vector3DFloat(+0.457003f, +0.780926f, +0.425797f), - Vector3DFloat(+0.183694f, +0.717668f, -0.671720f), - Vector3DFloat(+0.251615f, -0.738280f, -0.625805f), - Vector3DFloat(+0.545768f, +0.806104f, +0.228766f), - Vector3DFloat(-0.928760f, -0.348049f, +0.127545f), - Vector3DFloat(+0.137432f, -0.972652f, -0.187242f), - Vector3DFloat(-0.804669f, -0.253834f, +0.536727f), - Vector3DFloat(-0.931569f, -0.252185f, -0.261882f), - Vector3DFloat(-0.604266f, -0.710349f, +0.360924f), - Vector3DFloat(-0.687860f, -0.535154f, -0.490367f), - Vector3DFloat(+0.017091f, +0.824354f, -0.565817f), - Vector3DFloat(+0.978598f, +0.134960f, +0.155346f), - Vector3DFloat(-0.802635f, +0.545353f, -0.241595f), - Vector3DFloat(+0.155235f, +0.909842f, +0.384824f), - Vector3DFloat(+0.499090f, -0.206100f, -0.841684f), - Vector3DFloat(-0.474793f, -0.216500f, +0.853053f), - Vector3DFloat(-0.317506f, -0.762610f, -0.563575f), - Vector3DFloat(-0.914433f, +0.049911f, -0.401649f), - Vector3DFloat(+0.209168f, +0.632836f, -0.745498f), - Vector3DFloat(+0.571789f, +0.197009f, -0.796395f), - Vector3DFloat(-0.364670f, +0.917590f, -0.158254f), - Vector3DFloat(-0.966271f, +0.140594f, -0.215761f), - Vector3DFloat(-0.915867f, +0.394413f, +0.075008f), - Vector3DFloat(+0.035516f, +0.991982f, -0.121285f), - Vector3DFloat(+0.334756f, -0.834260f, +0.438120f), - Vector3DFloat(+0.471469f, +0.810497f, -0.347579f), - Vector3DFloat(-0.630204f, -0.370799f, -0.682166f), - Vector3DFloat(+0.752076f, -0.232512f, +0.616701f), - Vector3DFloat(+0.780218f, -0.524134f, +0.341385f), - Vector3DFloat(-0.717151f, -0.558684f, -0.416614f), - Vector3DFloat(+0.026975f, +0.354843f, +0.934537f), - Vector3DFloat(+0.660713f, -0.205604f, +0.721931f), - Vector3DFloat(+0.569071f, -0.717916f, +0.400942f), - Vector3DFloat(+0.345670f, +0.917475f, -0.196853f), - Vector3DFloat(+0.109370f, +0.150700f, -0.982511f), - Vector3DFloat(-0.075296f, +0.867593f, -0.491541f), - Vector3DFloat(+0.427583f, +0.181258f, -0.885617f), - Vector3DFloat(-0.423011f, -0.536708f, +0.730073f), - Vector3DFloat(+0.410061f, +0.902819f, +0.129491f), - Vector3DFloat(+0.783330f, +0.352044f, -0.512307f), - Vector3DFloat(+0.019660f, +0.294402f, +0.955480f), - Vector3DFloat(+0.370284f, +0.795152f, -0.480232f), - Vector3DFloat(+0.620337f, +0.569302f, -0.539516f), - Vector3DFloat(-0.947343f, -0.008934f, +0.320097f), - Vector3DFloat(-0.093679f, +0.931693f, -0.350960f), - Vector3DFloat(-0.555730f, +0.665103f, +0.498802f), - Vector3DFloat(+0.319960f, +0.176651f, -0.930817f), - Vector3DFloat(-0.679840f, +0.281903f, +0.677014f), - Vector3DFloat(-0.954067f, +0.193782f, +0.228484f), - Vector3DFloat(+0.592922f, -0.708226f, +0.383222f), - Vector3DFloat(-0.759157f, -0.391265f, +0.520184f), - Vector3DFloat(-0.256083f, +0.304044f, +0.917594f), - Vector3DFloat(-0.462124f, +0.481197f, +0.744910f), - Vector3DFloat(-0.679480f, +0.733098f, +0.029563f), - Vector3DFloat(+0.025552f, -0.585890f, -0.809987f), - Vector3DFloat(-0.060045f, +0.002791f, +0.998192f), - Vector3DFloat(-0.507954f, +0.858736f, +0.067494f), - Vector3DFloat(-0.060525f, +0.636414f, -0.768969f), - Vector3DFloat(-0.874884f, +0.448472f, -0.182895f), - Vector3DFloat(+0.643562f, +0.762645f, -0.064807f), - Vector3DFloat(-0.516967f, -0.154231f, +0.841996f), - Vector3DFloat(+0.448249f, -0.717116f, -0.533683f), - Vector3DFloat(+0.536270f, -0.786853f, +0.305411f), - Vector3DFloat(+0.000761f, +0.527854f, -0.849335f), - Vector3DFloat(+0.723561f, -0.634332f, +0.272181f), - Vector3DFloat(+0.112740f, -0.371782f, -0.921449f), - Vector3DFloat(+0.966055f, +0.051903f, +0.253070f), - Vector3DFloat(-0.600327f, +0.248981f, -0.760011f), - Vector3DFloat(+0.091875f, +0.041693f, -0.994897f), - Vector3DFloat(-0.302152f, +0.607269f, +0.734798f), - Vector3DFloat(+0.287662f, -0.651858f, -0.701663f), - Vector3DFloat(-0.004536f, +0.679631f, +0.733540f), - Vector3DFloat(+0.526143f, +0.799583f, -0.289551f), - Vector3DFloat(-0.603927f, +0.789648f, -0.108294f), - Vector3DFloat(-0.033126f, +0.944024f, -0.328210f), - Vector3DFloat(-0.167102f, -0.851884f, -0.496358f), - Vector3DFloat(+0.288185f, -0.113731f, +0.950797f), - Vector3DFloat(+0.578194f, -0.436702f, -0.689190f), - Vector3DFloat(+0.217496f, +0.313876f, +0.924217f), - Vector3DFloat(-0.915961f, -0.158736f, -0.368535f), - Vector3DFloat(-0.498651f, +0.155245f, +0.852787f), - Vector3DFloat(-0.248762f, +0.679310f, -0.690403f), - Vector3DFloat(-0.582908f, +0.077123f, +0.808870f), - Vector3DFloat(+0.686950f, +0.229251f, -0.689597f), - Vector3DFloat(-0.647296f, +0.760051f, +0.057711f), - Vector3DFloat(-0.485938f, -0.092580f, +0.869076f), - Vector3DFloat(+0.418369f, +0.089460f, -0.903861f), - Vector3DFloat(-0.047269f, +0.350493f, -0.935372f), - Vector3DFloat(-0.242049f, -0.214469f, +0.946264f), - Vector3DFloat(-0.804456f, +0.566448f, +0.178852f), - Vector3DFloat(+0.097365f, -0.900938f, +0.422885f), - Vector3DFloat(+0.956649f, +0.290563f, +0.019905f), - Vector3DFloat(-0.783547f, +0.574387f, -0.236925f), - Vector3DFloat(-0.308724f, -0.086733f, -0.947189f), - Vector3DFloat(-0.035715f, +0.856029f, -0.515692f), - Vector3DFloat(+0.920461f, +0.190617f, +0.341199f), - Vector3DFloat(+0.637306f, +0.769628f, -0.038913f), - Vector3DFloat(-0.040111f, +0.877976f, +0.477021f), - Vector3DFloat(+0.110588f, +0.251198f, +0.961598f), - Vector3DFloat(-0.391595f, +0.858960f, +0.329911f), - Vector3DFloat(+0.159040f, +0.801465f, -0.576507f), - Vector3DFloat(-0.420361f, +0.896705f, +0.138623f), - Vector3DFloat(-0.706685f, -0.506701f, -0.493812f), - Vector3DFloat(+0.589701f, +0.807018f, -0.031213f), - Vector3DFloat(+0.613812f, +0.504595f, -0.607140f), - Vector3DFloat(+0.453930f, +0.802963f, +0.386261f), - Vector3DFloat(+0.034816f, +0.204525f, +0.978242f), - Vector3DFloat(+0.557178f, -0.795610f, +0.237816f), - Vector3DFloat(+0.694672f, -0.364363f, +0.620218f), - Vector3DFloat(+0.703004f, +0.571702f, +0.423015f), - Vector3DFloat(-0.821828f, -0.569379f, +0.020152f), - Vector3DFloat(+0.999573f, +0.011862f, +0.026716f), - Vector3DFloat(+0.045244f, +0.476148f, +0.878201f), - Vector3DFloat(-0.879083f, +0.458490f, +0.130387f), - Vector3DFloat(-0.548204f, +0.534573f, -0.643198f), - Vector3DFloat(+0.371419f, +0.536568f, +0.757722f), - Vector3DFloat(-0.121365f, +0.656202f, -0.744761f), - Vector3DFloat(-0.594210f, +0.803019f, -0.045540f), - Vector3DFloat(+0.249812f, +0.564218f, -0.786926f), - Vector3DFloat(+0.807295f, +0.588715f, -0.041117f), - Vector3DFloat(-0.333582f, +0.911830f, +0.239350f), - Vector3DFloat(+0.437116f, -0.527554f, -0.728434f), - Vector3DFloat(+0.061956f, +0.967757f, +0.244147f), - Vector3DFloat(+0.511582f, -0.822519f, -0.248487f), - Vector3DFloat(-0.341118f, -0.068048f, -0.937554f), - Vector3DFloat(+0.387840f, +0.793197f, +0.469487f), - Vector3DFloat(+0.682570f, +0.445391f, -0.579418f), - Vector3DFloat(+0.769534f, -0.445299f, -0.457740f), - Vector3DFloat(-0.883027f, -0.468901f, -0.019884f), - Vector3DFloat(-0.595228f, +0.589924f, +0.545613f), - Vector3DFloat(+0.123593f, +0.850082f, +0.511943f), - Vector3DFloat(+0.428617f, -0.326588f, -0.842394f), - Vector3DFloat(-0.838837f, +0.492096f, +0.232796f), - Vector3DFloat(-0.912950f, -0.283450f, -0.293562f), - Vector3DFloat(-0.701007f, +0.660260f, +0.269527f), - Vector3DFloat(-0.726761f, -0.673596f, -0.134488f), - Vector3DFloat(+0.969362f, -0.234200f, +0.074084f), - Vector3DFloat(-0.249448f, -0.056271f, +0.966752f), - Vector3DFloat(+0.996651f, -0.018843f, +0.079570f), - Vector3DFloat(+0.807648f, +0.476489f, +0.347367f), - Vector3DFloat(-0.749837f, -0.398796f, -0.527926f), - Vector3DFloat(+0.739222f, +0.268296f, +0.617712f), - Vector3DFloat(+0.770822f, -0.517357f, -0.371720f), - Vector3DFloat(-0.799675f, +0.207189f, +0.563554f), - Vector3DFloat(+0.858095f, +0.081493f, +0.506983f), - Vector3DFloat(+0.677579f, -0.727246f, +0.109543f), - Vector3DFloat(-0.745912f, -0.097643f, +0.658848f), - Vector3DFloat(+0.923446f, -0.321145f, +0.210033f), - Vector3DFloat(+0.633275f, +0.749248f, -0.193880f), - Vector3DFloat(+0.445950f, +0.115095f, +0.887627f), - Vector3DFloat(-0.813021f, +0.255444f, -0.523207f), - Vector3DFloat(-0.872976f, -0.483345f, -0.065502f), - Vector3DFloat(+0.587776f, +0.807323f, -0.052440f), - Vector3DFloat(-0.324123f, +0.518088f, -0.791536f), - Vector3DFloat(+0.041866f, +0.935359f, -0.351214f), - Vector3DFloat(-0.745819f, -0.037221f, -0.665108f), - Vector3DFloat(-0.625395f, -0.780290f, -0.005274f), - Vector3DFloat(-0.949212f, -0.125200f, -0.288653f), - Vector3DFloat(+0.746352f, +0.513825f, -0.423016f), - Vector3DFloat(+0.165203f, -0.819308f, -0.549038f), - Vector3DFloat(+0.749447f, -0.199908f, +0.631162f), - Vector3DFloat(-0.935221f, +0.313398f, +0.164751f), - Vector3DFloat(+0.574888f, +0.577243f, -0.579908f), - Vector3DFloat(+0.213935f, -0.439668f, +0.872309f), - Vector3DFloat(-0.067281f, -0.429365f, -0.900621f), - Vector3DFloat(-0.675176f, -0.265100f, -0.688374f), - Vector3DFloat(-0.940780f, -0.187993f, +0.282119f), - Vector3DFloat(+0.608412f, -0.674603f, -0.418026f), - Vector3DFloat(+0.226805f, -0.971072f, -0.074690f), - Vector3DFloat(-0.922002f, -0.058313f, -0.382768f), - Vector3DFloat(-0.889078f, -0.285307f, +0.357968f), - Vector3DFloat(-0.463386f, -0.780956f, +0.418785f), - Vector3DFloat(+0.480335f, -0.863968f, +0.151120f), - Vector3DFloat(-0.467641f, -0.601770f, -0.647444f), - Vector3DFloat(+0.752364f, -0.628982f, +0.195781f), - Vector3DFloat(+0.068107f, -0.990481f, -0.119616f), - Vector3DFloat(+0.225170f, -0.147543f, +0.963083f), - Vector3DFloat(+0.225228f, +0.971322f, +0.076195f), - Vector3DFloat(-0.991397f, -0.118660f, +0.055239f), - Vector3DFloat(-0.160493f, -0.746967f, +0.645200f), - Vector3DFloat(-0.458821f, -0.208468f, +0.863727f), - Vector3DFloat(+0.333033f, +0.516134f, +0.789110f), - Vector3DFloat(+0.732654f, +0.260905f, -0.628607f), - Vector3DFloat(-0.669918f, -0.656301f, -0.347102f), - Vector3DFloat(-0.786699f, +0.543142f, -0.293431f), - Vector3DFloat(+0.347036f, +0.004466f, +0.937841f), - Vector3DFloat(-0.484482f, -0.771461f, +0.412463f), - Vector3DFloat(+0.103332f, +0.547687f, -0.830278f), - Vector3DFloat(+0.119923f, -0.930107f, -0.347159f), - Vector3DFloat(+0.005754f, +0.994568f, +0.103930f), - Vector3DFloat(-0.033282f, +0.896829f, +0.441124f), - Vector3DFloat(+0.457958f, +0.771949f, +0.440874f), - Vector3DFloat(-0.519990f, +0.369290f, -0.770218f), - Vector3DFloat(-0.171662f, -0.061337f, -0.983245f), - Vector3DFloat(+0.250848f, +0.937167f, -0.242472f), - Vector3DFloat(-0.527961f, -0.608927f, +0.592001f), - Vector3DFloat(+0.524343f, -0.097826f, +0.845869f), - Vector3DFloat(-0.900974f, +0.373399f, +0.220951f), - Vector3DFloat(+0.287497f, +0.561963f, +0.775592f), - Vector3DFloat(+0.540008f, +0.803719f, -0.249855f), - Vector3DFloat(+0.566511f, +0.497948f, -0.656592f), - Vector3DFloat(+0.337228f, +0.656232f, -0.675009f), - Vector3DFloat(+0.978888f, -0.153522f, -0.134940f), - Vector3DFloat(+0.720676f, +0.649026f, +0.243702f), - Vector3DFloat(+0.530737f, +0.228155f, -0.816250f), - Vector3DFloat(+0.429492f, +0.091242f, -0.898449f), - Vector3DFloat(-0.572942f, +0.085360f, +0.815139f), - Vector3DFloat(+0.918652f, -0.255422f, +0.301395f), - Vector3DFloat(+0.947882f, -0.087598f, +0.306343f), - Vector3DFloat(+0.108362f, +0.969752f, -0.218719f), - Vector3DFloat(-0.471217f, +0.713578f, +0.518421f), - Vector3DFloat(+0.750274f, -0.244288f, -0.614339f), - Vector3DFloat(+0.560909f, -0.563116f, -0.606862f), - Vector3DFloat(+0.863412f, -0.431809f, +0.260886f), - Vector3DFloat(+0.316636f, +0.937246f, -0.145983f), - Vector3DFloat(-0.292652f, +0.171648f, +0.940687f), - Vector3DFloat(-0.636577f, +0.687143f, -0.350149f), - Vector3DFloat(+0.876483f, +0.262488f, +0.403581f), - Vector3DFloat(-0.477533f, +0.501607f, +0.721355f), - Vector3DFloat(+0.620654f, +0.186584f, +0.761561f), - Vector3DFloat(+0.085796f, +0.736783f, +0.670664f), - Vector3DFloat(-0.444489f, -0.220480f, -0.868227f), - Vector3DFloat(-0.380013f, +0.496385f, +0.780508f), - Vector3DFloat(+0.076912f, -0.385017f, -0.919699f), - Vector3DFloat(+0.148937f, -0.407401f, -0.901023f), - Vector3DFloat(+0.790103f, +0.361770f, -0.494833f), - Vector3DFloat(+0.206634f, +0.909197f, +0.361474f), - Vector3DFloat(+0.171861f, -0.895971f, -0.409512f), - Vector3DFloat(-0.961243f, +0.146552f, -0.233527f), - Vector3DFloat(-0.142180f, +0.815553f, +0.560944f), - Vector3DFloat(-0.423930f, -0.030949f, +0.905166f), - Vector3DFloat(+0.618879f, -0.685650f, +0.383241f), - Vector3DFloat(-0.209245f, +0.545013f, +0.811898f), - Vector3DFloat(+0.377987f, +0.747944f, -0.545624f), - Vector3DFloat(-0.791300f, +0.607509f, -0.069108f), - Vector3DFloat(+0.754199f, -0.113604f, -0.646744f), - Vector3DFloat(-0.583229f, -0.063801f, +0.809798f), - Vector3DFloat(-0.469901f, +0.015164f, +0.882589f), - Vector3DFloat(-0.978270f, +0.003442f, -0.207306f), - Vector3DFloat(+0.655500f, +0.726545f, +0.206039f), - Vector3DFloat(+0.967185f, -0.245972f, +0.063652f), - Vector3DFloat(-0.442760f, +0.675317f, +0.589840f), - Vector3DFloat(+0.403392f, +0.270425f, +0.874154f), - Vector3DFloat(+0.902052f, +0.135317f, +0.409868f), - Vector3DFloat(-0.210257f, -0.926257f, -0.312794f), - Vector3DFloat(-0.933559f, -0.225815f, -0.278344f), - Vector3DFloat(-0.635320f, +0.772243f, -0.003054f), - Vector3DFloat(-0.554821f, +0.812428f, -0.179259f), - Vector3DFloat(-0.844807f, +0.091109f, -0.527258f), - Vector3DFloat(-0.748601f, +0.549263f, -0.371358f), - Vector3DFloat(-0.081435f, +0.491490f, -0.867067f), - Vector3DFloat(+0.005014f, -0.658765f, +0.752332f), - Vector3DFloat(-0.384916f, +0.588836f, -0.710712f), - Vector3DFloat(-0.563287f, -0.436926f, -0.701287f), - Vector3DFloat(+0.075923f, -0.889985f, +0.449624f), - Vector3DFloat(+0.460179f, +0.240506f, -0.854630f), - Vector3DFloat(+0.133134f, +0.863013f, +0.487323f), - Vector3DFloat(-0.451891f, -0.691915f, +0.563071f), - Vector3DFloat(+0.482576f, +0.491924f, -0.724659f), - Vector3DFloat(-0.772395f, +0.503554f, +0.387091f), - Vector3DFloat(-0.861070f, -0.363456f, -0.355610f), - Vector3DFloat(-0.219092f, -0.539591f, +0.812921f), - Vector3DFloat(-0.232021f, +0.937887f, +0.257940f), - Vector3DFloat(+0.864410f, +0.411132f, +0.289425f), - Vector3DFloat(-0.657914f, +0.356283f, +0.663485f), - Vector3DFloat(-0.695536f, -0.354660f, -0.624856f), - Vector3DFloat(-0.984126f, +0.139830f, -0.109283f), - Vector3DFloat(-0.739931f, -0.568047f, +0.360312f), - Vector3DFloat(-0.422765f, +0.793857f, -0.437105f), - Vector3DFloat(+0.695244f, +0.499122f, +0.517216f), - Vector3DFloat(+0.620847f, +0.772096f, +0.135708f), - Vector3DFloat(+0.640543f, +0.693625f, -0.329529f), - Vector3DFloat(-0.716203f, +0.695845f, -0.053417f), - Vector3DFloat(+0.688286f, -0.614140f, +0.386127f), - Vector3DFloat(+0.990001f, -0.012803f, -0.140479f), - Vector3DFloat(-0.842904f, +0.537664f, +0.020753f), - Vector3DFloat(+0.008333f, +0.285713f, +0.958279f), - Vector3DFloat(-0.276086f, -0.823605f, +0.495431f), - Vector3DFloat(+0.795835f, -0.446944f, +0.408518f), - Vector3DFloat(-0.068520f, +0.989143f, -0.130001f), - Vector3DFloat(-0.995477f, -0.013318f, -0.094068f), - Vector3DFloat(-0.013256f, -0.205680f, +0.978530f), - Vector3DFloat(+0.286330f, +0.478558f, +0.830058f), - Vector3DFloat(-0.312670f, -0.000134f, +0.949862f), - Vector3DFloat(-0.992102f, -0.018784f, -0.124017f), - Vector3DFloat(-0.218201f, +0.471729f, +0.854318f), - Vector3DFloat(-0.885932f, -0.441603f, +0.141812f), - Vector3DFloat(+0.410418f, -0.903853f, +0.120862f), - Vector3DFloat(-0.046755f, -0.618559f, +0.784346f), - Vector3DFloat(+0.561077f, +0.827730f, +0.007490f), - Vector3DFloat(-0.264927f, +0.963738f, +0.031968f), - Vector3DFloat(+0.360743f, +0.887368f, -0.287127f), - Vector3DFloat(+0.829757f, -0.531319f, -0.170889f), - Vector3DFloat(-0.716516f, -0.646065f, +0.263068f), - Vector3DFloat(+0.557460f, +0.677923f, -0.479227f), - Vector3DFloat(-0.709849f, +0.694781f, -0.115733f), - Vector3DFloat(+0.853291f, -0.488531f, -0.182299f), - Vector3DFloat(+0.455284f, -0.849392f, -0.266925f), - Vector3DFloat(+0.417165f, +0.856319f, -0.304453f), - Vector3DFloat(+0.871881f, +0.388090f, +0.298681f), - Vector3DFloat(-0.103988f, +0.510844f, -0.853361f), - Vector3DFloat(+0.351047f, +0.889847f, -0.291441f), - Vector3DFloat(+0.389540f, -0.053379f, -0.919462f), - Vector3DFloat(-0.581684f, +0.075521f, +0.809901f), - Vector3DFloat(-0.422965f, -0.141455f, +0.895037f), - Vector3DFloat(+0.213377f, +0.454586f, -0.864767f), - Vector3DFloat(+0.159390f, +0.466820f, +0.869870f), - Vector3DFloat(+0.385902f, -0.013831f, +0.922436f), - Vector3DFloat(-0.360291f, -0.335817f, -0.870297f), - Vector3DFloat(-0.420892f, +0.570921f, -0.704910f), - Vector3DFloat(+0.046113f, -0.619140f, -0.783925f), - Vector3DFloat(+0.454440f, +0.871791f, -0.182935f), - Vector3DFloat(+0.523305f, -0.762818f, +0.379816f), - Vector3DFloat(-0.639517f, -0.634506f, -0.434073f), - Vector3DFloat(+0.286115f, -0.720485f, +0.631695f), - Vector3DFloat(+0.391046f, -0.912504f, -0.120079f), - Vector3DFloat(+0.562545f, +0.825619f, +0.043556f), - Vector3DFloat(+0.976939f, +0.145670f, -0.156113f), - Vector3DFloat(-0.197444f, -0.653530f, -0.730695f), - Vector3DFloat(-0.727176f, +0.159246f, +0.667724f), - Vector3DFloat(+0.977135f, +0.039408f, +0.208935f), - Vector3DFloat(+0.487883f, -0.668376f, -0.561466f), - Vector3DFloat(+0.081173f, -0.454129f, -0.887231f), - Vector3DFloat(+0.007776f, -0.558369f, -0.829556f), - Vector3DFloat(+0.392559f, -0.216208f, +0.893952f), - Vector3DFloat(+0.552351f, -0.797994f, -0.241067f), - Vector3DFloat(-0.812645f, +0.582758f, -0.000884f), - Vector3DFloat(+0.723477f, +0.425448f, +0.543668f), - Vector3DFloat(-0.290387f, -0.824836f, +0.485099f), - Vector3DFloat(-0.648037f, +0.731057f, +0.213549f), - Vector3DFloat(-0.112077f, +0.911214f, +0.396394f), - Vector3DFloat(-0.257374f, +0.878627f, +0.402212f), - Vector3DFloat(-0.871679f, -0.449228f, -0.195884f), - Vector3DFloat(-0.832643f, +0.503619f, -0.230377f), - Vector3DFloat(-0.750683f, +0.454826f, -0.479174f), - Vector3DFloat(+0.668945f, -0.737419f, +0.093412f), - Vector3DFloat(+0.232689f, -0.239415f, -0.942622f), - Vector3DFloat(+0.932416f, +0.058455f, -0.356629f), - Vector3DFloat(-0.266008f, -0.899388f, +0.346900f), - Vector3DFloat(+0.574940f, -0.817948f, -0.020127f), - Vector3DFloat(-0.332832f, +0.728233f, +0.599083f), - Vector3DFloat(+0.252574f, -0.202957f, +0.946052f), - Vector3DFloat(+0.614750f, -0.787545f, +0.043079f), - Vector3DFloat(+0.502885f, +0.757385f, -0.416503f), - Vector3DFloat(-0.829003f, +0.454711f, -0.325562f), - Vector3DFloat(-0.568805f, +0.542102f, +0.618536f), - Vector3DFloat(-0.024095f, -0.673837f, -0.738487f), - Vector3DFloat(+0.138735f, -0.428584f, -0.892787f), - Vector3DFloat(-0.535936f, -0.016858f, +0.844090f), - Vector3DFloat(-0.040976f, +0.588714f, +0.807302f), - Vector3DFloat(-0.691862f, -0.721945f, +0.011050f), - Vector3DFloat(+0.862563f, -0.438786f, -0.251897f), - Vector3DFloat(+0.278186f, +0.894754f, +0.349326f), - Vector3DFloat(-0.377682f, -0.908327f, +0.179719f), - Vector3DFloat(-0.632125f, -0.611940f, +0.475339f), - Vector3DFloat(-0.575327f, -0.789967f, -0.212015f), - Vector3DFloat(+0.112909f, -0.993543f, -0.011156f), - Vector3DFloat(+0.593082f, -0.037683f, -0.804260f), - Vector3DFloat(-0.067094f, -0.620832f, +0.781067f), - Vector3DFloat(-0.152754f, +0.253291f, -0.955254f), - Vector3DFloat(-0.325782f, +0.882758f, -0.338533f), - Vector3DFloat(+0.359581f, -0.906944f, +0.219441f), - Vector3DFloat(-0.436527f, +0.597887f, +0.672291f), - Vector3DFloat(-0.475060f, +0.315753f, +0.821351f), - Vector3DFloat(-0.504146f, +0.392763f, -0.769138f), - Vector3DFloat(+0.732747f, -0.275063f, -0.622432f), - Vector3DFloat(-0.222604f, +0.239178f, +0.945115f), - Vector3DFloat(+0.929953f, +0.212024f, +0.300389f), - Vector3DFloat(+0.212224f, -0.914623f, -0.344129f), - Vector3DFloat(+0.744091f, -0.069074f, +0.664498f), - Vector3DFloat(+0.378632f, +0.925135f, -0.027624f), - Vector3DFloat(-0.657970f, +0.042972f, +0.751817f), - Vector3DFloat(-0.475295f, -0.858227f, -0.193754f), - Vector3DFloat(-0.002138f, -0.163379f, -0.986561f), - Vector3DFloat(+0.762016f, +0.464503f, -0.451186f), - Vector3DFloat(+0.110962f, +0.350977f, +0.929786f), - Vector3DFloat(+0.359220f, -0.409270f, +0.838725f), - Vector3DFloat(+0.067679f, -0.492517f, -0.867667f), - Vector3DFloat(-0.765643f, -0.627245f, -0.142671f), - Vector3DFloat(-0.736364f, -0.613024f, -0.286304f), - Vector3DFloat(-0.404067f, -0.396451f, +0.824352f), - Vector3DFloat(-0.908793f, +0.158289f, +0.386057f), - Vector3DFloat(-0.582767f, +0.467557f, +0.664660f), - Vector3DFloat(+0.437506f, -0.078200f, -0.895809f), - Vector3DFloat(+0.079580f, -0.165593f, -0.982978f), - Vector3DFloat(-0.152308f, +0.193183f, +0.969269f), - Vector3DFloat(+0.537776f, -0.029450f, -0.842573f), - Vector3DFloat(+0.242145f, -0.450593f, +0.859262f), - Vector3DFloat(-0.731540f, -0.287459f, +0.618237f), - Vector3DFloat(-0.822775f, +0.200303f, +0.531903f), - Vector3DFloat(+0.814744f, -0.396544f, +0.423019f), - Vector3DFloat(+0.981241f, +0.108708f, -0.159215f), - Vector3DFloat(+0.435099f, -0.134466f, -0.890285f), - Vector3DFloat(-0.863642f, -0.333093f, +0.378379f), - Vector3DFloat(+0.975214f, -0.007932f, +0.221121f), - Vector3DFloat(+0.562312f, +0.756514f, -0.333904f), - Vector3DFloat(-0.860757f, -0.321366f, -0.394743f), - Vector3DFloat(+0.202468f, +0.651174f, +0.731423f), - Vector3DFloat(+0.070835f, -0.997485f, -0.002525f), - Vector3DFloat(-0.282142f, -0.646099f, +0.709191f), - Vector3DFloat(+0.734636f, +0.546486f, -0.402073f), - Vector3DFloat(-0.792802f, +0.359455f, -0.492196f), - Vector3DFloat(+0.064556f, -0.768826f, +0.636192f), - Vector3DFloat(-0.387159f, -0.539262f, +0.747867f), - Vector3DFloat(-0.321231f, +0.945995f, +0.043642f), - Vector3DFloat(-0.051543f, -0.358058f, +0.932276f), - Vector3DFloat(+0.463676f, -0.211202f, +0.860464f), - Vector3DFloat(-0.985546f, -0.040806f, -0.164421f), - Vector3DFloat(-0.956965f, +0.289910f, -0.013071f), - Vector3DFloat(-0.575614f, -0.401429f, -0.712406f), - Vector3DFloat(+0.005411f, +0.912319f, +0.409443f), - Vector3DFloat(-0.147120f, +0.145609f, +0.978342f), - Vector3DFloat(+0.381181f, -0.303247f, +0.873351f), - Vector3DFloat(+0.646964f, -0.669990f, -0.364076f), - Vector3DFloat(+0.335662f, -0.334853f, +0.880457f), - Vector3DFloat(+0.812790f, -0.515621f, -0.271122f), - Vector3DFloat(+0.406265f, +0.443117f, -0.799122f), - Vector3DFloat(+0.818068f, +0.142779f, +0.557117f), - Vector3DFloat(-0.202146f, +0.482979f, +0.851979f), - Vector3DFloat(-0.359491f, -0.834883f, +0.416817f), - Vector3DFloat(+0.897243f, +0.373837f, -0.234949f), - Vector3DFloat(+0.734938f, -0.377211f, -0.563541f), - Vector3DFloat(+0.938936f, +0.089082f, +0.332362f), - Vector3DFloat(+0.847286f, +0.101367f, -0.521375f), - Vector3DFloat(+0.976962f, +0.212808f, -0.016060f), - Vector3DFloat(-0.484037f, -0.785288f, -0.386045f), - Vector3DFloat(+0.412432f, -0.846393f, -0.336925f), - Vector3DFloat(-0.290605f, -0.951829f, +0.097828f), - Vector3DFloat(+0.522856f, +0.099925f, -0.846544f), - Vector3DFloat(-0.268624f, -0.592962f, +0.759103f), - Vector3DFloat(+0.532873f, -0.247493f, +0.809193f), - Vector3DFloat(-0.313247f, +0.857502f, -0.408126f), - Vector3DFloat(-0.279136f, +0.481391f, +0.830870f), - Vector3DFloat(-0.648063f, -0.437447f, -0.623422f), - Vector3DFloat(+0.693159f, -0.411042f, +0.592094f), - Vector3DFloat(-0.361556f, -0.008347f, -0.932313f), - Vector3DFloat(-0.706752f, -0.017905f, +0.707235f), - Vector3DFloat(+0.277671f, +0.588210f, +0.759544f), - Vector3DFloat(+0.706147f, +0.436673f, -0.557380f), - Vector3DFloat(+0.329465f, -0.938612f, -0.102275f), - Vector3DFloat(+0.941491f, +0.304731f, -0.143996f), - Vector3DFloat(-0.530440f, -0.419970f, -0.736382f), - Vector3DFloat(-0.933059f, +0.333768f, -0.134161f), - Vector3DFloat(-0.799598f, -0.383384f, -0.462234f), - Vector3DFloat(+0.589799f, +0.017619f, -0.807358f), - Vector3DFloat(-0.157486f, -0.147213f, +0.976487f), - Vector3DFloat(+0.144612f, -0.765441f, +0.627046f), - Vector3DFloat(-0.224062f, +0.971686f, +0.074988f), - Vector3DFloat(-0.525446f, +0.743496f, +0.413666f), - Vector3DFloat(+0.913834f, -0.396502f, +0.087711f), - Vector3DFloat(+0.551810f, +0.713484f, -0.431793f), - Vector3DFloat(-0.988855f, +0.027355f, +0.146346f), - Vector3DFloat(+0.129678f, -0.922163f, +0.364417f), - Vector3DFloat(-0.443546f, +0.337851f, +0.830135f), - Vector3DFloat(-0.076099f, -0.128182f, -0.988827f), - Vector3DFloat(-0.930714f, -0.363326f, +0.042022f), - Vector3DFloat(-0.062724f, +0.597013f, -0.799776f), - Vector3DFloat(+0.674612f, -0.080125f, +0.733811f), - Vector3DFloat(-0.732149f, -0.106968f, -0.672693f), - Vector3DFloat(-0.477404f, -0.735544f, +0.480688f), - Vector3DFloat(+0.720306f, +0.691043f, +0.060162f), - Vector3DFloat(-0.480694f, -0.691928f, -0.538673f), - Vector3DFloat(+0.284364f, -0.490827f, +0.823545f), - Vector3DFloat(-0.467068f, -0.635840f, +0.614455f), - Vector3DFloat(+0.259424f, +0.728928f, +0.633532f), - Vector3DFloat(-0.829024f, +0.499711f, +0.251015f), - Vector3DFloat(+0.918101f, +0.199840f, +0.342278f), - Vector3DFloat(-0.132256f, +0.844697f, -0.518648f), - Vector3DFloat(-0.880945f, +0.470246f, +0.052958f), - Vector3DFloat(-0.907893f, +0.418701f, -0.020494f), - Vector3DFloat(-0.898489f, +0.435552f, -0.054882f), - Vector3DFloat(-0.181486f, -0.981241f, -0.065032f), - Vector3DFloat(+0.612484f, -0.390415f, -0.687342f), - Vector3DFloat(-0.674745f, +0.504350f, +0.538841f), - Vector3DFloat(-0.489037f, -0.427926f, +0.760080f), - Vector3DFloat(-0.629283f, +0.776741f, +0.026012f), - Vector3DFloat(-0.327015f, +0.559793f, +0.761375f), - Vector3DFloat(+0.143982f, -0.052568f, +0.988183f), - Vector3DFloat(+0.963642f, +0.246339f, -0.103498f), - Vector3DFloat(+0.083550f, +0.206217f, +0.974933f), - Vector3DFloat(+0.985008f, +0.097629f, -0.142221f), - Vector3DFloat(+0.386516f, -0.544556f, +0.744355f), - Vector3DFloat(-0.390134f, -0.377051f, +0.840017f), - Vector3DFloat(+0.188428f, -0.872526f, -0.450770f), - Vector3DFloat(-0.249415f, +0.963139f, +0.100774f), - Vector3DFloat(-0.246900f, -0.688081f, +0.682338f), - Vector3DFloat(-0.815515f, -0.341331f, -0.467363f), - Vector3DFloat(-0.828295f, -0.545972f, +0.125866f), - Vector3DFloat(-0.251196f, +0.860882f, +0.442473f), - Vector3DFloat(+0.787130f, -0.124629f, -0.604065f), - Vector3DFloat(-0.546825f, -0.350565f, +0.760320f), - Vector3DFloat(+0.910761f, +0.326941f, +0.252237f), - Vector3DFloat(-0.822947f, -0.029868f, +0.567332f), - Vector3DFloat(-0.119863f, -0.101264f, +0.987612f), - Vector3DFloat(+0.338978f, +0.251339f, +0.906600f), - Vector3DFloat(-0.168116f, +0.130641f, +0.977072f), - Vector3DFloat(+0.630274f, -0.051172f, +0.774685f), - Vector3DFloat(+0.509020f, +0.860289f, -0.028316f), - Vector3DFloat(-0.741184f, +0.614383f, -0.270518f), - Vector3DFloat(+0.783367f, +0.216068f, -0.582796f), - Vector3DFloat(-0.917044f, -0.239253f, -0.319042f), - Vector3DFloat(+0.326503f, +0.605534f, +0.725758f), - Vector3DFloat(-0.858028f, +0.033090f, +0.512536f), - Vector3DFloat(+0.920390f, +0.341687f, +0.190084f), - Vector3DFloat(+0.184870f, +0.206034f, -0.960923f), - Vector3DFloat(-0.320575f, -0.873361f, -0.366704f), - Vector3DFloat(-0.908564f, +0.179683f, -0.377129f), - Vector3DFloat(-0.995162f, +0.060094f, -0.077721f), - Vector3DFloat(-0.970805f, +0.057864f, +0.232786f), - Vector3DFloat(-0.438989f, -0.719230f, -0.538514f), - Vector3DFloat(-0.305764f, +0.586163f, +0.750281f), - Vector3DFloat(+0.813263f, +0.070638f, +0.577593f), - Vector3DFloat(-0.856072f, +0.356367f, -0.374356f), - Vector3DFloat(-0.291393f, -0.496711f, -0.817538f), - Vector3DFloat(-0.465919f, +0.423021f, +0.777157f), - Vector3DFloat(-0.197288f, +0.747479f, +0.634312f), - Vector3DFloat(+0.459532f, -0.294706f, +0.837842f), - Vector3DFloat(-0.669432f, -0.715572f, -0.199543f), - Vector3DFloat(+0.651361f, +0.729418f, -0.208995f), - Vector3DFloat(+0.899675f, -0.409092f, +0.152409f), - Vector3DFloat(-0.909013f, +0.374561f, +0.182756f), - Vector3DFloat(+0.584390f, +0.675714f, -0.449332f), - Vector3DFloat(-0.679644f, +0.693287f, -0.239658f), - Vector3DFloat(-0.447022f, -0.041260f, +0.893571f), - Vector3DFloat(-0.116547f, +0.050542f, -0.991898f), - Vector3DFloat(+0.395893f, +0.741111f, -0.542239f), - Vector3DFloat(+0.350204f, -0.445076f, -0.824175f), - Vector3DFloat(-0.172775f, +0.743090f, -0.646503f), - Vector3DFloat(+0.990144f, +0.139743f, -0.009361f), - Vector3DFloat(+0.519086f, +0.780496f, -0.348389f), - Vector3DFloat(-0.437746f, -0.398253f, +0.806085f), - Vector3DFloat(-0.008119f, +0.986280f, -0.164880f), - Vector3DFloat(+0.597715f, -0.604411f, -0.526711f), - Vector3DFloat(-0.097509f, +0.175580f, -0.979624f), - Vector3DFloat(+0.660655f, -0.124974f, +0.740214f), - Vector3DFloat(-0.206022f, +0.283440f, -0.936599f), - Vector3DFloat(-0.702342f, +0.672455f, -0.233496f), - Vector3DFloat(+0.306125f, -0.350950f, -0.884942f), - Vector3DFloat(+0.572172f, -0.424424f, -0.701772f), - Vector3DFloat(-0.218533f, -0.939401f, -0.264138f), - Vector3DFloat(+0.409469f, -0.491877f, -0.768370f), - Vector3DFloat(-0.651781f, -0.191800f, +0.733754f), - Vector3DFloat(+0.900352f, -0.242264f, -0.361490f), - Vector3DFloat(+0.809489f, +0.255902f, -0.528434f), - Vector3DFloat(+0.615724f, -0.777952f, +0.125199f), - Vector3DFloat(-0.337892f, -0.510143f, -0.790938f), - Vector3DFloat(-0.326182f, -0.695879f, +0.639811f), - Vector3DFloat(-0.877877f, -0.220692f, +0.425002f), - Vector3DFloat(+0.837897f, -0.278492f, -0.469436f), - Vector3DFloat(-0.802587f, -0.151114f, +0.577077f), - Vector3DFloat(+0.409855f, +0.796889f, -0.443832f), - Vector3DFloat(-0.374483f, +0.669830f, -0.641164f), - Vector3DFloat(-0.745860f, +0.343937f, -0.570438f), - Vector3DFloat(-0.202905f, +0.156353f, +0.966635f), - Vector3DFloat(+0.556026f, +0.322254f, -0.766151f), - Vector3DFloat(+0.776714f, +0.240272f, -0.582224f), - Vector3DFloat(-0.125301f, +0.638214f, -0.759594f), - Vector3DFloat(+0.399976f, +0.226329f, -0.888141f), - Vector3DFloat(-0.704797f, +0.579196f, -0.409625f), - Vector3DFloat(-0.007629f, +0.072037f, +0.997373f), - Vector3DFloat(-0.284284f, +0.861559f, +0.420592f), - Vector3DFloat(+0.775941f, +0.385137f, -0.499586f), - Vector3DFloat(-0.234994f, +0.400120f, +0.885823f), - Vector3DFloat(+0.575813f, +0.632406f, +0.518172f), - Vector3DFloat(+0.076477f, +0.592931f, -0.801613f), - Vector3DFloat(+0.603536f, -0.788719f, -0.116900f), - Vector3DFloat(-0.301173f, -0.779883f, -0.548705f), - Vector3DFloat(-0.315064f, -0.948217f, +0.040230f), - Vector3DFloat(+0.332902f, +0.851413f, -0.405304f), - Vector3DFloat(-0.403429f, +0.778318f, +0.481110f), - Vector3DFloat(-0.213870f, +0.976545f, +0.024873f), - Vector3DFloat(-0.753760f, -0.519440f, +0.402528f), - Vector3DFloat(-0.293424f, +0.935690f, -0.195925f), - Vector3DFloat(-0.370354f, +0.922391f, -0.109697f), - Vector3DFloat(+0.278418f, +0.666623f, +0.691445f), - Vector3DFloat(-0.284329f, +0.930765f, +0.229857f), - Vector3DFloat(+0.860824f, -0.367097f, -0.352452f), - Vector3DFloat(+0.541854f, -0.702580f, -0.461275f), - Vector3DFloat(+0.912176f, +0.185368f, -0.365478f), - Vector3DFloat(+0.168057f, +0.931969f, -0.321232f), - Vector3DFloat(-0.267320f, +0.845122f, +0.462934f), - Vector3DFloat(-0.201487f, +0.198600f, +0.959146f), - Vector3DFloat(-0.839945f, -0.276826f, -0.466754f), - Vector3DFloat(-0.740956f, -0.484640f, +0.464874f), - Vector3DFloat(-0.383491f, +0.705487f, -0.596006f), - Vector3DFloat(-0.954405f, -0.026765f, -0.297313f), - Vector3DFloat(+0.468574f, +0.859438f, +0.204460f), - Vector3DFloat(-0.940360f, +0.331786f, +0.075105f), - Vector3DFloat(-0.852277f, +0.454172f, -0.259522f), - Vector3DFloat(-0.759647f, +0.519837f, -0.390776f), - Vector3DFloat(+0.111525f, -0.475265f, -0.872746f), - Vector3DFloat(-0.452079f, -0.035104f, +0.891287f), - Vector3DFloat(+0.390392f, -0.669936f, -0.631490f), - Vector3DFloat(-0.292073f, +0.321693f, -0.900670f), - Vector3DFloat(+0.104005f, +0.994338f, +0.021788f), - Vector3DFloat(+0.960865f, +0.271665f, +0.054189f), - Vector3DFloat(-0.723235f, +0.690428f, +0.015487f), - Vector3DFloat(+0.179328f, -0.278614f, +0.943513f), - Vector3DFloat(+0.673808f, +0.589682f, +0.445263f), - Vector3DFloat(+0.731197f, +0.497511f, +0.466726f), - Vector3DFloat(+0.153734f, -0.134017f, +0.978982f), - Vector3DFloat(+0.456781f, -0.221267f, -0.861622f), - Vector3DFloat(+0.688864f, +0.648593f, +0.323719f), - Vector3DFloat(-0.036351f, +0.715024f, -0.698155f), - Vector3DFloat(+0.979208f, -0.118292f, +0.164797f), - Vector3DFloat(-0.543655f, -0.797469f, -0.261692f), - Vector3DFloat(+0.474224f, -0.342549f, -0.811031f), - Vector3DFloat(+0.455954f, +0.830262f, +0.320580f), - Vector3DFloat(+0.050584f, -0.993831f, -0.098696f), - Vector3DFloat(-0.061916f, +0.662832f, +0.746204f), - Vector3DFloat(+0.153491f, -0.981695f, +0.112766f), - Vector3DFloat(-0.303003f, +0.664435f, +0.683165f), - Vector3DFloat(+0.490302f, +0.248088f, -0.835497f), - Vector3DFloat(-0.909045f, +0.282351f, -0.306455f), - Vector3DFloat(+0.412988f, -0.552647f, +0.723894f), - Vector3DFloat(-0.254003f, -0.874419f, +0.413370f), - Vector3DFloat(-0.254922f, +0.922643f, -0.289387f), - Vector3DFloat(+0.788379f, -0.515671f, +0.335474f), - Vector3DFloat(+0.704882f, -0.446475f, -0.551182f), - Vector3DFloat(+0.446454f, +0.893141f, -0.054572f), - Vector3DFloat(-0.139484f, +0.078095f, -0.987140f), - Vector3DFloat(+0.196257f, -0.117325f, -0.973508f), - Vector3DFloat(-0.887951f, -0.452728f, +0.081119f), - Vector3DFloat(+0.482286f, +0.838290f, -0.254304f), - Vector3DFloat(-0.085400f, +0.836828f, +0.540764f), - Vector3DFloat(-0.033243f, -0.288034f, +0.957043f), - Vector3DFloat(+0.262770f, -0.771585f, +0.579318f), - Vector3DFloat(-0.911785f, -0.235533f, +0.336411f), - Vector3DFloat(+0.927275f, +0.367451f, -0.071696f), - Vector3DFloat(+0.771172f, -0.229858f, +0.593683f), - Vector3DFloat(-0.375316f, -0.068341f, -0.924374f), - Vector3DFloat(-0.735343f, +0.284450f, -0.615109f), - Vector3DFloat(-0.985363f, +0.154529f, +0.071973f), - Vector3DFloat(-0.544949f, +0.792232f, -0.274589f), - Vector3DFloat(-0.565066f, -0.783807f, -0.257579f), - Vector3DFloat(-0.188990f, +0.764476f, -0.616328f), - Vector3DFloat(+0.011964f, -0.681395f, +0.731818f), - Vector3DFloat(+0.647082f, +0.652894f, -0.393719f), - Vector3DFloat(-0.883463f, +0.088810f, -0.460006f), - Vector3DFloat(-0.443140f, -0.048579f, -0.895135f), - Vector3DFloat(+0.925708f, +0.333853f, -0.177785f), - Vector3DFloat(-0.057825f, -0.850139f, +0.523373f), - Vector3DFloat(+0.376782f, +0.740216f, +0.556881f), - Vector3DFloat(-0.711665f, -0.184658f, -0.677816f), - Vector3DFloat(+0.410214f, -0.115790f, -0.904609f), - Vector3DFloat(+0.382722f, +0.646393f, -0.660076f), - Vector3DFloat(-0.300767f, -0.354337f, +0.885429f), - Vector3DFloat(+0.568398f, +0.272778f, +0.776219f), - Vector3DFloat(-0.157935f, +0.980750f, +0.114830f), - Vector3DFloat(+0.359219f, +0.495150f, -0.791068f), - Vector3DFloat(-0.349238f, +0.056262f, -0.935344f), - Vector3DFloat(-0.633800f, +0.743629f, +0.212869f), - Vector3DFloat(+0.097107f, -0.993326f, -0.062246f), - Vector3DFloat(+0.372454f, -0.806078f, -0.459908f), - Vector3DFloat(-0.263428f, +0.934015f, +0.241290f), - Vector3DFloat(-0.943443f, +0.122444f, +0.308095f), - Vector3DFloat(+0.408781f, +0.502375f, -0.761917f), - Vector3DFloat(+0.697179f, -0.332546f, -0.635102f), - Vector3DFloat(-0.491802f, +0.870583f, -0.014715f), - Vector3DFloat(+0.737536f, -0.656902f, +0.156592f), - Vector3DFloat(+0.827336f, -0.246097f, +0.504928f), - Vector3DFloat(-0.446202f, +0.667651f, +0.595941f), - Vector3DFloat(-0.964936f, -0.243630f, +0.097691f), - Vector3DFloat(+0.897134f, -0.435766f, -0.072518f), - Vector3DFloat(-0.669699f, -0.151247f, -0.727068f), - Vector3DFloat(-0.016765f, -0.955618f, +0.294130f), - Vector3DFloat(-0.230630f, +0.832879f, -0.503112f), - Vector3DFloat(+0.899464f, +0.318825f, -0.298856f), - Vector3DFloat(+0.058885f, -0.789911f, +0.610388f), - Vector3DFloat(+0.659402f, +0.666930f, +0.346977f), - Vector3DFloat(+0.284813f, -0.414001f, -0.864572f), - Vector3DFloat(+0.484149f, -0.789140f, -0.377964f), - Vector3DFloat(+0.738956f, +0.298547f, -0.603998f), - Vector3DFloat(+0.136326f, +0.352541f, -0.925813f), - Vector3DFloat(+0.868090f, +0.478579f, +0.131841f), - Vector3DFloat(+0.446372f, -0.633533f, -0.631972f), - Vector3DFloat(-0.464744f, -0.873724f, +0.143596f), - Vector3DFloat(-0.157889f, +0.556623f, -0.815624f), - Vector3DFloat(-0.916952f, -0.270205f, +0.293579f), - Vector3DFloat(-0.968515f, +0.157169f, -0.193071f), - Vector3DFloat(-0.428526f, -0.889206f, +0.160242f), - Vector3DFloat(+0.396152f, +0.173085f, +0.901724f), - Vector3DFloat(+0.966792f, +0.160015f, -0.199271f), - Vector3DFloat(-0.912490f, -0.111826f, +0.393519f), - Vector3DFloat(+0.866392f, -0.192509f, -0.460765f), - Vector3DFloat(+0.480992f, +0.492893f, -0.725054f), - Vector3DFloat(-0.355535f, +0.884194f, +0.302977f), - Vector3DFloat(+0.980976f, -0.055915f, +0.185905f), - Vector3DFloat(-0.740688f, +0.154276f, -0.653896f), - Vector3DFloat(+0.193789f, -0.135151f, -0.971689f), - Vector3DFloat(-0.301940f, -0.417607f, -0.856993f), - Vector3DFloat(-0.519232f, +0.773966f, -0.362455f), - Vector3DFloat(+0.938672f, -0.020909f, -0.344177f), - Vector3DFloat(+0.637853f, -0.449939f, +0.625058f), - Vector3DFloat(+0.544105f, -0.664601f, -0.512109f), - Vector3DFloat(-0.170728f, -0.774921f, +0.608563f), - Vector3DFloat(+0.669668f, +0.441721f, -0.597016f), - Vector3DFloat(-0.311388f, -0.044999f, -0.949217f), - Vector3DFloat(+0.146744f, +0.375501f, +0.915131f), - Vector3DFloat(-0.703678f, -0.557559f, -0.440414f), - Vector3DFloat(-0.470187f, +0.695298f, +0.543585f), - Vector3DFloat(-0.254132f, -0.184139f, +0.949479f), - Vector3DFloat(-0.900622f, +0.005714f, +0.434565f), - Vector3DFloat(-0.014656f, +0.303063f, -0.952858f), - Vector3DFloat(-0.865696f, -0.264074f, +0.425247f), - Vector3DFloat(+0.481061f, +0.842497f, +0.242445f), - Vector3DFloat(-0.450784f, +0.137271f, +0.882015f), - Vector3DFloat(+0.091619f, +0.964503f, +0.247669f), - Vector3DFloat(-0.135659f, -0.122365f, +0.983170f), - Vector3DFloat(-0.322292f, +0.502269f, +0.802405f), - Vector3DFloat(+0.157842f, +0.435303f, +0.886339f), - Vector3DFloat(+0.158697f, -0.622087f, -0.766696f), - Vector3DFloat(+0.427134f, -0.647168f, -0.631451f), - Vector3DFloat(-0.101271f, +0.917326f, +0.385042f), - Vector3DFloat(-0.351641f, -0.653340f, -0.670445f), - Vector3DFloat(-0.903498f, -0.392917f, +0.171195f), - Vector3DFloat(+0.227012f, -0.849095f, -0.476974f), - Vector3DFloat(-0.094069f, -0.890637f, +0.444878f), - Vector3DFloat(+0.803352f, -0.594284f, -0.038110f), - Vector3DFloat(-0.094739f, -0.865030f, -0.492695f), - Vector3DFloat(+0.264702f, -0.854667f, +0.446629f), - Vector3DFloat(-0.897678f, +0.277821f, -0.342037f), - Vector3DFloat(-0.327036f, +0.939653f, +0.100497f), - Vector3DFloat(-0.826248f, -0.337885f, -0.450719f), - Vector3DFloat(+0.066622f, -0.956883f, +0.282730f), - Vector3DFloat(-0.746913f, -0.121996f, +0.653635f), - Vector3DFloat(-0.671734f, +0.736418f, +0.080385f), - Vector3DFloat(+0.693715f, +0.576755f, -0.431408f), - Vector3DFloat(-0.788320f, -0.082995f, -0.609642f), - Vector3DFloat(-0.456573f, +0.863290f, -0.215108f), - Vector3DFloat(-0.622201f, +0.453957f, +0.637800f), - Vector3DFloat(+0.723922f, +0.655748f, +0.214319f), - Vector3DFloat(+0.882913f, -0.420816f, -0.208276f), - Vector3DFloat(-0.926551f, +0.212056f, -0.310703f), - Vector3DFloat(+0.388695f, -0.691965f, +0.608358f), - Vector3DFloat(+0.728427f, +0.198534f, -0.655728f), - Vector3DFloat(+0.319262f, +0.105299f, +0.941798f), - Vector3DFloat(-0.333911f, +0.881805f, +0.333050f), - Vector3DFloat(+0.245338f, -0.611922f, -0.751904f), - Vector3DFloat(+0.220061f, -0.101481f, -0.970193f), - Vector3DFloat(+0.930032f, -0.311841f, +0.194412f), - Vector3DFloat(+0.048087f, -0.993913f, +0.099115f), - Vector3DFloat(-0.275537f, +0.705669f, +0.652772f), - Vector3DFloat(+0.383019f, -0.163631f, -0.909132f), - Vector3DFloat(-0.135900f, -0.988939f, +0.059414f), - Vector3DFloat(-0.662199f, +0.747009f, +0.058896f), - Vector3DFloat(-0.124689f, +0.015288f, +0.992078f), - Vector3DFloat(+0.489432f, -0.555663f, -0.672082f), - Vector3DFloat(-0.780927f, -0.255976f, +0.569763f), - Vector3DFloat(+0.694171f, +0.278571f, -0.663720f), - Vector3DFloat(-0.604581f, -0.463542f, -0.647774f), - Vector3DFloat(-0.676259f, -0.684602f, -0.272018f), - Vector3DFloat(+0.494855f, -0.701192f, -0.513272f), - Vector3DFloat(+0.565633f, +0.823079f, +0.050993f), - Vector3DFloat(+0.050237f, -0.998492f, +0.022122f), - Vector3DFloat(-0.386389f, -0.893963f, -0.227011f), - Vector3DFloat(+0.888703f, -0.437519f, -0.137056f), - Vector3DFloat(-0.914197f, +0.390980f, +0.106670f), - Vector3DFloat(+0.778906f, -0.627140f, -0.001437f), - Vector3DFloat(-0.603014f, +0.672265f, -0.429458f), - Vector3DFloat(+0.501042f, -0.665212f, +0.553579f), - Vector3DFloat(-0.995164f, +0.092308f, -0.033577f), - Vector3DFloat(-0.998104f, +0.018497f, +0.058712f), - Vector3DFloat(+0.929569f, +0.123842f, -0.347225f), - Vector3DFloat(+0.235077f, -0.609238f, +0.757343f), - Vector3DFloat(-0.452902f, -0.887545f, +0.084525f), - Vector3DFloat(-0.137550f, -0.488131f, -0.861863f), - Vector3DFloat(+0.660545f, -0.371465f, +0.652453f), - Vector3DFloat(+0.747313f, -0.657236f, +0.097799f), - Vector3DFloat(-0.543312f, -0.315699f, -0.777911f), - Vector3DFloat(+0.189959f, -0.346861f, +0.918478f), - Vector3DFloat(+0.323571f, +0.300781f, +0.897125f), - Vector3DFloat(-0.482606f, +0.875832f, -0.003165f), - Vector3DFloat(-0.936502f, +0.291824f, -0.194430f), - Vector3DFloat(-0.503609f, -0.390560f, +0.770610f), - Vector3DFloat(-0.540142f, +0.002774f, -0.841569f), - Vector3DFloat(-0.085055f, -0.996376f, -0.000148f), - Vector3DFloat(-0.615309f, +0.059981f, -0.786000f), - Vector3DFloat(+0.718191f, +0.505958f, -0.477711f), - Vector3DFloat(-0.167397f, +0.844465f, -0.508780f), - Vector3DFloat(+0.636446f, -0.344036f, -0.690345f), - Vector3DFloat(+0.663267f, +0.700418f, -0.263613f), - Vector3DFloat(+0.602334f, +0.435514f, +0.668970f), - Vector3DFloat(-0.275820f, -0.393792f, +0.876842f), - Vector3DFloat(+0.437736f, -0.747931f, +0.498986f), - Vector3DFloat(+0.882319f, +0.417138f, +0.217965f), - Vector3DFloat(-0.851108f, -0.482384f, -0.207174f), - Vector3DFloat(+0.320590f, +0.898664f, +0.299375f), - Vector3DFloat(-0.621201f, -0.614972f, +0.485714f), - Vector3DFloat(+0.911173f, +0.041873f, +0.409892f), - Vector3DFloat(+0.729444f, +0.142692f, -0.668992f), - Vector3DFloat(+0.666307f, -0.735324f, +0.123831f), - Vector3DFloat(+0.463591f, +0.847227f, -0.259402f), - Vector3DFloat(+0.894296f, +0.059634f, +0.443484f), - Vector3DFloat(-0.736335f, -0.674274f, +0.056256f), - Vector3DFloat(+0.469502f, -0.733536f, +0.491420f), - Vector3DFloat(-0.391723f, -0.837099f, +0.381861f), - Vector3DFloat(-0.437372f, -0.437618f, -0.785618f), - Vector3DFloat(-0.203384f, -0.343038f, -0.917039f), - Vector3DFloat(-0.945306f, +0.221497f, +0.239450f), - Vector3DFloat(+0.773091f, +0.496793f, +0.394369f), - Vector3DFloat(-0.710103f, +0.093103f, +0.697915f), - Vector3DFloat(-0.456786f, +0.151779f, +0.876533f), - Vector3DFloat(+0.373153f, +0.587166f, -0.718326f), - Vector3DFloat(-0.559785f, -0.793881f, +0.237473f), - Vector3DFloat(-0.884665f, +0.422952f, +0.196163f), - Vector3DFloat(-0.468879f, +0.300549f, -0.830556f), - Vector3DFloat(+0.958105f, +0.285330f, -0.024919f), - Vector3DFloat(+0.825326f, -0.423197f, -0.373819f), - Vector3DFloat(-0.034122f, +0.999414f, +0.002781f), - Vector3DFloat(-0.904795f, -0.041789f, -0.423792f), - Vector3DFloat(-0.799927f, +0.541477f, -0.258687f), - Vector3DFloat(+0.995132f, +0.000543f, -0.098546f), - Vector3DFloat(+0.843984f, -0.507103f, -0.174749f), - Vector3DFloat(-0.640934f, +0.618163f, +0.455058f), - Vector3DFloat(+0.543397f, +0.492878f, +0.679553f), - Vector3DFloat(+0.408980f, -0.467105f, +0.783932f), - Vector3DFloat(+0.219682f, +0.823953f, +0.522343f), - Vector3DFloat(+0.845523f, +0.410442f, -0.341509f), - Vector3DFloat(-0.997099f, +0.057254f, -0.050159f), - Vector3DFloat(+0.535588f, +0.112415f, +0.836964f), - Vector3DFloat(+0.139015f, +0.182777f, +0.973277f), - Vector3DFloat(+0.681261f, +0.731126f, -0.036585f), - Vector3DFloat(-0.161589f, +0.986188f, -0.036352f), - Vector3DFloat(-0.294098f, +0.640063f, +0.709806f), - Vector3DFloat(+0.213370f, -0.880985f, -0.422301f), - Vector3DFloat(-0.903331f, +0.383376f, +0.192395f), - Vector3DFloat(+0.020283f, +0.989297f, -0.144498f), - Vector3DFloat(+0.550858f, -0.603955f, +0.576016f), - Vector3DFloat(-0.297499f, -0.396883f, -0.868319f), - Vector3DFloat(-0.125581f, +0.971238f, +0.202303f), - Vector3DFloat(+0.994606f, -0.096856f, +0.037125f), - Vector3DFloat(+0.959844f, -0.254636f, -0.117729f), - Vector3DFloat(-0.332961f, +0.808031f, +0.486028f), - Vector3DFloat(+0.118411f, -0.818829f, +0.561692f), - Vector3DFloat(-0.329010f, +0.932571f, +0.148536f), - Vector3DFloat(+0.386616f, -0.386923f, -0.837149f), - Vector3DFloat(+0.501223f, -0.201907f, -0.841433f), - Vector3DFloat(+0.555119f, -0.793008f, -0.250959f), - Vector3DFloat(-0.512485f, +0.850268f, -0.120011f), - Vector3DFloat(+0.573352f, +0.737293f, +0.357306f), - Vector3DFloat(+0.315311f, -0.182192f, +0.931335f), - Vector3DFloat(+0.156167f, -0.963694f, -0.216579f), - Vector3DFloat(-0.285174f, -0.542273f, +0.790326f), - Vector3DFloat(-0.277593f, +0.668866f, +0.689609f), - Vector3DFloat(+0.319798f, -0.921924f, +0.218599f), - Vector3DFloat(-0.727455f, -0.686116f, -0.007338f), - Vector3DFloat(+0.219712f, -0.952663f, +0.210141f), - Vector3DFloat(+0.491792f, +0.552463f, -0.672997f), - Vector3DFloat(-0.526640f, +0.820445f, +0.222533f) - }; -} diff --git a/library/PolyVoxCore/source/Impl/RandomVectors.cpp b/library/PolyVoxCore/source/Impl/RandomVectors.cpp deleted file mode 100644 index b6f141da..00000000 --- a/library/PolyVoxCore/source/Impl/RandomVectors.cpp +++ /dev/null @@ -1,1055 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/RandomVectors.h" - -namespace PolyVox -{ - extern const Vector3DFloat randomVectors[1024] = - { - Vector3DFloat(+0.348918f, -0.385662f, +0.650197f), - Vector3DFloat(-0.259255f, +0.791559f, +0.920957f), - Vector3DFloat(+0.940733f, -0.101535f, +0.250160f), - Vector3DFloat(-0.308939f, +0.367656f, +0.877987f), - Vector3DFloat(+0.112949f, -0.047090f, -0.730277f), - Vector3DFloat(-0.605579f, +0.039705f, +0.310160f), - Vector3DFloat(+0.086459f, +0.376446f, -0.496078f), - Vector3DFloat(+0.565661f, -0.261574f, -0.924986f), - Vector3DFloat(-0.285745f, -0.792047f, -0.582568f), - Vector3DFloat(+0.943175f, +0.226844f, +0.823481f), - Vector3DFloat(+0.599414f, +0.846797f, -0.438215f), - Vector3DFloat(-0.502731f, -0.907407f, +0.170751f), - Vector3DFloat(+0.136204f, -0.735527f, -0.066622f), - Vector3DFloat(-0.618763f, +0.825617f, -0.325053f), - Vector3DFloat(+0.942076f, +0.608325f, -0.532517f), - Vector3DFloat(-0.466414f, -0.248756f, -0.189856f), - Vector3DFloat(+0.618213f, +0.879513f, +0.120090f), - Vector3DFloat(-0.918393f, +0.876522f, +0.265114f), - Vector3DFloat(+0.345195f, +0.670705f, -0.914243f), - Vector3DFloat(-0.600757f, -0.417646f, -0.736747f), - Vector3DFloat(-0.271828f, +0.215674f, +0.890622f), - Vector3DFloat(+0.100986f, +0.821955f, +0.429975f), - Vector3DFloat(+0.811823f, -0.506943f, +0.635853f), - Vector3DFloat(+0.647084f, +0.297403f, -0.714774f), - Vector3DFloat(+0.531907f, -0.917417f, +0.795770f), - Vector3DFloat(-0.151585f, +0.250038f, +0.959105f), - Vector3DFloat(+0.311747f, -0.850948f, +0.946348f), - Vector3DFloat(+0.641407f, -0.747978f, +0.464583f), - Vector3DFloat(+0.297769f, -0.427839f, +0.867489f), - Vector3DFloat(+0.305032f, +0.985900f, +0.071261f), - Vector3DFloat(+0.105930f, -0.895016f, +0.871700f), - Vector3DFloat(+0.060335f, -0.312235f, +0.247475f), - Vector3DFloat(+0.174718f, +0.776055f, -0.783563f), - Vector3DFloat(-0.018342f, -0.031343f, +0.533982f), - Vector3DFloat(+0.136753f, -0.201575f, -0.694998f), - Vector3DFloat(+0.606006f, +0.353069f, -0.174841f), - Vector3DFloat(-0.720573f, +0.272805f, -0.679189f), - Vector3DFloat(+0.802484f, -0.649281f, -0.884274f), - Vector3DFloat(-0.577807f, -0.794610f, +0.227332f), - Vector3DFloat(-0.391644f, +0.440474f, -0.927854f), - Vector3DFloat(+0.631825f, +0.072115f, +0.943785f), - Vector3DFloat(-0.898312f, +0.257363f, -0.942930f), - Vector3DFloat(-0.608264f, +0.583667f, +0.228126f), - Vector3DFloat(-0.788202f, +0.777764f, +0.722953f), - Vector3DFloat(-0.624622f, -0.296976f, -0.382122f), - Vector3DFloat(+0.921323f, -0.356365f, -0.750542f), - Vector3DFloat(-0.899106f, +0.578234f, +0.937132f), - Vector3DFloat(+0.830744f, -0.789422f, -0.026154f), - Vector3DFloat(+0.720634f, +0.135166f, -0.366985f), - Vector3DFloat(+0.796930f, +0.687124f, +0.807855f), - Vector3DFloat(+0.262001f, -0.120945f, -0.196631f), - Vector3DFloat(+0.562426f, -0.886166f, +0.699149f), - Vector3DFloat(+0.047945f, -0.781793f, +0.465987f), - Vector3DFloat(+0.219275f, +0.152440f, +0.726127f), - Vector3DFloat(-0.970641f, -0.384136f, -0.340739f), - Vector3DFloat(+0.244606f, +0.969848f, +0.466903f), - Vector3DFloat(+0.608753f, +0.329936f, -0.411542f), - Vector3DFloat(+0.959593f, -0.833186f, -0.698721f), - Vector3DFloat(+0.475692f, -0.320658f, +0.507675f), - Vector3DFloat(-0.155431f, -0.050447f, -0.455855f), - Vector3DFloat(-0.738456f, +0.917173f, -0.407758f), - Vector3DFloat(-0.555284f, +0.842891f, -0.984619f), - Vector3DFloat(+0.696951f, +0.155553f, -0.031526f), - Vector3DFloat(-0.131565f, -0.563707f, +0.076815f), - Vector3DFloat(-0.319376f, +0.620106f, +0.567614f), - Vector3DFloat(-0.628163f, -0.813959f, -0.438581f), - Vector3DFloat(+0.484115f, +0.060640f, -0.176183f), - Vector3DFloat(-0.523240f, -0.572314f, +0.633778f), - Vector3DFloat(-0.524949f, -0.334574f, -0.326701f), - Vector3DFloat(+0.747673f, +0.725944f, +0.701651f), - Vector3DFloat(-0.500961f, +0.564867f, -0.902341f), - Vector3DFloat(+0.995422f, -0.245949f, +0.301065f), - Vector3DFloat(+0.655080f, -0.783380f, +0.835871f), - Vector3DFloat(+0.541795f, -0.693472f, -0.355083f), - Vector3DFloat(+0.891110f, +0.891171f, -0.891903f), - Vector3DFloat(+0.507675f, -0.949034f, -0.485214f), - Vector3DFloat(-0.116123f, +0.368999f, +0.514756f), - Vector3DFloat(-0.859432f, -0.525071f, +0.632008f), - Vector3DFloat(-0.707205f, +0.077914f, +0.930540f), - Vector3DFloat(-0.783380f, -0.577074f, -0.180212f), - Vector3DFloat(-0.047884f, -0.523789f, +0.471664f), - Vector3DFloat(-0.210791f, +0.904904f, -0.585864f), - Vector3DFloat(+0.132664f, +0.792230f, +0.707266f), - Vector3DFloat(-0.735710f, -0.263710f, -0.258827f), - Vector3DFloat(+0.912290f, +0.497421f, -0.518845f), - Vector3DFloat(-0.790521f, -0.707144f, +0.314982f), - Vector3DFloat(-0.799249f, +0.381207f, -0.756462f), - Vector3DFloat(+0.694998f, -0.521836f, +0.957213f), - Vector3DFloat(+0.310709f, +0.049837f, +0.920652f), - Vector3DFloat(+0.581530f, +0.164647f, +0.560900f), - Vector3DFloat(+0.406903f, -0.650563f, -0.674551f), - Vector3DFloat(-0.749016f, +0.119663f, -0.040193f), - Vector3DFloat(+0.955260f, -0.142552f, +0.175756f), - Vector3DFloat(-0.925108f, -0.970824f, -0.430952f), - Vector3DFloat(+0.666372f, +0.449507f, -0.801813f), - Vector3DFloat(-0.311991f, -0.079928f, -0.608142f), - Vector3DFloat(-0.344829f, +0.280862f, +0.800775f), - Vector3DFloat(-0.880123f, +0.318217f, -0.120212f), - Vector3DFloat(-0.146519f, +0.573412f, -0.358013f), - Vector3DFloat(+0.297220f, -0.889523f, +0.246620f), - Vector3DFloat(-0.628834f, -0.383404f, -0.630360f), - Vector3DFloat(-0.397382f, +0.547533f, -0.579150f), - Vector3DFloat(+0.758049f, +0.631947f, -0.916807f), - Vector3DFloat(-0.678030f, -0.606433f, -0.881527f), - Vector3DFloat(+0.213233f, +0.854060f, -0.043428f), - Vector3DFloat(+0.175085f, +0.139500f, -0.208472f), - Vector3DFloat(+0.983520f, -0.389386f, +0.178076f), - Vector3DFloat(+0.956603f, +0.696951f, -0.307657f), - Vector3DFloat(-0.276345f, +0.576220f, +0.182104f), - Vector3DFloat(+0.864742f, -0.657582f, +0.253639f), - Vector3DFloat(-0.275735f, -0.012177f, +0.306619f), - Vector3DFloat(-0.385235f, -0.881649f, +0.658071f), - Vector3DFloat(-0.117466f, -0.306681f, -0.235755f), - Vector3DFloat(+0.173254f, +0.685720f, +0.116733f), - Vector3DFloat(-0.641041f, +0.704642f, -0.585864f), - Vector3DFloat(+0.154820f, +0.999939f, -0.761345f), - Vector3DFloat(-0.726310f, +0.695181f, -0.490036f), - Vector3DFloat(-0.149510f, -0.593188f, -0.794122f), - Vector3DFloat(+0.798212f, +0.872555f, -0.361980f), - Vector3DFloat(+0.749687f, -0.931944f, +0.519211f), - Vector3DFloat(-0.151952f, -0.889096f, -0.313822f), - Vector3DFloat(-0.467879f, +0.289651f, -0.901242f), - Vector3DFloat(+0.522752f, +0.406781f, +0.157079f), - Vector3DFloat(+0.088534f, -0.421735f, -0.236122f), - Vector3DFloat(+0.722221f, -0.136692f, -0.292825f), - Vector3DFloat(-0.572436f, +0.349162f, +0.819697f), - Vector3DFloat(+0.252113f, +0.773614f, -0.299051f), - Vector3DFloat(-0.401410f, +0.400250f, -0.091037f), - Vector3DFloat(+0.449507f, +0.205115f, +0.075533f), - Vector3DFloat(+0.246803f, -0.197851f, -0.322123f), - Vector3DFloat(-0.822077f, +0.037263f, +0.157445f), - Vector3DFloat(+0.373455f, +0.983154f, -0.580920f), - Vector3DFloat(+0.201758f, -0.075289f, +0.514878f), - Vector3DFloat(+0.552477f, +0.760430f, +0.938963f), - Vector3DFloat(-0.297525f, -0.603504f, -0.285318f), - Vector3DFloat(-0.504257f, +0.135899f, +0.694021f), - Vector3DFloat(-0.701895f, +0.509140f, -0.768914f), - Vector3DFloat(+0.725639f, +0.083834f, -0.985961f), - Vector3DFloat(+0.617847f, -0.604114f, +0.976440f), - Vector3DFloat(-0.557115f, +0.562853f, +0.214087f), - Vector3DFloat(-0.480819f, -0.048738f, -0.759392f), - Vector3DFloat(-0.268105f, -0.168493f, -0.141881f), - Vector3DFloat(+0.664357f, -0.999207f, +0.486740f), - Vector3DFloat(-0.739128f, +0.089328f, +0.611194f), - Vector3DFloat(-0.355876f, +0.889523f, +0.701895f), - Vector3DFloat(-0.123692f, -0.252358f, -0.739250f), - Vector3DFloat(+0.405438f, -0.276772f, -0.896786f), - Vector3DFloat(-0.803644f, +0.517563f, -0.146886f), - Vector3DFloat(+0.647511f, +0.766289f, -0.811518f), - Vector3DFloat(-0.266457f, -0.779534f, +0.720634f), - Vector3DFloat(-0.643849f, -0.014130f, -0.345134f), - Vector3DFloat(-0.527390f, +0.047700f, -0.271340f), - Vector3DFloat(+0.993957f, -0.305643f, +0.841731f), - Vector3DFloat(+0.441816f, -0.849117f, -0.411664f), - Vector3DFloat(+0.303323f, -0.088473f, -0.677602f), - Vector3DFloat(+0.897824f, +0.203833f, +0.821039f), - Vector3DFloat(+0.468123f, +0.717338f, +0.338542f), - Vector3DFloat(-0.452986f, -0.830622f, -0.832942f), - Vector3DFloat(-0.245582f, -0.273171f, -0.820612f), - Vector3DFloat(-0.007660f, -0.799371f, +0.156896f), - Vector3DFloat(-0.022919f, +0.152013f, +0.614246f), - Vector3DFloat(-0.414045f, +0.637440f, -0.542711f), - Vector3DFloat(+0.453108f, -0.034516f, +0.330607f), - Vector3DFloat(+0.324015f, +0.689505f, +0.719108f), - Vector3DFloat(-0.236854f, +0.700491f, +0.276406f), - Vector3DFloat(-0.405316f, +0.871944f, +0.233863f), - Vector3DFloat(+0.898373f, +0.660756f, -0.914609f), - Vector3DFloat(+0.737114f, -0.179601f, -0.990539f), - Vector3DFloat(-0.536241f, -0.980712f, -0.352702f), - Vector3DFloat(+0.730094f, -0.970214f, -0.857967f), - Vector3DFloat(-0.194800f, -0.286782f, +0.604236f), - Vector3DFloat(+0.163366f, -0.441755f, -0.149022f), - Vector3DFloat(+0.457564f, +0.433149f, -0.626698f), - Vector3DFloat(+0.192846f, -0.909848f, +0.501572f), - Vector3DFloat(+0.444563f, -0.377789f, -0.545213f), - Vector3DFloat(-0.296670f, -0.809259f, +0.614246f), - Vector3DFloat(-0.068209f, +0.480148f, +0.537828f), - Vector3DFloat(+0.638173f, +0.371685f, -0.495956f), - Vector3DFloat(+0.798822f, +0.767510f, +0.516282f), - Vector3DFloat(-0.336161f, -0.035615f, +0.058687f), - Vector3DFloat(-0.888852f, -0.022370f, +0.215552f), - Vector3DFloat(-0.737541f, -0.977783f, -0.506638f), - Vector3DFloat(+0.471969f, +0.429670f, +0.668508f), - Vector3DFloat(+0.240394f, -0.212500f, -0.026215f), - Vector3DFloat(-0.916379f, -0.706229f, -0.593799f), - Vector3DFloat(-0.246681f, +0.919736f, -0.984741f), - Vector3DFloat(+0.291055f, -0.263771f, +0.703726f), - Vector3DFloat(-0.468245f, -0.062777f, +0.808527f), - Vector3DFloat(+0.661245f, +0.514817f, -0.715995f), - Vector3DFloat(-0.709830f, -0.580920f, +0.323710f), - Vector3DFloat(-0.463912f, -0.279092f, -0.101291f), - Vector3DFloat(-0.426252f, -0.292520f, -0.523057f), - Vector3DFloat(-0.285928f, -0.806574f, +0.701468f), - Vector3DFloat(-0.216468f, +0.385968f, +0.031953f), - Vector3DFloat(+0.737053f, +0.683767f, +0.684561f), - Vector3DFloat(+0.080172f, -0.063753f, +0.526902f), - Vector3DFloat(+0.414228f, +0.367351f, +0.884335f), - Vector3DFloat(-0.460677f, -0.048189f, -0.403851f), - Vector3DFloat(+0.973998f, +0.039399f, -0.148839f), - Vector3DFloat(+0.578539f, -0.651173f, +0.859432f), - Vector3DFloat(-0.172948f, +0.534593f, +0.255531f), - Vector3DFloat(+0.537584f, -0.570116f, +0.317606f), - Vector3DFloat(-0.380535f, +0.841548f, -0.274880f), - Vector3DFloat(+0.627247f, +0.655507f, -0.813532f), - Vector3DFloat(+0.288186f, +0.273171f, -0.674123f), - Vector3DFloat(-0.489303f, +0.828913f, +0.552599f), - Vector3DFloat(-0.541002f, +0.170019f, -0.242836f), - Vector3DFloat(+0.802972f, +0.340190f, +0.414716f), - Vector3DFloat(-0.997253f, -0.806635f, +0.588122f), - Vector3DFloat(+0.011017f, -0.599109f, -0.183325f), - Vector3DFloat(-0.871578f, -0.430708f, -0.042634f), - Vector3DFloat(+0.144627f, -0.921751f, +0.142003f), - Vector3DFloat(-0.695059f, -0.091037f, -0.647694f), - Vector3DFloat(-0.346477f, +0.663381f, -0.528977f), - Vector3DFloat(-0.194739f, +0.724967f, +0.615894f), - Vector3DFloat(+0.741874f, +0.720695f, -0.544847f), - Vector3DFloat(-0.984863f, +0.715445f, +0.461287f), - Vector3DFloat(-0.277871f, +0.329936f, +0.678091f), - Vector3DFloat(+0.090854f, +0.565905f, -0.254250f), - Vector3DFloat(-0.844050f, +0.781915f, -0.783929f), - Vector3DFloat(+0.332377f, -0.336528f, +0.820673f), - Vector3DFloat(-0.673391f, +0.589953f, -0.685598f), - Vector3DFloat(+0.022370f, +0.979980f, +0.686453f), - Vector3DFloat(-0.640065f, +0.369488f, +0.022919f), - Vector3DFloat(+0.699088f, -0.286355f, +0.684378f), - Vector3DFloat(-0.702139f, -0.827754f, +0.528367f), - Vector3DFloat(+0.150365f, -0.669851f, -0.695486f), - Vector3DFloat(+0.885617f, +0.492416f, -0.964599f), - Vector3DFloat(-0.923643f, -0.338847f, -0.369060f), - Vector3DFloat(+0.009064f, +0.632435f, +0.628956f), - Vector3DFloat(+0.620411f, +0.959777f, -0.769890f), - Vector3DFloat(+0.865413f, +0.685659f, -0.149327f), - Vector3DFloat(-0.933042f, +0.517258f, +0.168493f), - Vector3DFloat(+0.309732f, +0.299417f, +0.995361f), - Vector3DFloat(+0.196814f, -0.128025f, +0.565233f), - Vector3DFloat(-0.343669f, +0.889157f, +0.616688f), - Vector3DFloat(-0.676870f, +0.035432f, +0.906430f), - Vector3DFloat(-0.238868f, +0.320475f, -0.307596f), - Vector3DFloat(+0.164159f, +0.774468f, +0.502792f), - Vector3DFloat(+0.733146f, +0.517563f, +0.572741f), - Vector3DFloat(+0.676931f, -0.930235f, +0.231056f), - Vector3DFloat(-0.640370f, +0.241127f, -0.518479f), - Vector3DFloat(-0.953795f, +0.673086f, -0.706656f), - Vector3DFloat(+0.538621f, -0.340495f, +0.202124f), - Vector3DFloat(+0.431501f, +0.452315f, +0.422651f), - Vector3DFloat(+0.935606f, -0.442793f, -0.087191f), - Vector3DFloat(-0.921873f, -0.794733f, -0.003388f), - Vector3DFloat(+0.978576f, +0.342814f, -0.813898f), - Vector3DFloat(-0.750969f, +0.077853f, -0.849117f), - Vector3DFloat(+0.416120f, +0.678030f, +0.187475f), - Vector3DFloat(+0.370342f, -0.101901f, -0.544053f), - Vector3DFloat(+0.248512f, +0.803766f, -0.654042f), - Vector3DFloat(-0.925230f, +0.883480f, +0.287698f), - Vector3DFloat(-0.861873f, -0.263771f, +0.476730f), - Vector3DFloat(-0.298868f, -0.459517f, +0.932798f), - Vector3DFloat(+0.680532f, +0.697928f, +0.761162f), - Vector3DFloat(-0.466964f, -0.590625f, +0.972716f), - Vector3DFloat(+0.400067f, -0.316507f, +0.385418f), - Vector3DFloat(-0.123814f, -0.144444f, -0.161290f), - Vector3DFloat(-0.703726f, +0.189489f, +0.250099f), - Vector3DFloat(-0.766533f, -0.369854f, +0.871395f), - Vector3DFloat(-0.561205f, -0.891415f, +0.247658f), - Vector3DFloat(+0.590991f, +0.661489f, -0.996887f), - Vector3DFloat(-0.244667f, +0.857723f, +0.402692f), - Vector3DFloat(-0.574572f, -0.257790f, +0.561449f), - Vector3DFloat(+0.020600f, -0.784173f, -0.057711f), - Vector3DFloat(+0.735954f, +0.708487f, +0.913022f), - Vector3DFloat(-0.615101f, -0.643666f, +0.350017f), - Vector3DFloat(+0.436933f, +0.596423f, +0.985412f), - Vector3DFloat(-0.167577f, +0.400555f, +0.914670f), - Vector3DFloat(-0.920896f, -0.621570f, -0.637074f), - Vector3DFloat(-0.020356f, -0.234657f, +0.460860f), - Vector3DFloat(+0.336650f, -0.537767f, +0.907712f), - Vector3DFloat(-0.138768f, +0.860653f, +0.093661f), - Vector3DFloat(-0.733512f, -0.564196f, -0.046724f), - Vector3DFloat(+0.058260f, -0.429060f, +0.150792f), - Vector3DFloat(+0.255837f, -0.187780f, +0.312601f), - Vector3DFloat(-0.050081f, +0.680105f, -0.609485f), - Vector3DFloat(+0.075411f, +0.016511f, -0.127293f), - Vector3DFloat(-0.735710f, -0.787957f, +0.992248f), - Vector3DFloat(-0.191931f, +0.812311f, +0.681692f), - Vector3DFloat(-0.284402f, -0.177160f, -0.533128f), - Vector3DFloat(+0.859432f, +0.042940f, +0.404096f), - Vector3DFloat(+0.599841f, +0.131260f, +0.313028f), - Vector3DFloat(-0.955809f, -0.792474f, +0.086947f), - Vector3DFloat(-0.980712f, -0.525498f, -0.539598f), - Vector3DFloat(-0.877377f, -0.748222f, +0.590320f), - Vector3DFloat(-0.822443f, -0.733634f, -0.529588f), - Vector3DFloat(+0.379620f, -0.710013f, +0.038484f), - Vector3DFloat(-0.826472f, -0.831050f, -0.645436f), - Vector3DFloat(+0.160131f, -0.977050f, -0.502609f), - Vector3DFloat(-0.818964f, +0.921567f, -0.011261f), - Vector3DFloat(+0.932005f, -0.364727f, +0.023103f), - Vector3DFloat(-0.923826f, -0.862300f, +0.680410f), - Vector3DFloat(-0.298379f, +0.196936f, -0.486618f), - Vector3DFloat(-0.281411f, -0.045747f, -0.252602f), - Vector3DFloat(+0.706534f, +0.296976f, +0.672292f), - Vector3DFloat(-0.543077f, +0.319376f, +0.238075f), - Vector3DFloat(-0.501938f, +0.067293f, +0.119602f), - Vector3DFloat(-0.740287f, -0.783197f, +0.407514f), - Vector3DFloat(-0.933470f, -0.855098f, -0.503952f), - Vector3DFloat(-0.574877f, -0.533067f, +0.525437f), - Vector3DFloat(+0.785394f, -0.262612f, +0.571642f), - Vector3DFloat(-0.659108f, -0.811396f, +0.264138f), - Vector3DFloat(+0.926695f, -0.963622f, +0.121372f), - Vector3DFloat(+0.505661f, -0.209815f, -0.439131f), - Vector3DFloat(-0.433882f, +0.026887f, +0.928953f), - Vector3DFloat(-0.771599f, +0.737785f, -0.288003f), - Vector3DFloat(-0.894406f, +0.505905f, +0.971068f), - Vector3DFloat(+0.350383f, +0.570421f, -0.211646f), - Vector3DFloat(+0.644093f, -0.882748f, -0.131382f), - Vector3DFloat(+0.225745f, +0.948973f, -0.488327f), - Vector3DFloat(+0.277810f, -0.337748f, +0.322672f), - Vector3DFloat(-0.686514f, +0.185766f, +0.752129f), - Vector3DFloat(+0.350566f, +0.122959f, +0.722526f), - Vector3DFloat(-0.687002f, +0.955260f, -0.955687f), - Vector3DFloat(+0.958983f, -0.019074f, -0.317118f), - Vector3DFloat(+0.076937f, -0.015839f, -0.772027f), - Vector3DFloat(+0.899777f, -0.224647f, +0.174230f), - Vector3DFloat(+0.805719f, -0.288797f, +0.742119f), - Vector3DFloat(+0.964904f, -0.322794f, +0.416486f), - Vector3DFloat(-0.485641f, -0.559130f, -0.500168f), - Vector3DFloat(+0.310282f, +0.408185f, -0.946471f), - Vector3DFloat(-0.279031f, +0.645131f, -0.118259f), - Vector3DFloat(+0.780694f, -0.650136f, -0.433943f), - Vector3DFloat(+0.981262f, +0.039521f, -0.532395f), - Vector3DFloat(+0.830866f, +0.430769f, -0.333293f), - Vector3DFloat(-0.462081f, -0.872799f, -0.070711f), - Vector3DFloat(+0.276894f, -0.418683f, -0.198767f), - Vector3DFloat(+0.217750f, +0.312662f, -0.725211f), - Vector3DFloat(-0.193091f, -0.522752f, -0.901486f), - Vector3DFloat(+0.040071f, -0.307291f, +0.622669f), - Vector3DFloat(-0.788446f, -0.817438f, -0.566027f), - Vector3DFloat(-0.947508f, -0.519822f, +0.143468f), - Vector3DFloat(-0.072970f, -0.580920f, +0.925230f), - Vector3DFloat(-0.072359f, +0.954772f, +0.980163f), - Vector3DFloat(+0.954344f, -0.229774f, -0.562059f), - Vector3DFloat(+0.095004f, +0.123020f, +0.103366f), - Vector3DFloat(+0.784478f, -0.571764f, +0.774529f), - Vector3DFloat(-0.113498f, -0.852229f, +0.422468f), - Vector3DFloat(-0.128941f, -0.637196f, -0.590869f), - Vector3DFloat(+0.603259f, -0.670766f, +0.303201f), - Vector3DFloat(+0.693960f, +0.278542f, +0.171422f), - Vector3DFloat(+0.801813f, +0.236671f, +0.195227f), - Vector3DFloat(-0.193823f, +0.684072f, -0.594714f), - Vector3DFloat(+0.715201f, +0.750725f, +0.591479f), - Vector3DFloat(+0.698782f, +0.073214f, +0.106052f), - Vector3DFloat(+0.803522f, -0.470809f, +0.279763f), - Vector3DFloat(+0.099704f, +0.861385f, -0.397687f), - Vector3DFloat(+0.230506f, -0.993286f, +0.054292f), - Vector3DFloat(-0.292398f, +0.585376f, +0.762139f), - Vector3DFloat(-0.168004f, +0.731132f, -0.020051f), - Vector3DFloat(+0.577441f, +0.205359f, +0.703848f), - Vector3DFloat(-0.869076f, +0.873653f, -0.802301f), - Vector3DFloat(+0.697256f, +0.399335f, +0.842708f), - Vector3DFloat(-0.590258f, -0.620777f, -0.628040f), - Vector3DFloat(-0.048982f, +0.759697f, -0.957335f), - Vector3DFloat(+0.026582f, +0.696402f, -0.537645f), - Vector3DFloat(+0.919431f, +0.040254f, +0.931394f), - Vector3DFloat(+0.308512f, +0.591052f, -0.194739f), - Vector3DFloat(-0.934202f, +0.307718f, -0.688894f), - Vector3DFloat(-0.285318f, +0.460860f, +0.757012f), - Vector3DFloat(+0.048799f, -0.720389f, +0.325968f), - Vector3DFloat(-0.202246f, +0.068697f, +0.641407f), - Vector3DFloat(-0.566088f, +0.523301f, +0.857295f), - Vector3DFloat(+0.040193f, -0.036836f, +0.699881f), - Vector3DFloat(-0.789422f, -0.195959f, -0.217505f), - Vector3DFloat(-0.836665f, +0.293741f, +0.418867f), - Vector3DFloat(+0.489486f, +0.954344f, +0.486007f), - Vector3DFloat(-0.755913f, -0.485153f, +0.253822f), - Vector3DFloat(+0.823420f, -0.565722f, -0.393353f), - Vector3DFloat(-0.817560f, +0.851436f, -0.368755f), - Vector3DFloat(+0.004791f, -0.474899f, -0.299417f), - Vector3DFloat(-0.012726f, +0.620289f, -0.555773f), - Vector3DFloat(+0.197058f, -0.916318f, -0.469466f), - Vector3DFloat(+0.243812f, +0.820734f, -0.694021f), - Vector3DFloat(-0.896359f, -0.753716f, -0.676321f), - Vector3DFloat(-0.761589f, -0.936033f, -0.154149f), - Vector3DFloat(+0.821528f, +0.641224f, -0.188025f), - Vector3DFloat(+0.799432f, +0.168981f, +0.571520f), - Vector3DFloat(+0.309793f, -0.181005f, -0.565416f), - Vector3DFloat(+0.211890f, -0.153539f, -0.473312f), - Vector3DFloat(+0.284097f, +0.968444f, -0.005829f), - Vector3DFloat(+0.835994f, +0.087374f, -0.599780f), - Vector3DFloat(+0.068270f, -0.178930f, -0.439741f), - Vector3DFloat(-0.455611f, +0.404218f, -0.862911f), - Vector3DFloat(+0.754143f, +0.197058f, +0.762749f), - Vector3DFloat(+0.053499f, -0.794549f, -0.285257f), - Vector3DFloat(+0.176916f, +0.163121f, -0.941954f), - Vector3DFloat(-0.102817f, -0.446944f, +0.830195f), - Vector3DFloat(+0.970824f, -0.484848f, -0.661977f), - Vector3DFloat(-0.561998f, -0.377544f, -0.955321f), - Vector3DFloat(-0.434980f, +0.501022f, +0.627186f), - Vector3DFloat(-0.828120f, +0.591540f, +0.701895f), - Vector3DFloat(-0.327555f, +0.628346f, -0.159581f), - Vector3DFloat(-0.082980f, -0.308084f, -0.077731f), - Vector3DFloat(+0.858150f, -0.706473f, +0.886532f), - Vector3DFloat(+0.526475f, +0.001373f, +0.438276f), - Vector3DFloat(-0.594958f, +0.084994f, -0.935057f), - Vector3DFloat(+0.783746f, -0.501877f, -0.797052f), - Vector3DFloat(-0.835566f, -0.808405f, +0.956359f), - Vector3DFloat(+0.380169f, +0.184118f, +0.857540f), - Vector3DFloat(+0.647206f, +0.652089f, -0.895383f), - Vector3DFloat(-0.421369f, -0.038667f, +0.500046f), - Vector3DFloat(-0.478133f, +0.447432f, +0.981750f), - Vector3DFloat(+0.593921f, -0.330485f, -0.966674f), - Vector3DFloat(-0.811823f, +0.928892f, -0.741935f), - Vector3DFloat(+0.115879f, -0.490707f, -0.080355f), - Vector3DFloat(+0.443159f, +0.030061f, -0.465560f), - Vector3DFloat(+0.013703f, -0.765435f, -0.311502f), - Vector3DFloat(+0.698782f, -0.612903f, +0.660207f), - Vector3DFloat(+0.341227f, -0.746940f, +0.284341f), - Vector3DFloat(-0.005036f, -0.863460f, -0.168432f), - Vector3DFloat(-0.434370f, -0.629933f, +0.545152f), - Vector3DFloat(-0.570544f, +0.023591f, +0.072970f), - Vector3DFloat(+0.709830f, +0.603626f, +0.031831f), - Vector3DFloat(-0.148961f, +0.783807f, -0.292154f), - Vector3DFloat(+0.088107f, -0.467818f, +0.319498f), - Vector3DFloat(+0.976623f, -0.185339f, +0.274087f), - Vector3DFloat(+0.770867f, +0.267861f, -0.022004f), - Vector3DFloat(-0.245338f, +0.171056f, -0.720389f), - Vector3DFloat(-0.909299f, +0.616993f, -0.950926f), - Vector3DFloat(+0.050935f, -0.842341f, -0.519944f), - Vector3DFloat(+0.646779f, +0.560839f, +0.129673f), - Vector3DFloat(-0.171361f, -0.501328f, -0.762749f), - Vector3DFloat(-0.374065f, -0.905209f, -0.561144f), - Vector3DFloat(-0.811029f, -0.510483f, -0.757073f), - Vector3DFloat(-0.905332f, -0.027924f, -0.263649f), - Vector3DFloat(-0.828730f, -0.067721f, -0.295206f), - Vector3DFloat(-0.538133f, +0.242714f, +0.914914f), - Vector3DFloat(-0.657949f, -0.732658f, -0.743584f), - Vector3DFloat(+0.837214f, -0.077181f, +0.767449f), - Vector3DFloat(+0.174047f, +0.397687f, +0.602405f), - Vector3DFloat(-0.256996f, +0.911435f, -0.927915f), - Vector3DFloat(+0.282754f, +0.500900f, +0.510178f), - Vector3DFloat(+0.849971f, +0.652821f, +0.002838f), - Vector3DFloat(-1.000000f, -0.103305f, -0.548814f), - Vector3DFloat(-0.673208f, -0.734489f, +0.204749f), - Vector3DFloat(-0.235511f, -0.977477f, -0.771538f), - Vector3DFloat(+0.294412f, +0.173009f, -0.075533f), - Vector3DFloat(-0.339946f, -0.970946f, -0.443525f), - Vector3DFloat(-0.016144f, -0.066134f, -0.394635f), - Vector3DFloat(-0.627003f, +0.683401f, -0.967101f), - Vector3DFloat(-0.217994f, -0.777642f, -0.404584f), - Vector3DFloat(+0.123447f, -0.590747f, +0.507614f), - Vector3DFloat(+0.648610f, +0.006806f, -0.677969f), - Vector3DFloat(+0.006561f, +0.662648f, -0.236305f), - Vector3DFloat(+0.658132f, +0.166173f, -0.283975f), - Vector3DFloat(-0.098178f, +0.665273f, -0.068636f), - Vector3DFloat(-0.091891f, +0.319620f, +0.058870f), - Vector3DFloat(+0.922666f, +0.077731f, +0.399701f), - Vector3DFloat(-0.007050f, +0.772942f, -0.957945f), - Vector3DFloat(-0.456832f, -0.293313f, +0.437300f), - Vector3DFloat(+0.917173f, -0.542100f, +0.909665f), - Vector3DFloat(-0.711722f, -0.917356f, +0.513169f), - Vector3DFloat(-0.032624f, +0.808100f, +0.354472f), - Vector3DFloat(-0.526597f, -0.049409f, +0.691702f), - Vector3DFloat(-0.073946f, +0.923521f, -0.389813f), - Vector3DFloat(+0.172216f, +0.642140f, -0.302896f), - Vector3DFloat(-0.660024f, +0.381329f, -0.833064f), - Vector3DFloat(+0.622791f, -0.809076f, +0.557787f), - Vector3DFloat(+0.609790f, +0.897702f, +0.998352f), - Vector3DFloat(-0.084384f, +0.169042f, -0.596667f), - Vector3DFloat(-0.315470f, -0.014618f, -0.640187f), - Vector3DFloat(+0.275552f, -0.199438f, -0.759941f), - Vector3DFloat(-0.615223f, -0.960021f, +0.367901f), - Vector3DFloat(+0.819514f, -0.787225f, +0.627308f), - Vector3DFloat(+0.083834f, -0.836299f, +0.926450f), - Vector3DFloat(-0.420637f, -0.047273f, +0.370281f), - Vector3DFloat(-0.097629f, -0.240577f, -0.594836f), - Vector3DFloat(+0.085604f, +0.385601f, -0.121189f), - Vector3DFloat(+0.968444f, -0.255104f, +0.021027f), - Vector3DFloat(+0.152440f, -0.450484f, +0.971496f), - Vector3DFloat(-0.095737f, +0.395672f, -0.605213f), - Vector3DFloat(+0.949278f, -0.284951f, +0.875118f), - Vector3DFloat(+0.787286f, +0.580248f, +0.494613f), - Vector3DFloat(+0.225990f, -0.455123f, +0.239540f), - Vector3DFloat(+0.630238f, -0.251747f, -0.617725f), - Vector3DFloat(+0.940733f, -0.390484f, +0.394024f), - Vector3DFloat(+0.197851f, -0.276345f, -0.893368f), - Vector3DFloat(-0.240883f, +0.349651f, -0.922178f), - Vector3DFloat(-0.037080f, -0.609119f, -0.018342f), - Vector3DFloat(-0.787042f, +0.624500f, -0.274880f), - Vector3DFloat(-0.536485f, +0.989746f, -0.400128f), - Vector3DFloat(+0.963988f, +0.006012f, +0.323649f), - Vector3DFloat(-0.501022f, -0.791864f, +0.514817f), - Vector3DFloat(-0.126316f, -0.782769f, +0.155553f), - Vector3DFloat(-0.254921f, +0.828547f, -0.173925f), - Vector3DFloat(-0.321512f, -0.180822f, +0.603198f), - Vector3DFloat(+0.733757f, -0.407514f, +0.170385f), - Vector3DFloat(-0.741691f, -0.322611f, -0.070956f), - Vector3DFloat(-0.025300f, +0.454329f, -0.889767f), - Vector3DFloat(+0.024751f, +0.133518f, -0.246498f), - Vector3DFloat(+0.545701f, -0.260842f, +0.869747f), - Vector3DFloat(+0.082247f, -0.579638f, -0.885495f), - Vector3DFloat(-0.000885f, -0.834346f, +0.040254f), - Vector3DFloat(-0.211097f, -0.059297f, +0.747856f), - Vector3DFloat(-0.829646f, +0.475753f, +0.527451f), - Vector3DFloat(+0.409162f, -0.167882f, -0.177099f), - Vector3DFloat(-0.319865f, -0.205664f, -0.130222f), - Vector3DFloat(+0.962523f, -0.992615f, +0.062655f), - Vector3DFloat(+0.849361f, -0.935301f, +0.394024f), - Vector3DFloat(+0.373699f, -0.148350f, +0.208594f), - Vector3DFloat(+0.639332f, +0.220557f, -0.277444f), - Vector3DFloat(+0.880734f, +0.209937f, -0.576708f), - Vector3DFloat(+0.342814f, +0.416364f, -0.832453f), - Vector3DFloat(+0.594958f, +0.479843f, -0.306070f), - Vector3DFloat(+0.335002f, -0.107334f, +0.784173f), - Vector3DFloat(+0.395917f, +0.763604f, +0.866756f), - Vector3DFloat(-0.507553f, +0.148717f, -0.436750f), - Vector3DFloat(-0.780450f, -0.599048f, -0.146031f), - Vector3DFloat(-0.841304f, -0.712577f, -0.329997f), - Vector3DFloat(+0.524033f, +0.033845f, +0.057100f), - Vector3DFloat(-0.976562f, -0.066866f, +0.026887f), - Vector3DFloat(-0.469405f, -0.094394f, +0.398175f), - Vector3DFloat(+0.238685f, -0.750237f, +0.156713f), - Vector3DFloat(+0.000702f, +0.617298f, -0.206397f), - Vector3DFloat(-0.228553f, +0.562548f, -0.719840f), - Vector3DFloat(-0.939451f, -0.698782f, +0.688162f), - Vector3DFloat(+0.637623f, +0.149022f, -0.536058f), - Vector3DFloat(-0.814386f, +0.379315f, +0.647145f), - Vector3DFloat(+0.523179f, -0.820368f, +0.386517f), - Vector3DFloat(+0.146092f, +0.999146f, +0.227332f), - Vector3DFloat(-0.366924f, -0.211707f, +0.274697f), - Vector3DFloat(+0.751640f, +0.136509f, +0.662648f), - Vector3DFloat(+0.657888f, +0.102695f, +0.022736f), - Vector3DFloat(+0.861019f, -0.535813f, +0.561449f), - Vector3DFloat(+0.766839f, +0.006317f, +0.681204f), - Vector3DFloat(+0.596301f, +0.671255f, -0.933470f), - Vector3DFloat(+0.776910f, -0.313211f, -0.353923f), - Vector3DFloat(+0.266213f, +0.215796f, +0.026093f), - Vector3DFloat(-0.648732f, +0.907407f, -0.755425f), - Vector3DFloat(-0.585498f, -0.234535f, -0.085421f), - Vector3DFloat(-0.490890f, +0.657582f, +0.242897f), - Vector3DFloat(+0.913450f, +0.066622f, -0.220252f), - Vector3DFloat(+0.121067f, +0.658193f, -0.645314f), - Vector3DFloat(+0.367779f, +0.941588f, +0.618702f), - Vector3DFloat(-0.320231f, +0.354900f, -0.653005f), - Vector3DFloat(+0.540147f, -0.212317f, +0.559374f), - Vector3DFloat(+0.715812f, -0.211951f, +0.078646f), - Vector3DFloat(-0.711051f, +0.598132f, -0.708914f), - Vector3DFloat(+0.029756f, +0.324809f, +0.014924f), - Vector3DFloat(-0.106418f, +0.386090f, +0.596301f), - Vector3DFloat(-0.317179f, -0.068880f, -0.315165f), - Vector3DFloat(+0.860164f, -0.772881f, -0.158788f), - Vector3DFloat(-0.326640f, -0.304239f, +0.445906f), - Vector3DFloat(+0.621265f, -0.815729f, +0.129429f), - Vector3DFloat(+0.687063f, -0.052767f, -0.969481f), - Vector3DFloat(-0.800043f, -0.598621f, +0.764702f), - Vector3DFloat(-0.518052f, -0.221534f, -0.066256f), - Vector3DFloat(+0.164953f, +0.886898f, +0.954100f), - Vector3DFloat(-0.384808f, -0.641102f, -1.000000f), - Vector3DFloat(+0.299051f, +0.218360f, +0.561205f), - Vector3DFloat(-0.419050f, +0.324992f, -0.161779f), - Vector3DFloat(-0.403241f, -0.176305f, +0.442976f), - Vector3DFloat(+0.262001f, +0.042817f, -0.818842f), - Vector3DFloat(+0.740410f, +0.888852f, -0.281716f), - Vector3DFloat(-0.853084f, +0.886227f, -0.736442f), - Vector3DFloat(-0.666616f, +0.555956f, +0.477950f), - Vector3DFloat(-0.714164f, +0.112156f, -0.032197f), - Vector3DFloat(+0.142674f, -0.842341f, +0.199744f), - Vector3DFloat(-0.305948f, -0.295999f, +0.131504f), - Vector3DFloat(+0.667470f, -0.966674f, +0.728629f), - Vector3DFloat(+0.122166f, +0.928281f, -0.725028f), - Vector3DFloat(-0.236854f, -0.756096f, +0.374798f), - Vector3DFloat(+0.035432f, -0.423505f, -0.663747f), - Vector3DFloat(+0.051973f, -0.510910f, +0.716849f), - Vector3DFloat(+0.540208f, -0.821711f, +0.055757f), - Vector3DFloat(+0.699149f, +0.988098f, +0.326579f), - Vector3DFloat(+0.108188f, -0.867367f, +0.668996f), - Vector3DFloat(+0.077181f, -0.738884f, +0.103671f), - Vector3DFloat(-0.467391f, +0.957335f, -0.194494f), - Vector3DFloat(+0.123386f, +0.893674f, -0.523118f), - Vector3DFloat(-0.151036f, +0.955809f, +0.199622f), - Vector3DFloat(+0.075411f, +0.726493f, -0.363994f), - Vector3DFloat(+0.224647f, -0.208960f, +0.242531f), - Vector3DFloat(+0.993591f, +0.751213f, -0.535203f), - Vector3DFloat(+0.308512f, +0.990905f, -0.197241f), - Vector3DFloat(+0.292886f, +0.536180f, +0.191748f), - Vector3DFloat(+0.489853f, -0.461531f, +0.351665f), - Vector3DFloat(-0.329447f, +0.531602f, +0.216834f), - Vector3DFloat(-0.809320f, +0.675649f, +0.516037f), - Vector3DFloat(+0.565172f, -0.661184f, +0.359111f), - Vector3DFloat(-0.039460f, +0.110080f, +0.978698f), - Vector3DFloat(+0.885372f, -0.763787f, +0.145726f), - Vector3DFloat(+0.006195f, +0.231117f, +0.417585f), - Vector3DFloat(-0.566027f, +0.179846f, -0.010407f), - Vector3DFloat(-0.879391f, +0.940123f, +0.163305f), - Vector3DFloat(+0.490646f, +0.391949f, +0.415998f), - Vector3DFloat(-0.973815f, +0.550096f, +0.710868f), - Vector3DFloat(+0.643544f, +0.763543f, +0.160375f), - Vector3DFloat(-0.832759f, +0.150792f, -0.602466f), - Vector3DFloat(-0.564745f, -0.121982f, +0.213172f), - Vector3DFloat(-0.775750f, +0.120640f, +0.703970f), - Vector3DFloat(+0.952208f, -0.233375f, +0.984619f), - Vector3DFloat(+0.330241f, +0.344707f, -0.002472f), - Vector3DFloat(-0.601489f, +0.772454f, +0.954527f), - Vector3DFloat(-0.605335f, +0.422590f, -0.629261f), - Vector3DFloat(+0.199011f, +0.389996f, -0.293069f), - Vector3DFloat(-0.664479f, +0.964110f, -0.223731f), - Vector3DFloat(-0.477340f, +0.905515f, +0.378521f), - Vector3DFloat(-0.366741f, +0.233497f, +0.181860f), - Vector3DFloat(-0.438826f, -0.664724f, +0.521653f), - Vector3DFloat(-0.298990f, +0.153844f, -0.795587f), - Vector3DFloat(+0.679983f, -0.192114f, +0.451033f), - Vector3DFloat(-0.630360f, +0.283303f, +0.892270f), - Vector3DFloat(+0.940489f, +0.396222f, +0.550890f), - Vector3DFloat(-0.448653f, +0.065889f, -0.753105f), - Vector3DFloat(+0.712821f, +0.740410f, +0.025178f), - Vector3DFloat(-0.862606f, +0.692923f, +0.973937f), - Vector3DFloat(-0.583789f, +0.849544f, -0.579455f), - Vector3DFloat(+0.640675f, +0.542711f, +0.062960f), - Vector3DFloat(-0.916196f, +0.493881f, +0.192602f), - Vector3DFloat(+0.270119f, +0.636525f, +0.380108f), - Vector3DFloat(-0.297952f, -0.165502f, +0.871578f), - Vector3DFloat(-0.731132f, -0.883175f, +0.756951f), - Vector3DFloat(+0.373760f, +0.645436f, -0.736503f), - Vector3DFloat(-0.289407f, +0.663259f, +0.329142f), - Vector3DFloat(+0.544115f, +0.908933f, -0.156713f), - Vector3DFloat(+0.780816f, +0.264870f, -0.632984f), - Vector3DFloat(-0.935667f, +0.959899f, -0.686148f), - Vector3DFloat(+0.121250f, -0.882687f, -0.204260f), - Vector3DFloat(-0.002106f, -0.032807f, -0.532334f), - Vector3DFloat(+0.334208f, -0.147862f, -0.719474f), - Vector3DFloat(-0.956114f, +0.622791f, -0.764702f), - Vector3DFloat(+0.482162f, -0.907651f, +0.396100f), - Vector3DFloat(-0.477645f, +0.710196f, -0.589221f), - Vector3DFloat(-0.374676f, -0.293008f, -0.738578f), - Vector3DFloat(+0.273232f, -0.007050f, +0.227454f), - Vector3DFloat(-0.634449f, -0.640675f, -0.644276f), - Vector3DFloat(-0.173315f, +0.852840f, -0.000580f), - Vector3DFloat(+0.258766f, +0.261086f, -0.720450f), - Vector3DFloat(+0.048921f, +0.562609f, +0.668569f), - Vector3DFloat(+0.072970f, -0.296182f, -0.753594f), - Vector3DFloat(+0.409528f, -0.742302f, -0.429365f), - Vector3DFloat(-0.551012f, +0.193579f, -0.672414f), - Vector3DFloat(-0.698111f, -0.188940f, +0.302896f), - Vector3DFloat(-0.176366f, +0.111606f, +0.180273f), - Vector3DFloat(-0.273537f, -0.817988f, -0.519028f), - Vector3DFloat(+0.742546f, -0.983154f, -0.585864f), - Vector3DFloat(-0.631031f, +0.641469f, +0.681936f), - Vector3DFloat(+0.181127f, +0.238929f, -0.851680f), - Vector3DFloat(-0.075655f, -0.175085f, +0.213904f), - Vector3DFloat(-0.554369f, -0.458724f, -0.080172f), - Vector3DFloat(-0.326273f, +0.086398f, -0.203162f), - Vector3DFloat(+0.905332f, +0.605762f, +0.191443f), - Vector3DFloat(-0.920835f, -0.636525f, -0.977844f), - Vector3DFloat(-0.552110f, +0.156102f, +0.504135f), - Vector3DFloat(-0.243934f, +0.970763f, -0.160070f), - Vector3DFloat(+0.418195f, -0.050996f, +0.090060f), - Vector3DFloat(+0.875729f, -0.335307f, +0.542589f), - Vector3DFloat(-0.873226f, -0.135777f, +0.750908f), - Vector3DFloat(+0.086032f, -0.780999f, +0.032624f), - Vector3DFloat(-0.929746f, +0.173376f, -0.738212f), - Vector3DFloat(+0.665639f, -0.140172f, +0.821223f), - Vector3DFloat(-0.977416f, +0.008698f, +0.739372f), - Vector3DFloat(-0.899045f, +0.494980f, -0.542833f), - Vector3DFloat(+0.395062f, -0.662465f, +0.553148f), - Vector3DFloat(-0.157689f, +0.970824f, +0.186377f), - Vector3DFloat(+0.969970f, -0.372051f, +0.728263f), - Vector3DFloat(+0.902463f, +0.860225f, -0.170141f), - Vector3DFloat(+0.539415f, +0.112949f, -0.387066f), - Vector3DFloat(-0.530259f, +0.773553f, -0.593554f), - Vector3DFloat(-0.626392f, +0.377483f, +0.141209f), - Vector3DFloat(-0.949278f, -0.859554f, -0.846858f), - Vector3DFloat(-0.942442f, +0.152562f, -0.463973f), - Vector3DFloat(-0.897763f, -0.911557f, +0.570482f), - Vector3DFloat(+0.317179f, -0.045076f, -0.960204f), - Vector3DFloat(+0.895077f, -0.314066f, +0.184240f), - Vector3DFloat(-0.744621f, -0.192602f, -0.536485f), - Vector3DFloat(-0.266274f, +0.682974f, -0.871090f), - Vector3DFloat(-0.809748f, -0.032258f, +0.273232f), - Vector3DFloat(-0.124363f, -0.786309f, +0.657216f), - Vector3DFloat(-0.726981f, -0.371563f, -0.172521f), - Vector3DFloat(+0.812860f, -0.024384f, +0.532212f), - Vector3DFloat(+0.523545f, -0.821589f, -0.509934f), - Vector3DFloat(+0.236671f, +0.420148f, -0.802911f), - Vector3DFloat(+0.093783f, -0.909177f, -0.071932f), - Vector3DFloat(+0.262429f, +0.728141f, -0.095798f), - Vector3DFloat(+0.717826f, +0.067171f, -0.797784f), - Vector3DFloat(-0.413678f, +0.049593f, -0.137364f), - Vector3DFloat(-0.334391f, +0.978515f, +0.529893f), - Vector3DFloat(-0.559862f, +0.913511f, +0.188513f), - Vector3DFloat(-0.644642f, -0.352214f, +0.085849f), - Vector3DFloat(-0.257302f, +0.108371f, -0.744804f), - Vector3DFloat(-0.676015f, +0.866207f, -0.834712f), - Vector3DFloat(-0.021882f, -0.053072f, -0.795160f), - Vector3DFloat(-0.219214f, +0.475448f, -0.291055f), - Vector3DFloat(-0.698721f, -0.089816f, -0.867977f), - Vector3DFloat(-0.297403f, +0.136876f, +0.832881f), - Vector3DFloat(+0.438887f, +0.468001f, -0.946959f), - Vector3DFloat(+0.638905f, +0.782952f, -0.127903f), - Vector3DFloat(+0.363811f, -0.358745f, +0.460494f), - Vector3DFloat(+0.320109f, -0.028047f, -0.223365f), - Vector3DFloat(-0.274758f, -0.139256f, +0.302469f), - Vector3DFloat(-0.943297f, -0.316263f, +0.749382f), - Vector3DFloat(+0.863704f, -0.867183f, -0.148473f), - Vector3DFloat(+0.030122f, +0.751030f, -0.963439f), - Vector3DFloat(-0.818232f, -0.299966f, +0.403485f), - Vector3DFloat(-0.841548f, +0.378826f, -0.981689f), - Vector3DFloat(+0.927671f, +0.527696f, +0.309549f), - Vector3DFloat(+0.521897f, +0.299844f, -0.545579f), - Vector3DFloat(+0.324992f, +0.310648f, +0.759880f), - Vector3DFloat(+0.599170f, -0.695303f, +0.165380f), - Vector3DFloat(+0.708914f, +0.528916f, -0.764336f), - Vector3DFloat(+0.059297f, -0.576586f, +0.825312f), - Vector3DFloat(+0.139805f, +0.627247f, -0.101657f), - Vector3DFloat(+0.805414f, +0.160619f, +0.154210f), - Vector3DFloat(+0.131443f, +0.918393f, -0.376629f), - Vector3DFloat(-0.354289f, +0.161534f, +0.880612f), - Vector3DFloat(+0.880184f, +0.543138f, -0.826594f), - Vector3DFloat(-0.388714f, +0.751946f, +0.645680f), - Vector3DFloat(-0.018586f, -0.968078f, -0.617969f), - Vector3DFloat(+0.802057f, -0.795648f, +0.790704f), - Vector3DFloat(+0.311075f, -0.065828f, +0.444746f), - Vector3DFloat(-0.024201f, -0.412152f, +0.955382f), - Vector3DFloat(+0.783868f, +0.879452f, +0.727409f), - Vector3DFloat(-0.854427f, -0.093844f, +0.874935f), - Vector3DFloat(-0.670522f, -0.453780f, +0.165014f), - Vector3DFloat(-0.530381f, +0.169836f, +0.937071f), - Vector3DFloat(+0.902158f, +0.596423f, +0.575976f), - Vector3DFloat(+0.957152f, -0.666372f, -0.794610f), - Vector3DFloat(+0.901425f, -0.066378f, -0.684988f), - Vector3DFloat(+0.219581f, -0.090426f, -0.020356f), - Vector3DFloat(+0.297342f, +0.915708f, -0.119419f), - Vector3DFloat(+0.923887f, -0.212622f, +0.793695f), - Vector3DFloat(-0.747124f, -0.364666f, -0.375591f), - Vector3DFloat(-0.003021f, -0.386944f, +0.304849f), - Vector3DFloat(-0.614368f, +0.345805f, +0.845210f), - Vector3DFloat(+0.245827f, -0.766961f, +0.046358f), - Vector3DFloat(-0.746818f, +0.777642f, -0.485580f), - Vector3DFloat(+0.138524f, +0.468673f, -0.247108f), - Vector3DFloat(-0.569628f, -0.256020f, -0.044465f), - Vector3DFloat(-0.707572f, +0.080599f, +0.177892f), - Vector3DFloat(+0.925657f, -0.710807f, +0.201453f), - Vector3DFloat(+0.986267f, +0.476547f, +0.244362f), - Vector3DFloat(-0.092746f, -0.028718f, -0.235450f), - Vector3DFloat(-0.001740f, +0.748466f, +0.268288f), - Vector3DFloat(-0.974181f, -0.081942f, -0.602161f), - Vector3DFloat(+0.534898f, -0.743217f, -0.895077f), - Vector3DFloat(-0.720573f, -0.683096f, -0.631825f), - Vector3DFloat(+0.183569f, -0.549913f, -0.348125f), - Vector3DFloat(+0.623341f, -0.764275f, -0.951964f), - Vector3DFloat(+0.973693f, -0.825251f, -0.558580f), - Vector3DFloat(+0.620350f, +0.380169f, +0.510849f), - Vector3DFloat(+0.989074f, +0.641774f, +0.327128f), - Vector3DFloat(+0.624805f, +0.817988f, +0.537339f), - Vector3DFloat(+0.809870f, -0.280984f, +0.755486f), - Vector3DFloat(+0.521531f, -0.903928f, -0.742851f), - Vector3DFloat(-0.389325f, -0.433699f, -0.928343f), - Vector3DFloat(+0.176366f, -0.211768f, -0.189428f), - Vector3DFloat(-0.737602f, -0.928159f, -0.016449f), - Vector3DFloat(+0.723380f, -0.405866f, +0.167211f), - Vector3DFloat(+0.523301f, -0.666372f, -0.046480f), - Vector3DFloat(-0.118259f, +0.912290f, -0.160985f), - Vector3DFloat(+0.611927f, -0.191748f, +0.149998f), - Vector3DFloat(+0.905881f, -0.424482f, +0.913816f), - Vector3DFloat(-0.620411f, -0.027131f, +0.923276f), - Vector3DFloat(+0.774957f, -0.569140f, +0.871944f), - Vector3DFloat(-0.804193f, +0.661061f, +0.820795f), - Vector3DFloat(+0.077059f, -0.102023f, +0.278054f), - Vector3DFloat(+0.772637f, -0.104831f, -0.823847f), - Vector3DFloat(+0.983947f, +0.818659f, -0.089267f), - Vector3DFloat(+0.735221f, -0.709586f, -0.454268f), - Vector3DFloat(+0.996643f, -0.944945f, -0.538316f), - Vector3DFloat(+0.049165f, -0.796014f, +0.971374f), - Vector3DFloat(-0.976623f, +0.655263f, -0.156163f), - Vector3DFloat(+0.681143f, -0.005585f, +0.476547f), - Vector3DFloat(-0.928159f, +0.237648f, -0.346538f), - Vector3DFloat(+0.361003f, -0.709586f, +0.595325f), - Vector3DFloat(-0.345927f, +0.798700f, -0.321390f), - Vector3DFloat(-0.731803f, -0.701346f, -0.652272f), - Vector3DFloat(+0.164708f, -0.335795f, -0.213599f), - Vector3DFloat(-0.857601f, +0.151463f, +0.157689f), - Vector3DFloat(-0.754692f, -0.954283f, +0.308939f), - Vector3DFloat(-0.037446f, -0.637562f, -0.991150f), - Vector3DFloat(+0.744987f, -0.130894f, -0.575610f), - Vector3DFloat(-0.799249f, -0.131687f, +0.906247f), - Vector3DFloat(+0.580004f, +0.468734f, -0.745232f), - Vector3DFloat(+0.991882f, +0.138401f, +0.694693f), - Vector3DFloat(+0.830195f, +0.634877f, +0.715140f), - Vector3DFloat(+0.607532f, -0.317972f, -0.250710f), - Vector3DFloat(+0.037629f, -0.384320f, +0.812922f), - Vector3DFloat(+0.645009f, +0.224036f, -0.778924f), - Vector3DFloat(-0.852779f, -0.743522f, +0.346843f), - Vector3DFloat(+0.578478f, -0.894955f, -0.327616f), - Vector3DFloat(-0.905759f, -0.239296f, -0.945799f), - Vector3DFloat(+0.028352f, -0.658254f, -0.705313f), - Vector3DFloat(+0.954405f, +0.825434f, -0.553575f), - Vector3DFloat(-0.471480f, +0.504440f, -0.262856f), - Vector3DFloat(-0.924131f, +0.393353f, +0.106967f), - Vector3DFloat(-0.032685f, +0.385846f, -0.877255f), - Vector3DFloat(-0.039094f, +0.220557f, +0.356731f), - Vector3DFloat(+0.490890f, -0.403790f, -0.650624f), - Vector3DFloat(-0.896115f, -0.866817f, -0.837825f), - Vector3DFloat(-0.260842f, -0.027558f, +0.511582f), - Vector3DFloat(+0.782037f, +0.493759f, +0.229835f), - Vector3DFloat(+0.086337f, -0.713431f, +0.484664f), - Vector3DFloat(+0.168615f, -0.742058f, +0.639637f), - Vector3DFloat(+0.325968f, -0.567919f, -0.359294f), - Vector3DFloat(-0.633717f, -0.662709f, +0.374615f), - Vector3DFloat(+0.230995f, -0.701041f, +0.557970f), - Vector3DFloat(-0.729911f, -0.967650f, +0.951170f), - Vector3DFloat(-0.126011f, -0.819819f, -0.299539f), - Vector3DFloat(-0.166540f, +0.321024f, -0.704398f), - Vector3DFloat(+0.769890f, -0.977111f, -0.374187f), - Vector3DFloat(+0.562120f, +0.025300f, +0.299234f), - Vector3DFloat(+0.048189f, +0.404462f, -0.420026f), - Vector3DFloat(-0.840632f, +0.586291f, +0.360515f), - Vector3DFloat(+0.223792f, +0.024140f, +0.607593f), - Vector3DFloat(-0.562120f, +0.602771f, +0.948302f), - Vector3DFloat(+0.968627f, -0.994263f, -0.206030f), - Vector3DFloat(+0.146886f, -0.315287f, +0.034455f), - Vector3DFloat(+0.836848f, -0.348613f, +0.213904f), - Vector3DFloat(+0.494980f, -0.216041f, +0.405927f), - Vector3DFloat(-0.584338f, -0.268715f, -0.165258f), - Vector3DFloat(+0.118686f, -0.751091f, -0.381817f), - Vector3DFloat(-0.887753f, +0.178686f, -0.730216f), - Vector3DFloat(-0.684194f, -0.351543f, +0.952330f), - Vector3DFloat(-0.006256f, -0.564562f, +0.137974f), - Vector3DFloat(-0.229408f, +0.182470f, +0.427168f), - Vector3DFloat(+0.024445f, +0.920713f, +0.119724f), - Vector3DFloat(-0.996948f, -0.518784f, -0.045991f), - Vector3DFloat(-0.062166f, -0.592090f, +0.849117f), - Vector3DFloat(-0.377422f, -0.942808f, -0.649770f), - Vector3DFloat(+0.093478f, -0.242470f, -0.198096f), - Vector3DFloat(-0.594348f, -0.156102f, +0.401105f), - Vector3DFloat(-0.746574f, -0.294351f, +0.577685f), - Vector3DFloat(+0.504929f, +0.405194f, +0.724296f), - Vector3DFloat(-0.489059f, -0.492294f, +0.680288f), - Vector3DFloat(-0.025971f, -0.241127f, +0.103977f), - Vector3DFloat(+0.875301f, -0.574206f, -0.671804f), - Vector3DFloat(-0.483444f, +0.592029f, -0.537339f), - Vector3DFloat(+0.504257f, -0.413984f, -0.779839f), - Vector3DFloat(+0.182043f, -0.805292f, +0.988403f), - Vector3DFloat(+0.533372f, -0.142064f, +0.793512f), - Vector3DFloat(-0.105380f, -0.039338f, -0.624317f), - Vector3DFloat(+0.125950f, +0.384259f, +0.596973f), - Vector3DFloat(+0.452071f, +0.039216f, +0.924802f), - Vector3DFloat(-0.986694f, +0.452498f, +0.199194f), - Vector3DFloat(+0.230323f, +0.931516f, -0.380596f), - Vector3DFloat(+0.657277f, +0.811945f, -0.176733f), - Vector3DFloat(-0.477767f, -0.251137f, -0.468734f), - Vector3DFloat(+0.499252f, +0.543260f, +0.886898f), - Vector3DFloat(-0.528855f, +0.747124f, -0.789300f), - Vector3DFloat(-0.188330f, +0.434675f, -0.915891f), - Vector3DFloat(-0.807733f, +0.861080f, +0.386029f), - Vector3DFloat(-0.314615f, +0.761223f, -0.177953f), - Vector3DFloat(-0.855098f, +0.549486f, +0.547227f), - Vector3DFloat(-0.072970f, +0.647816f, -0.034089f), - Vector3DFloat(+0.385784f, +0.557482f, -0.912534f), - Vector3DFloat(-0.654530f, -0.923032f, -0.783624f), - Vector3DFloat(-0.755425f, -0.523789f, -0.132725f), - Vector3DFloat(+0.333781f, +0.322733f, +0.267678f), - Vector3DFloat(-0.533982f, -0.534471f, -0.399884f), - Vector3DFloat(-0.953673f, -0.589465f, +0.450423f), - Vector3DFloat(-0.789911f, -0.535936f, -0.409833f), - Vector3DFloat(+0.085726f, +0.363079f, +0.082003f), - Vector3DFloat(+0.744194f, -0.114292f, +0.322245f), - Vector3DFloat(+0.693472f, -0.256447f, -0.516160f), - Vector3DFloat(+0.446028f, -0.553026f, +0.471908f), - Vector3DFloat(-0.757561f, +0.608997f, +0.833064f), - Vector3DFloat(+0.115024f, +0.632191f, +0.314493f), - Vector3DFloat(-0.403851f, -0.325663f, -0.057161f), - Vector3DFloat(-0.188696f, +0.636097f, +0.514756f), - Vector3DFloat(-0.110813f, -0.473861f, -0.041597f), - Vector3DFloat(-0.239540f, +0.673940f, -0.874325f), - Vector3DFloat(+0.739982f, +0.350932f, -0.930418f), - Vector3DFloat(+0.519639f, -0.430952f, +0.569262f), - Vector3DFloat(-0.916807f, +0.117832f, +0.924070f), - Vector3DFloat(+0.856136f, +0.764763f, +0.653798f), - Vector3DFloat(+0.953185f, +0.721061f, +0.723441f), - Vector3DFloat(-0.113010f, +0.617176f, -0.436140f), - Vector3DFloat(+0.912839f, +0.496811f, -0.742058f), - Vector3DFloat(+0.219275f, -0.751701f, +0.479965f), - Vector3DFloat(+0.655690f, -0.964538f, +0.619312f), - Vector3DFloat(+0.364971f, +0.635975f, -0.697989f), - Vector3DFloat(-0.142247f, +0.554918f, +0.291238f), - Vector3DFloat(-0.163732f, -0.772820f, -0.887997f), - Vector3DFloat(-0.122593f, -0.456404f, -0.006989f), - Vector3DFloat(-0.704154f, -0.551378f, -0.237770f), - Vector3DFloat(+0.637501f, -0.831843f, -0.706534f), - Vector3DFloat(-0.794061f, -0.717887f, +0.576464f), - Vector3DFloat(+0.233558f, -0.683218f, +0.879147f), - Vector3DFloat(-0.170934f, +0.848811f, +0.840510f), - Vector3DFloat(+0.735282f, -0.625965f, -0.309732f), - Vector3DFloat(-0.562975f, +0.929746f, +0.794794f), - Vector3DFloat(-0.455611f, -0.860836f, -0.810114f), - Vector3DFloat(+0.433882f, -0.190222f, -0.529405f), - Vector3DFloat(+0.785638f, -0.040864f, +0.050569f), - Vector3DFloat(-0.963134f, -0.993713f, -0.817011f), - Vector3DFloat(+0.787347f, -0.598071f, +0.782220f), - Vector3DFloat(-0.551378f, +0.589526f, +0.061983f), - Vector3DFloat(-0.987243f, +0.894589f, -0.469649f), - Vector3DFloat(+0.329264f, +0.164464f, -0.088656f), - Vector3DFloat(+0.068270f, +0.938841f, +0.700858f), - Vector3DFloat(+0.101535f, -0.583850f, -0.809503f), - Vector3DFloat(+0.906980f, -0.943724f, +0.461592f), - Vector3DFloat(+0.438520f, -0.329264f, +0.261086f), - Vector3DFloat(-0.700003f, -0.259316f, +0.784356f), - Vector3DFloat(+0.442305f, +0.444502f, +0.481185f), - Vector3DFloat(+0.326701f, -0.331523f, -0.227393f), - Vector3DFloat(-0.222327f, -0.308390f, +0.517136f), - Vector3DFloat(+0.275369f, -0.513169f, -0.177892f), - Vector3DFloat(-0.378887f, +0.668203f, +0.619312f), - Vector3DFloat(-0.785455f, -0.093661f, -0.071322f), - Vector3DFloat(-0.022309f, -0.744987f, +0.832820f), - Vector3DFloat(-0.177892f, +0.829707f, -0.550218f), - Vector3DFloat(+0.952879f, +0.477767f, +0.428999f), - Vector3DFloat(+0.113376f, +0.097568f, -0.921201f), - Vector3DFloat(+0.195898f, -0.924619f, -0.494613f), - Vector3DFloat(+0.727592f, -0.628956f, -0.029756f), - Vector3DFloat(-0.796197f, -0.450484f, -0.045686f), - Vector3DFloat(+0.670888f, +0.958068f, -0.902402f), - Vector3DFloat(-0.259194f, -0.570666f, +0.098422f), - Vector3DFloat(+0.120273f, -0.732475f, -0.712272f), - Vector3DFloat(+0.539109f, +0.754753f, -0.517075f), - Vector3DFloat(+0.320170f, +0.300821f, -0.790643f), - Vector3DFloat(-0.049287f, +0.269814f, -0.149998f), - Vector3DFloat(-0.004120f, +0.402081f, -0.856807f), - Vector3DFloat(+0.566881f, -0.224464f, -0.552049f), - Vector3DFloat(+0.323405f, -0.345317f, -0.119114f), - Vector3DFloat(-0.736198f, -0.234352f, +0.803278f), - Vector3DFloat(-0.424421f, +0.059358f, -0.162389f), - Vector3DFloat(+0.918516f, -0.884640f, -0.853511f), - Vector3DFloat(-0.633717f, +0.231239f, +0.672170f), - Vector3DFloat(+0.417096f, +0.454878f, +0.097201f), - Vector3DFloat(+0.183630f, -0.957030f, -0.368938f), - Vector3DFloat(-0.199133f, +0.191687f, -0.787774f), - Vector3DFloat(-0.109104f, +0.676077f, +0.731193f), - Vector3DFloat(-0.288186f, -0.801691f, +0.855037f), - Vector3DFloat(+0.332133f, -0.828730f, +0.005402f), - Vector3DFloat(+0.959166f, +0.197790f, -0.221107f), - Vector3DFloat(-0.646046f, +0.043428f, -0.379254f), - Vector3DFloat(-0.717338f, +0.122105f, +0.107883f), - Vector3DFloat(-0.299783f, +0.089389f, +0.977172f), - Vector3DFloat(+0.486862f, -0.577990f, -0.726615f), - Vector3DFloat(-0.400922f, +0.430769f, -0.834956f), - Vector3DFloat(+0.308756f, +0.735221f, -0.809076f), - Vector3DFloat(-0.304605f, +0.335551f, -0.350627f), - Vector3DFloat(-0.078219f, -0.288491f, -0.225318f), - Vector3DFloat(+0.529099f, +0.710562f, +0.002960f), - Vector3DFloat(+0.102695f, +0.410932f, -0.950072f), - Vector3DFloat(-0.715751f, +0.598621f, +0.188879f), - Vector3DFloat(-0.936460f, -0.232398f, -0.123203f), - Vector3DFloat(-0.733146f, -0.201819f, -0.463851f), - Vector3DFloat(-0.982971f, -0.581347f, -0.104953f), - Vector3DFloat(-0.219459f, +0.104648f, +0.416425f), - Vector3DFloat(+0.952391f, -0.038789f, +0.993530f), - Vector3DFloat(+0.992370f, +0.891537f, +0.959227f), - Vector3DFloat(+0.104221f, -0.305704f, -0.359722f), - Vector3DFloat(-0.722770f, +0.069735f, -0.801447f), - Vector3DFloat(+0.444563f, +0.354961f, +0.041414f), - Vector3DFloat(+0.642018f, -0.878903f, +0.058809f), - Vector3DFloat(-0.532579f, -0.463668f, +0.565233f), - Vector3DFloat(+0.411176f, -0.843379f, -0.172704f), - Vector3DFloat(+0.823908f, +0.619922f, +0.439863f), - Vector3DFloat(-0.340007f, +0.048189f, -0.529160f), - Vector3DFloat(+0.241310f, -0.585070f, +0.637135f), - Vector3DFloat(+0.146886f, +0.873226f, -0.425153f), - Vector3DFloat(-0.114658f, -0.465621f, +0.364483f), - Vector3DFloat(+0.987121f, -0.552599f, -0.918821f), - Vector3DFloat(+0.138401f, -0.917722f, +0.930479f), - Vector3DFloat(-0.732536f, -0.150731f, +0.613269f), - Vector3DFloat(-0.071139f, +0.752373f, +0.192541f), - Vector3DFloat(+0.475143f, -0.187353f, +0.258950f), - Vector3DFloat(-0.500412f, -0.829157f, -0.418073f), - Vector3DFloat(+0.260414f, +0.930479f, +0.483016f), - Vector3DFloat(-0.899106f, +0.528550f, +0.076510f), - Vector3DFloat(-0.084384f, +0.022614f, +0.609180f), - Vector3DFloat(-0.213843f, -0.532334f, -0.282022f), - Vector3DFloat(-0.715323f, +0.025117f, -0.698477f), - Vector3DFloat(+0.521348f, +0.088656f, -0.415265f), - Vector3DFloat(-0.131809f, -0.395672f, +0.932432f), - Vector3DFloat(-0.549364f, -0.948363f, -0.207862f), - Vector3DFloat(+0.908322f, +0.643605f, -0.103732f), - Vector3DFloat(+0.632496f, +0.330973f, +0.345622f), - Vector3DFloat(-0.522141f, +0.031892f, -0.920713f), - Vector3DFloat(-0.875912f, +0.481918f, -0.229408f), - Vector3DFloat(-0.698172f, -0.934202f, +0.051668f), - Vector3DFloat(-0.791070f, -0.452193f, -0.366680f), - Vector3DFloat(-0.531907f, +0.497299f, +0.386517f), - Vector3DFloat(-0.942808f, -0.775811f, -0.397320f), - Vector3DFloat(+0.577563f, +0.075289f, -0.943297f), - Vector3DFloat(+0.464827f, -0.145848f, -0.167638f), - Vector3DFloat(-0.503220f, +0.592273f, -0.617359f), - Vector3DFloat(+0.752739f, +0.503464f, -0.586230f), - Vector3DFloat(-0.040315f, +0.197180f, -0.259072f), - Vector3DFloat(-0.304422f, -0.989380f, -0.281289f), - Vector3DFloat(+0.063387f, -0.662954f, +0.451338f), - Vector3DFloat(-0.272744f, +0.768914f, -0.141270f), - Vector3DFloat(+0.475021f, +0.378033f, +0.186010f), - Vector3DFloat(+0.893613f, -0.671560f, +0.494491f), - Vector3DFloat(+0.154027f, +0.994873f, +0.138096f), - Vector3DFloat(-0.661061f, -0.039094f, +0.072787f), - Vector3DFloat(+0.849666f, -0.956298f, +0.300699f), - Vector3DFloat(-0.227027f, +0.343913f, +0.514512f), - Vector3DFloat(+0.812738f, -0.891659f, +0.790277f), - Vector3DFloat(+0.619251f, -0.234779f, -0.342448f), - Vector3DFloat(-0.698904f, -0.525620f, -0.553331f), - Vector3DFloat(-0.357524f, +0.950194f, -0.358623f), - Vector3DFloat(-0.174352f, -0.802911f, +0.215552f), - Vector3DFloat(+0.046175f, +0.043794f, +0.139927f), - Vector3DFloat(+0.911924f, +0.433149f, +0.302286f), - Vector3DFloat(+0.563463f, -0.326823f, -0.832759f), - Vector3DFloat(-0.293741f, -0.448103f, -0.951781f), - Vector3DFloat(+0.196448f, +0.627979f, +0.340800f), - Vector3DFloat(-0.727042f, -0.013886f, -0.847346f), - Vector3DFloat(-0.769707f, +0.780084f, +0.239174f), - Vector3DFloat(+0.168493f, +0.564806f, +0.509690f), - Vector3DFloat(-0.786126f, +0.663564f, -0.908261f), - Vector3DFloat(+0.084017f, -0.548631f, -0.207312f), - Vector3DFloat(+0.011567f, +0.906552f, +0.726188f), - Vector3DFloat(-0.723746f, +0.031648f, +0.250587f), - Vector3DFloat(+0.031892f, +0.693045f, -0.263283f), - Vector3DFloat(-0.601856f, -0.585742f, -0.769280f), - Vector3DFloat(+0.588122f, -0.108127f, -0.535020f), - Vector3DFloat(+0.455672f, +0.864498f, +0.963378f), - Vector3DFloat(-0.712882f, -0.335490f, -0.143712f), - Vector3DFloat(+0.199194f, +0.747002f, +0.380840f), - Vector3DFloat(+0.626820f, +0.508042f, -0.177465f), - Vector3DFloat(-0.441816f, +0.652150f, -0.549058f), - Vector3DFloat(+0.862667f, +0.053377f, +0.652333f), - Vector3DFloat(-0.002289f, +0.568834f, -0.069185f) - }; -} From 6e8d9dfb752bcca928f66e46dae33dec8fed9d4a Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 16:52:21 +0100 Subject: [PATCH 245/259] Windows now uses standard C++ timer. I assume we weren't using it before because it wasn't present on older versions of Visual Studio? Moved timer code to header. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/Impl/Timer.h | 42 ++++--- library/PolyVoxCore/source/Impl/Timer.cpp | 107 ------------------ 3 files changed, 29 insertions(+), 122 deletions(-) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 2e2cb8b0..51ed0841 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -87,7 +87,7 @@ SET(IMPL_SRC_FILES #source/Impl/MarchingCubesTables.cpp #source/Impl/RandomUnitVectors.cpp #source/Impl/RandomVectors.cpp - source/Impl/Timer.cpp + #source/Impl/Timer.cpp source/Impl/Utility.cpp ) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h index d53feb79..9ad25bc6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h @@ -26,33 +26,47 @@ freely, subject to the following restrictions: #include -#ifdef _MSC_VER // Don't worry about the exact version, as long as this is defied. -#include -#else #include -#endif //_MSC_VER namespace PolyVox { class Timer { public: - Timer(bool bAutoStart = true); + Timer(bool bAutoStart = true) + { + if (bAutoStart) + { + start(); + } + } - void start(void); + void start(void) + { + m_start = clock::now(); + } - float elapsedTimeInSeconds(void); - uint32_t elapsedTimeInMilliSeconds(void); - uint32_t elapsedTimeInMicroSeconds(void); + float elapsedTimeInSeconds(void) + { + std::chrono::duration elapsed_seconds = clock::now() - m_start; + return elapsed_seconds.count(); + } + + uint32_t elapsedTimeInMilliSeconds(void) + { + std::chrono::duration elapsed_milliseconds = clock::now() - m_start; + return elapsed_milliseconds.count(); + } + + uint32_t elapsedTimeInMicroSeconds(void) + { + std::chrono::duration elapsed_microseconds = clock::now() - m_start; + return elapsed_microseconds.count(); + } private: -#if defined(_MSC_VER) - double m_fPCFreq; - __int64 m_iStartTime; -#else //_MSC_VER typedef std::chrono::system_clock clock; std::chrono::time_point m_start; -#endif //_MSC_VER }; } diff --git a/library/PolyVoxCore/source/Impl/Timer.cpp b/library/PolyVoxCore/source/Impl/Timer.cpp index a0d3c102..e69de29b 100644 --- a/library/PolyVoxCore/source/Impl/Timer.cpp +++ b/library/PolyVoxCore/source/Impl/Timer.cpp @@ -1,107 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-20013 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Timer.h" - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -#include - -namespace PolyVox -{ -#if defined(_MSC_VER) - Timer::Timer(bool bAutoStart) - :m_fPCFreq(0.0) - ,m_iStartTime(0) - { - if(bAutoStart) - { - start(); - } - } - - void Timer::start(void) - { - LARGE_INTEGER li; - if(!QueryPerformanceFrequency(&li)) - { - POLYVOX_LOG_WARNING("QueryPerformanceFrequency failed!"); - m_fPCFreq = 1.0f; - } - - m_fPCFreq = double(li.QuadPart); - - QueryPerformanceCounter(&li); - m_iStartTime = li.QuadPart; - } - - float Timer::elapsedTimeInSeconds(void) - { - LARGE_INTEGER li; - QueryPerformanceCounter(&li); - double fDifference = static_cast(li.QuadPart-m_iStartTime); - return static_cast(fDifference / m_fPCFreq); - } - - uint32_t Timer::elapsedTimeInMilliSeconds(void) - { - return static_cast(elapsedTimeInSeconds() * 1000.0f); - } - - uint32_t Timer::elapsedTimeInMicroSeconds(void) - { - return static_cast(elapsedTimeInSeconds() * 1000000.0f); - } -#else //_MSC_VER - Timer::Timer(bool bAutoStart) - { - if(bAutoStart) - { - start(); - } - } - - void Timer::start(void) - { - m_start = clock::now(); - } - - float Timer::elapsedTimeInSeconds(void) - { - std::chrono::duration elapsed_seconds = clock::now() - m_start; - return elapsed_seconds.count(); - } - - uint32_t Timer::elapsedTimeInMilliSeconds(void) - { - std::chrono::duration elapsed_milliseconds = clock::now() - m_start; - return elapsed_milliseconds.count(); - } - - uint32_t Timer::elapsedTimeInMicroSeconds(void) - { - std::chrono::duration elapsed_microseconds = clock::now() - m_start; - return elapsed_microseconds.count(); - } -#endif //_MSC_VER -} From 4325ffabc4cea8bc32bebd76d523c4ec42de9fc7 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 21:08:19 +0100 Subject: [PATCH 246/259] Moved error handling functions/macros to be header-only. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/Impl/ErrorHandling.h | 45 ++++++++++- .../PolyVoxCore/source/Impl/ErrorHandling.cpp | 74 ------------------- library/PolyVoxCore/source/Impl/Timer.cpp | 0 4 files changed, 44 insertions(+), 77 deletions(-) delete mode 100644 library/PolyVoxCore/source/Impl/ErrorHandling.cpp delete mode 100644 library/PolyVoxCore/source/Impl/Timer.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 51ed0841..76df58b2 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -82,7 +82,7 @@ SET(CORE_INC_FILES ) SET(IMPL_SRC_FILES - source/Impl/ErrorHandling.cpp + #source/Impl/ErrorHandling.cpp source/Impl/Logging.cpp #source/Impl/MarchingCubesTables.cpp #source/Impl/RandomUnitVectors.cpp diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index be7515a6..a1049bf7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -155,8 +155,49 @@ freely, subject to the following restrictions: { typedef void (*ThrowHandler)(std::exception& e, const char* file, int line); - ThrowHandler getThrowHandler(); - void setThrowHandler(ThrowHandler newHandler); + inline void defaultThrowHandler(std::exception& e, const char* file, int line) + { + std::stringstream ss; \ + ss << "\n"; \ + ss << " PolyVox exception thrown!"; \ + ss << " ========================="; \ + ss << " PolyVox has tried to throw an exception but it was built without support"; \ + ss << " for exceptions. In this scenario PolyVox will call a 'throw handler'"; \ + ss << " and this message is being printed by the default throw handler."; \ + ss << "\n"; \ + ss << " If you don't want to enable exceptions then you should try to determine why"; \ + ss << " this exception was thrown and make sure it doesn't happen again. If it was"; \ + ss << " due to something like an invalid argument to a function then you should be"; \ + ss << " able to fix it quite easily by validating parameters as appropriate. More"; \ + ss << " complex exception scenarios (out of memory, etc) might be harder to fix and"; \ + ss << " you should replace this default handler with something which is more"; \ + ss << " meaningful to your users."; \ + ss << "\n"; \ + ss << " Exception details"; \ + ss << " -----------------"; \ + ss << " Line: " << line; \ + ss << " File: " << file; \ + ss << " Message: " << e.what(); \ + ss << "\n"; \ + PolyVox::Impl::getLoggerInstance()->logFatalMessage(ss.str()); \ + POLYVOX_HALT(); \ + } + + inline ThrowHandler& getThrowHandlerInstance() + { + static ThrowHandler s_fThrowHandler = &defaultThrowHandler; + return s_fThrowHandler; + } + + inline ThrowHandler getThrowHandler() + { + return getThrowHandlerInstance(); + } + + inline void setThrowHandler(ThrowHandler fNewHandler) + { + getThrowHandlerInstance() = fNewHandler; + } } #define POLYVOX_THROW_IF(condition, type, message) \ diff --git a/library/PolyVoxCore/source/Impl/ErrorHandling.cpp b/library/PolyVoxCore/source/Impl/ErrorHandling.cpp deleted file mode 100644 index 98e03fd2..00000000 --- a/library/PolyVoxCore/source/Impl/ErrorHandling.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" - -namespace PolyVox -{ - -#ifndef POLYVOX_THROW_ENABLED - void defaultThrowHandler(std::exception& e, const char* file, int line) - { - std::stringstream ss; \ - ss << "\n"; \ - ss << " PolyVox exception thrown!"; \ - ss << " ========================="; \ - ss << " PolyVox has tried to throw an exception but it was built without support"; \ - ss << " for exceptions. In this scenario PolyVox will call a 'throw handler'"; \ - ss << " and this message is being printed by the default throw handler."; \ - ss << "\n"; \ - ss << " If you don't want to enable exceptions then you should try to determine why"; \ - ss << " this exception was thrown and make sure it doesn't happen again. If it was"; \ - ss << " due to something like an invalid argument to a function then you should be"; \ - ss << " able to fix it quite easily by validating parameters as appropriate. More"; \ - ss << " complex exception scenarios (out of memory, etc) might be harder to fix and"; \ - ss << " you should replace this default handler with something which is more"; \ - ss << " meaningful to your users."; \ - ss << "\n"; \ - ss << " Exception details"; \ - ss << " -----------------"; \ - ss << " Line: " << line; \ - ss << " File: " << file; \ - ss << " Message: " << e.what(); \ - ss << "\n"; \ - PolyVox::Impl::getLoggerInstance()->logFatalMessage(ss.str()); \ - POLYVOX_HALT(); \ - } - - ThrowHandler& getThrowHandlerInstance() - { - static ThrowHandler s_fThrowHandler = &defaultThrowHandler; - return s_fThrowHandler; - } - - ThrowHandler getThrowHandler() - { - return getThrowHandlerInstance(); - } - - void setThrowHandler(ThrowHandler fNewHandler) - { - getThrowHandlerInstance() = fNewHandler; - } -#endif -} diff --git a/library/PolyVoxCore/source/Impl/Timer.cpp b/library/PolyVoxCore/source/Impl/Timer.cpp deleted file mode 100644 index e69de29b..00000000 From 07f15935616c3902c9baaf414322924e656f6fec Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 21:13:12 +0100 Subject: [PATCH 247/259] Made logging functions header only. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/Impl/Logging.h | 11 ++++- library/PolyVoxCore/source/Impl/Logging.cpp | 43 ------------------- 3 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 library/PolyVoxCore/source/Impl/Logging.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 76df58b2..e024eb4f 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -83,7 +83,7 @@ SET(CORE_INC_FILES SET(IMPL_SRC_FILES #source/Impl/ErrorHandling.cpp - source/Impl/Logging.cpp + #source/Impl/Logging.cpp #source/Impl/MarchingCubesTables.cpp #source/Impl/RandomUnitVectors.cpp #source/Impl/RandomVectors.cpp diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h index e86537c6..a9a3b2b5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h @@ -70,10 +70,17 @@ namespace PolyVox namespace Impl { - Logger*& getLoggerInstance(); + inline Logger*& getLoggerInstance() + { + static Logger* s_pLogger = new DefaultLogger; + return s_pLogger; + } } - void setLogger(Logger* pLogger); + inline void setLogger(Logger* pLogger) + { + Impl::getLoggerInstance() = pLogger; + } } #ifdef POLYVOX_LOG_TRACE_ENABLED diff --git a/library/PolyVoxCore/source/Impl/Logging.cpp b/library/PolyVoxCore/source/Impl/Logging.cpp deleted file mode 100644 index 74712bb8..00000000 --- a/library/PolyVoxCore/source/Impl/Logging.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams and Matthew Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/Logging.h" - -namespace PolyVox -{ - namespace Impl - { - // Perhaps read this note when we want to move everything - // to the header file: http://stackoverflow.com/a/7834555 - Logger*& getLoggerInstance() - { - static Logger* s_pLogger = new DefaultLogger; - return s_pLogger; - } - } - - void setLogger(Logger* pLogger) - { - Impl::getLoggerInstance() = pLogger; - } -} From 9d9e3996a38a49970a42cb9fafa8f9b4d79cb3c0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 21:28:47 +0100 Subject: [PATCH 248/259] Moved utility functions to header. --- library/PolyVoxCore/CMakeLists.txt | 2 +- .../include/PolyVoxCore/Impl/Utility.h | 48 +++++++++++-- library/PolyVoxCore/source/Impl/Utility.cpp | 72 ------------------- 3 files changed, 42 insertions(+), 80 deletions(-) delete mode 100644 library/PolyVoxCore/source/Impl/Utility.cpp diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index e024eb4f..d81b093a 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -88,7 +88,7 @@ SET(IMPL_SRC_FILES #source/Impl/RandomUnitVectors.cpp #source/Impl/RandomVectors.cpp #source/Impl/Timer.cpp - source/Impl/Utility.cpp + #source/Impl/Utility.cpp ) SET(IMPL_INC_FILES diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index ff9a6e7b..e5ba354c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -30,14 +30,48 @@ freely, subject to the following restrictions: namespace PolyVox { - POLYVOX_API uint8_t logBase2(uint32_t uInput); - POLYVOX_API bool isPowerOf2(uint32_t uInput); + inline bool isPowerOf2(uint32_t uInput) + { + if (uInput == 0) + return false; + else + return ((uInput & (uInput - 1)) == 0); + } - int32_t roundTowardsNegInf(float r); - int32_t roundToInteger(float r); - template - Type clamp(const Type& value, const Type& low, const Type& high); - uint32_t upperPowerOfTwo(uint32_t v); + //Note: this function only works for inputs which are a power of two and not zero + //If this is not the case then the output is undefined. + inline uint8_t logBase2(uint32_t uInput) + { + //Release mode validation + if (uInput == 0) + { + POLYVOX_THROW(std::invalid_argument, "Cannot compute the log of zero."); + } + if (!isPowerOf2(uInput)) + { + POLYVOX_THROW(std::invalid_argument, "Input must be a power of two in order to compute the log."); + } + + uint32_t uResult = 0; + while ((uInput >> uResult) != 0) + { + ++uResult; + } + return static_cast(uResult - 1); + } + + // http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 + inline uint32_t upperPowerOfTwo(uint32_t v) + { + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; + } inline int32_t roundTowardsNegInf(float r) { diff --git a/library/PolyVoxCore/source/Impl/Utility.cpp b/library/PolyVoxCore/source/Impl/Utility.cpp deleted file mode 100644 index 83be3b0a..00000000 --- a/library/PolyVoxCore/source/Impl/Utility.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* -Copyright (c) 2005-2009 David Williams - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*******************************************************************************/ - -#include "PolyVoxCore/Impl/ErrorHandling.h" -#include "PolyVoxCore/Impl/Utility.h" - -namespace PolyVox -{ - //Note: this function only works for inputs which are a power of two and not zero - //If this is not the case then the output is undefined. - uint8_t logBase2(uint32_t uInput) - { - //Release mode validation - if(uInput == 0) - { - POLYVOX_THROW(std::invalid_argument, "Cannot compute the log of zero."); - } - if(!isPowerOf2(uInput)) - { - POLYVOX_THROW(std::invalid_argument, "Input must be a power of two in order to compute the log."); - } - - uint32_t uResult = 0; - while( (uInput >> uResult) != 0) - { - ++uResult; - } - return static_cast(uResult-1); - } - - - bool isPowerOf2(uint32_t uInput) - { - if(uInput == 0) - return false; - else - return ((uInput & (uInput-1)) == 0); - } - - // http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 - uint32_t upperPowerOfTwo(uint32_t v) - { - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - return v; - } -} From c3f2e5217eee0c1adbce15230ae7241a0d3ceec2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 6 Feb 2015 23:29:35 +0100 Subject: [PATCH 249/259] Removed CMake code which tries to build/use PolyVoxCore as a library. --- examples/Basic/CMakeLists.txt | 2 +- examples/DecodeOnGPU/CMakeLists.txt | 2 +- examples/OpenGL/CMakeLists.txt | 2 +- examples/Paging/CMakeLists.txt | 2 +- examples/SmoothLOD/CMakeLists.txt | 2 +- library/PolyVoxCore/CMakeLists.txt | 61 +++-------------------------- library/PolyVoxUtil/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 8 files changed, 13 insertions(+), 62 deletions(-) diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 66546f66..153b0570 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -53,7 +53,7 @@ ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt index a812c2b5..3cb051f5 100644 --- a/examples/DecodeOnGPU/CMakeLists.txt +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -54,7 +54,7 @@ ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${DECODE_ IF(MSVC) SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) SET_PROPERTY(TARGET DecodeOnGPUExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 910ea0fb..129dac1b 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -56,7 +56,7 @@ ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPL IF(MSVC) SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples") #Install - Only install the example in Windows diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index db2f9028..b256cfa5 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -55,7 +55,7 @@ ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") ENDIF(MSVC) -TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples") configure_file(../common/example.vert example.vert COPYONLY) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 15bbd4b9..e11a715a 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -53,7 +53,7 @@ ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC}) IF(MSVC) SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings ENDIF(MSVC) -TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore) +TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples") configure_file(../common/example.vert example.vert COPYONLY) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index d81b093a..6e9b339a 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -23,9 +23,9 @@ PROJECT(PolyVoxCore) #Projects source files -SET(CORE_SRC_FILES +#SET(CORE_SRC_FILES #source/AStarPathfinder.cpp -) +#) #Projects headers files SET(CORE_INC_FILES @@ -81,7 +81,7 @@ SET(CORE_INC_FILES include/PolyVoxCore/VoxelFilters.inl ) -SET(IMPL_SRC_FILES +#SET(IMPL_SRC_FILES #source/Impl/ErrorHandling.cpp #source/Impl/Logging.cpp #source/Impl/MarchingCubesTables.cpp @@ -89,7 +89,7 @@ SET(IMPL_SRC_FILES #source/Impl/RandomVectors.cpp #source/Impl/Timer.cpp #source/Impl/Utility.cpp -) +#) SET(IMPL_INC_FILES include/PolyVoxCore/Impl/AStarPathfinderImpl.h @@ -108,57 +108,8 @@ SET(IMPL_INC_FILES #"Sources" and "Headers" are the group names in Visual Studio. #They may have other uses too... -SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) +#SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) -SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) +#SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) - -#Tell CMake the paths -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) - -#Core -#Build -IF(LIBRARY_TYPE STREQUAL "STATIC") - ADD_LIBRARY(PolyVoxCore STATIC ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) - IF(UNIX) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF() -ENDIF() -IF(LIBRARY_TYPE STREQUAL "DYNAMIC") - ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES}) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") -ENDIF() -SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") - -SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) -IF(MSVC) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/W4 /wd4251") #Disable warning on STL exports -ENDIF(MSVC) - -#Install -IF(WIN32) - INSTALL(TARGETS PolyVoxCore - RUNTIME DESTINATION PolyVoxCore/bin COMPONENT library - LIBRARY DESTINATION PolyVoxCore/lib COMPONENT library - ARCHIVE DESTINATION PolyVoxCore/lib COMPONENT library - ) - - #Install the core header files, including the ones in the Impl subfolder. - INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) - - #On windows, we also install the debug information. It's unfortunate that we have to hard-code - #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I - #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS RelWithDebInfo) -ELSE(WIN32) - INSTALL(TARGETS PolyVoxCore - RUNTIME DESTINATION bin COMPONENT library - LIBRARY DESTINATION lib COMPONENT library - ARCHIVE DESTINATION lib COMPONENT library - ) - - #Install the core header files, including the ones in the Impl subfolder. - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) -ENDIF(WIN32) diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt index b542e068..4df41a60 100644 --- a/library/PolyVoxUtil/CMakeLists.txt +++ b/library/PolyVoxUtil/CMakeLists.txt @@ -58,7 +58,7 @@ IF(LIBRARY_TYPE STREQUAL "DYNAMIC") ENDIF() SET_PROPERTY(TARGET PolyVoxUtil PROPERTY FOLDER "Library") -TARGET_LINK_LIBRARIES(PolyVoxUtil PolyVoxCore) +TARGET_LINK_LIBRARIES(PolyVoxUtil) SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) IF(MSVC) SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "/W4 /wd4251 /wd4127") #Disable warning on STL exports diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fbffe9d9..fe6b35eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,7 +29,7 @@ MACRO(CREATE_TEST headerfile sourcefile executablename) QT4_WRAP_CPP(test_moc_SRCS ${headerfile}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR} ${PolyVoxUtil_BINARY_DIR}) ADD_EXECUTABLE(${executablename} ${sourcefile} ${test_moc_SRCS}) - TARGET_LINK_LIBRARIES(${executablename} PolyVoxCore PolyVoxUtil ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY}) + TARGET_LINK_LIBRARIES(${executablename} PolyVoxUtil ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY}) #HACK. This is needed since everything is built in the base dir in Windows. As of 2.8 we should change this. IF(WIN32) SET(LATEST_TEST ${EXECUTABLE_OUTPUT_PATH}/${executablename}) From 5d54c881a12bf3b1816fb7858021711b9cfe5c99 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 06:52:47 +0100 Subject: [PATCH 250/259] Added custom target (which doesn't build anything) so that our header-only library still shows up in VisualStudio for browsing the files. --- library/PolyVoxCore/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 6e9b339a..79ddc63c 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -113,3 +113,8 @@ SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) #SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) + +# Although we don't build anything for PolyVox, we still add this custom target (which +# doesn't do anything) so that we can browse the source code from within Visual Studio. +ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) +SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") From c3305ea14bb931b8a342e64d3d1479dce3d8f76d Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 10:36:49 +0100 Subject: [PATCH 251/259] Reinstated some of the 'install' code. --- library/PolyVoxCore/CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 79ddc63c..c06c9c8a 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -23,9 +23,9 @@ PROJECT(PolyVoxCore) #Projects source files -#SET(CORE_SRC_FILES +SET(CORE_SRC_FILES #source/AStarPathfinder.cpp -#) +) #Projects headers files SET(CORE_INC_FILES @@ -81,7 +81,7 @@ SET(CORE_INC_FILES include/PolyVoxCore/VoxelFilters.inl ) -#SET(IMPL_SRC_FILES +SET(IMPL_SRC_FILES #source/Impl/ErrorHandling.cpp #source/Impl/Logging.cpp #source/Impl/MarchingCubesTables.cpp @@ -89,7 +89,7 @@ SET(CORE_INC_FILES #source/Impl/RandomVectors.cpp #source/Impl/Timer.cpp #source/Impl/Utility.cpp -#) +) SET(IMPL_INC_FILES include/PolyVoxCore/Impl/AStarPathfinderImpl.h @@ -114,7 +114,21 @@ SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) #SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) +#Tell CMake the paths +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) + +#Core + +#Build # Although we don't build anything for PolyVox, we still add this custom target (which # doesn't do anything) so that we can browse the source code from within Visual Studio. ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") + +#Install the core header files, including the ones in the Impl subfolder. +IF(WIN32) + INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) +ELSE(WIN32) + + INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) +ENDIF(WIN32) From 630affbf4da4c9d7f4638a0f40d56390c480e1b5 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 14:47:21 +0100 Subject: [PATCH 252/259] Moved bindings from inside 'library' folder to root folder. --- CMakeLists.txt | 1 + {library/bindings => bindings}/Array.i | 0 {library/bindings => bindings}/BaseVolume.i | 0 {library/bindings => bindings}/Block.i | 0 {library/bindings => bindings}/BlockCompressor.i | 0 {library/bindings => bindings}/CMakeLists.txt | 0 {library/bindings => bindings}/Chunk.i | 0 {library/bindings => bindings}/CleanCSharpBindings.bat | 0 {library/bindings => bindings}/CompressedBlock.i | 0 {library/bindings => bindings}/CubicSurfaceExtractor.i | 0 .../bindings => bindings}/CubicSurfaceExtractorWithNormals.i | 0 {library/bindings => bindings}/DefaultMarchingCubesController.i | 0 {library/bindings => bindings}/FilePager.i | 0 {library/bindings => bindings}/LargeVolume.i | 0 {library/bindings => bindings}/MakeCSharpBindings.bat | 0 {library/bindings => bindings}/MarchingCubesSurfaceExtractor.i | 0 {library/bindings => bindings}/MeshDecimator.i | 0 {library/bindings => bindings}/MinizBlockCompressor.i | 0 {library/bindings => bindings}/PagedVolume.i | 0 {library/bindings => bindings}/Pager.i | 0 {library/bindings => bindings}/Picking.i | 0 {library/bindings => bindings}/PolyVoxCore.i | 0 {library/bindings => bindings}/RLEBlockCompressor.i | 0 {library/bindings => bindings}/RawVolume.i | 0 {library/bindings => bindings}/Raycast.i | 0 {library/bindings => bindings}/Region.i | 0 {library/bindings => bindings}/SimpleVolume.i | 0 {library/bindings => bindings}/SimpleVolumeSampler.i | 0 {library/bindings => bindings}/SubArray.i | 0 {library/bindings => bindings}/SurfaceMesh.i | 0 {library/bindings => bindings}/TypeDef.i | 0 {library/bindings => bindings}/UncompressedBlock.i | 0 {library/bindings => bindings}/Vector.i | 0 {library/bindings => bindings}/VertexTypes.i | 0 library/CMakeLists.txt | 1 - 35 files changed, 1 insertion(+), 1 deletion(-) rename {library/bindings => bindings}/Array.i (100%) rename {library/bindings => bindings}/BaseVolume.i (100%) rename {library/bindings => bindings}/Block.i (100%) rename {library/bindings => bindings}/BlockCompressor.i (100%) rename {library/bindings => bindings}/CMakeLists.txt (100%) rename {library/bindings => bindings}/Chunk.i (100%) rename {library/bindings => bindings}/CleanCSharpBindings.bat (100%) rename {library/bindings => bindings}/CompressedBlock.i (100%) rename {library/bindings => bindings}/CubicSurfaceExtractor.i (100%) rename {library/bindings => bindings}/CubicSurfaceExtractorWithNormals.i (100%) rename {library/bindings => bindings}/DefaultMarchingCubesController.i (100%) rename {library/bindings => bindings}/FilePager.i (100%) rename {library/bindings => bindings}/LargeVolume.i (100%) rename {library/bindings => bindings}/MakeCSharpBindings.bat (100%) rename {library/bindings => bindings}/MarchingCubesSurfaceExtractor.i (100%) rename {library/bindings => bindings}/MeshDecimator.i (100%) rename {library/bindings => bindings}/MinizBlockCompressor.i (100%) rename {library/bindings => bindings}/PagedVolume.i (100%) rename {library/bindings => bindings}/Pager.i (100%) rename {library/bindings => bindings}/Picking.i (100%) rename {library/bindings => bindings}/PolyVoxCore.i (100%) rename {library/bindings => bindings}/RLEBlockCompressor.i (100%) rename {library/bindings => bindings}/RawVolume.i (100%) rename {library/bindings => bindings}/Raycast.i (100%) rename {library/bindings => bindings}/Region.i (100%) rename {library/bindings => bindings}/SimpleVolume.i (100%) rename {library/bindings => bindings}/SimpleVolumeSampler.i (100%) rename {library/bindings => bindings}/SubArray.i (100%) rename {library/bindings => bindings}/SurfaceMesh.i (100%) rename {library/bindings => bindings}/TypeDef.i (100%) rename {library/bindings => bindings}/UncompressedBlock.i (100%) rename {library/bindings => bindings}/Vector.i (100%) rename {library/bindings => bindings}/VertexTypes.i (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index bce84941..5fe7322c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ ENDIF() ADD_SUBDIRECTORY(documentation) +ADD_SUBDIRECTORY(bindings) set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org) diff --git a/library/bindings/Array.i b/bindings/Array.i similarity index 100% rename from library/bindings/Array.i rename to bindings/Array.i diff --git a/library/bindings/BaseVolume.i b/bindings/BaseVolume.i similarity index 100% rename from library/bindings/BaseVolume.i rename to bindings/BaseVolume.i diff --git a/library/bindings/Block.i b/bindings/Block.i similarity index 100% rename from library/bindings/Block.i rename to bindings/Block.i diff --git a/library/bindings/BlockCompressor.i b/bindings/BlockCompressor.i similarity index 100% rename from library/bindings/BlockCompressor.i rename to bindings/BlockCompressor.i diff --git a/library/bindings/CMakeLists.txt b/bindings/CMakeLists.txt similarity index 100% rename from library/bindings/CMakeLists.txt rename to bindings/CMakeLists.txt diff --git a/library/bindings/Chunk.i b/bindings/Chunk.i similarity index 100% rename from library/bindings/Chunk.i rename to bindings/Chunk.i diff --git a/library/bindings/CleanCSharpBindings.bat b/bindings/CleanCSharpBindings.bat similarity index 100% rename from library/bindings/CleanCSharpBindings.bat rename to bindings/CleanCSharpBindings.bat diff --git a/library/bindings/CompressedBlock.i b/bindings/CompressedBlock.i similarity index 100% rename from library/bindings/CompressedBlock.i rename to bindings/CompressedBlock.i diff --git a/library/bindings/CubicSurfaceExtractor.i b/bindings/CubicSurfaceExtractor.i similarity index 100% rename from library/bindings/CubicSurfaceExtractor.i rename to bindings/CubicSurfaceExtractor.i diff --git a/library/bindings/CubicSurfaceExtractorWithNormals.i b/bindings/CubicSurfaceExtractorWithNormals.i similarity index 100% rename from library/bindings/CubicSurfaceExtractorWithNormals.i rename to bindings/CubicSurfaceExtractorWithNormals.i diff --git a/library/bindings/DefaultMarchingCubesController.i b/bindings/DefaultMarchingCubesController.i similarity index 100% rename from library/bindings/DefaultMarchingCubesController.i rename to bindings/DefaultMarchingCubesController.i diff --git a/library/bindings/FilePager.i b/bindings/FilePager.i similarity index 100% rename from library/bindings/FilePager.i rename to bindings/FilePager.i diff --git a/library/bindings/LargeVolume.i b/bindings/LargeVolume.i similarity index 100% rename from library/bindings/LargeVolume.i rename to bindings/LargeVolume.i diff --git a/library/bindings/MakeCSharpBindings.bat b/bindings/MakeCSharpBindings.bat similarity index 100% rename from library/bindings/MakeCSharpBindings.bat rename to bindings/MakeCSharpBindings.bat diff --git a/library/bindings/MarchingCubesSurfaceExtractor.i b/bindings/MarchingCubesSurfaceExtractor.i similarity index 100% rename from library/bindings/MarchingCubesSurfaceExtractor.i rename to bindings/MarchingCubesSurfaceExtractor.i diff --git a/library/bindings/MeshDecimator.i b/bindings/MeshDecimator.i similarity index 100% rename from library/bindings/MeshDecimator.i rename to bindings/MeshDecimator.i diff --git a/library/bindings/MinizBlockCompressor.i b/bindings/MinizBlockCompressor.i similarity index 100% rename from library/bindings/MinizBlockCompressor.i rename to bindings/MinizBlockCompressor.i diff --git a/library/bindings/PagedVolume.i b/bindings/PagedVolume.i similarity index 100% rename from library/bindings/PagedVolume.i rename to bindings/PagedVolume.i diff --git a/library/bindings/Pager.i b/bindings/Pager.i similarity index 100% rename from library/bindings/Pager.i rename to bindings/Pager.i diff --git a/library/bindings/Picking.i b/bindings/Picking.i similarity index 100% rename from library/bindings/Picking.i rename to bindings/Picking.i diff --git a/library/bindings/PolyVoxCore.i b/bindings/PolyVoxCore.i similarity index 100% rename from library/bindings/PolyVoxCore.i rename to bindings/PolyVoxCore.i diff --git a/library/bindings/RLEBlockCompressor.i b/bindings/RLEBlockCompressor.i similarity index 100% rename from library/bindings/RLEBlockCompressor.i rename to bindings/RLEBlockCompressor.i diff --git a/library/bindings/RawVolume.i b/bindings/RawVolume.i similarity index 100% rename from library/bindings/RawVolume.i rename to bindings/RawVolume.i diff --git a/library/bindings/Raycast.i b/bindings/Raycast.i similarity index 100% rename from library/bindings/Raycast.i rename to bindings/Raycast.i diff --git a/library/bindings/Region.i b/bindings/Region.i similarity index 100% rename from library/bindings/Region.i rename to bindings/Region.i diff --git a/library/bindings/SimpleVolume.i b/bindings/SimpleVolume.i similarity index 100% rename from library/bindings/SimpleVolume.i rename to bindings/SimpleVolume.i diff --git a/library/bindings/SimpleVolumeSampler.i b/bindings/SimpleVolumeSampler.i similarity index 100% rename from library/bindings/SimpleVolumeSampler.i rename to bindings/SimpleVolumeSampler.i diff --git a/library/bindings/SubArray.i b/bindings/SubArray.i similarity index 100% rename from library/bindings/SubArray.i rename to bindings/SubArray.i diff --git a/library/bindings/SurfaceMesh.i b/bindings/SurfaceMesh.i similarity index 100% rename from library/bindings/SurfaceMesh.i rename to bindings/SurfaceMesh.i diff --git a/library/bindings/TypeDef.i b/bindings/TypeDef.i similarity index 100% rename from library/bindings/TypeDef.i rename to bindings/TypeDef.i diff --git a/library/bindings/UncompressedBlock.i b/bindings/UncompressedBlock.i similarity index 100% rename from library/bindings/UncompressedBlock.i rename to bindings/UncompressedBlock.i diff --git a/library/bindings/Vector.i b/bindings/Vector.i similarity index 100% rename from library/bindings/Vector.i rename to bindings/Vector.i diff --git a/library/bindings/VertexTypes.i b/bindings/VertexTypes.i similarity index 100% rename from library/bindings/VertexTypes.i rename to bindings/VertexTypes.i diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 79467307..483cef00 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -26,7 +26,6 @@ PROJECT(PolyVox) add_subdirectory(PolyVoxCore) add_subdirectory(PolyVoxUtil) -add_subdirectory(bindings) #Set up install paths e.g. for PolyVoxConfig.cmake if(WIN32) From a296807ed90661c39759d20396f88a37720aa449 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 14:59:08 +0100 Subject: [PATCH 253/259] Removed PolyVoxUtil. --- examples/Basic/CMakeLists.txt | 7 --- examples/DecodeOnGPU/CMakeLists.txt | 7 --- examples/OpenGL/CMakeLists.txt | 7 --- examples/Paging/CMakeLists.txt | 7 --- examples/SmoothLOD/CMakeLists.txt | 7 --- library/CMakeLists.txt | 5 -- library/PolyVoxUtil/CMakeLists.txt | 92 ---------------------------- library/PolyVoxUtil/source/Dummy.cpp | 16 ----- tests/CMakeLists.txt | 3 +- 9 files changed, 1 insertion(+), 150 deletions(-) delete mode 100644 library/PolyVoxUtil/CMakeLists.txt delete mode 100644 library/PolyVoxUtil/source/Dummy.cpp diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 153b0570..98e42789 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -64,11 +64,4 @@ IF(WIN32) ARCHIVE DESTINATION Examples/OpenGL/lib COMPONENT example ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) ENDIF(WIN32) diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt index 3cb051f5..60a3bfb5 100644 --- a/examples/DecodeOnGPU/CMakeLists.txt +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -65,11 +65,4 @@ IF(WIN32) ARCHIVE DESTINATION Examples/OpenGL/lib COMPONENT example ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) ENDIF(WIN32) diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 129dac1b..ef950a07 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -67,11 +67,4 @@ IF(WIN32) ARCHIVE DESTINATION Examples/OpenGL/lib COMPONENT example ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) ENDIF(WIN32) diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index b256cfa5..cc67d64d 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -69,11 +69,4 @@ IF(WIN32) ARCHIVE DESTINATION Examples/OpenGL/lib COMPONENT example ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) ENDIF(WIN32) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index e11a715a..05cf87f3 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -67,11 +67,4 @@ IF(WIN32) ARCHIVE DESTINATION Examples/OpenGL/lib COMPONENT example ) - - #.dlls should be installed in shared builds. - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release) - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug) ENDIF(WIN32) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 483cef00..5e5e5e96 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -25,22 +25,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(PolyVox) add_subdirectory(PolyVoxCore) -add_subdirectory(PolyVoxUtil) #Set up install paths e.g. for PolyVoxConfig.cmake if(WIN32) set(CONFIG_FILE_DIR "CMake") set(PolyVoxCore_LIBRARY_INSTALL_DIRS "PolyVoxCore/lib") - set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "PolyVoxUtil/lib") set(PolyVoxCore_INCLUDE_INSTALL_DIRS "PolyVoxCore/include") - set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "PolyVoxUtil/include") set(PolyVox_DOC_INSTALL_DIR "PolyVox/doc") else(WIN32) set(CONFIG_FILE_DIR "share/PolyVox/cmake") set(PolyVoxCore_LIBRARY_INSTALL_DIRS "lib") - set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "lib") set(PolyVoxCore_INCLUDE_INSTALL_DIRS "include/PolyVoxCore") - set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "include/PolyVoxUtil") set(PolyVox_DOC_INSTALL_DIR "share/doc/packages/polyvox") endif(WIN32) diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt deleted file mode 100644 index 4df41a60..00000000 --- a/library/PolyVoxUtil/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) 2008-2012 Matt Williams -# Copyright (c) 2008-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -PROJECT(PolyVoxUtil) - -#Projects source files -SET(UTIL_SRC_FILES - source/Dummy.cpp -) - -#Projects headers files -SET(UTIL_INC_FILES - #Nothing here at the moment... -) - -ADD_DEFINITIONS(-DPOLYVOX_SHARED_EXPORTS) #Export symbols in the .dll - -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -SOURCE_GROUP("Source Files" FILES ${UTIL_SRC_FILES}) -SOURCE_GROUP("Header Files" FILES ${UTIL_INC_FILES}) - -#Tell CMake the paths -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include) -#There has to be a better way! -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/release ${PolyVoxCore_BINARY_DIR}) - -#Util -#Build -IF(LIBRARY_TYPE STREQUAL "STATIC") - ADD_LIBRARY(PolyVoxUtil STATIC ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) - IF(UNIX) - SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF() -ENDIF() -IF(LIBRARY_TYPE STREQUAL "DYNAMIC") - ADD_LIBRARY(PolyVoxUtil SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES}) - SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS") -ENDIF() -SET_PROPERTY(TARGET PolyVoxUtil PROPERTY FOLDER "Library") - -TARGET_LINK_LIBRARIES(PolyVoxUtil) -SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) -IF(MSVC) - SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "/W4 /wd4251 /wd4127") #Disable warning on STL exports -ENDIF(MSVC) - -#Install -IF(WIN32) - INSTALL(TARGETS PolyVoxUtil - RUNTIME DESTINATION PolyVoxUtil/bin COMPONENT library - LIBRARY DESTINATION PolyVoxUtil/lib COMPONENT library - ARCHIVE DESTINATION PolyVoxUtil/lib COMPONENT library - ) - - #Install the util header files. - INSTALL(DIRECTORY include DESTINATION PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) - - #On windows, we also install the debug information. It's unfortunate that we have to hard-code - #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I - #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS RelWithDebInfo) -ELSE(WIN32) - INSTALL(TARGETS PolyVoxUtil - RUNTIME DESTINATION bin COMPONENT library - LIBRARY DESTINATION lib COMPONENT library - ARCHIVE DESTINATION lib COMPONENT library - ) - - #Install the util header files. - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxUtil COMPONENT development PATTERN "*.svn*" EXCLUDE) -ENDIF(WIN32) diff --git a/library/PolyVoxUtil/source/Dummy.cpp b/library/PolyVoxUtil/source/Dummy.cpp deleted file mode 100644 index 73e5e376..00000000 --- a/library/PolyVoxUtil/source/Dummy.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "PolyVoxCore/Impl/TypeDef.h" - -namespace PolyVox -{ - class POLYVOX_API DummyClass - { - public: - int getx(void); - int x; - }; - - int DummyClass::getx(void) - { - return x; - } -} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fe6b35eb..02bdee0b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,9 +27,8 @@ MACRO(CREATE_TEST headerfile sourcefile executablename) UNSET(test_moc_SRCS) #clear out the MOCs from previous tests QT4_WRAP_CPP(test_moc_SRCS ${headerfile}) - LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR} ${PolyVoxUtil_BINARY_DIR}) ADD_EXECUTABLE(${executablename} ${sourcefile} ${test_moc_SRCS}) - TARGET_LINK_LIBRARIES(${executablename} PolyVoxUtil ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY}) + TARGET_LINK_LIBRARIES(${executablename} ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY}) #HACK. This is needed since everything is built in the base dir in Windows. As of 2.8 we should change this. IF(WIN32) SET(LATEST_TEST ${EXECUTABLE_OUTPUT_PATH}/${executablename}) From 6e2004d9c579d6f195b43df5a0f760d7651b241c Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 15:04:34 +0100 Subject: [PATCH 254/259] Really removed PolyVoxUtil. --- library/PolyVoxUtil/include/PolyVoxUtil/Placeholder.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 library/PolyVoxUtil/include/PolyVoxUtil/Placeholder.txt diff --git a/library/PolyVoxUtil/include/PolyVoxUtil/Placeholder.txt b/library/PolyVoxUtil/include/PolyVoxUtil/Placeholder.txt deleted file mode 100644 index eb0a80de..00000000 --- a/library/PolyVoxUtil/include/PolyVoxUtil/Placeholder.txt +++ /dev/null @@ -1 +0,0 @@ -I don't think Git allows empty directories, so this is just a placeholder until we decide what to do with PolyVoxUtil. \ No newline at end of file From 97bd3a232a7304b8cdf6bdb3e57077cdfadb8c34 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 15:21:33 +0100 Subject: [PATCH 255/259] Renamed 'library' folder to 'include' (as it just contains headers now). --- CMakeLists.txt | 2 +- {library => include}/CMakeLists.txt | 0 {library => include}/Doxyfile.in | 0 {library => include}/Mainpage.dox | 0 {library => include}/PolyVoxConfig.cmake.in | 0 {library => include}/PolyVoxCore/CMakeLists.txt | 1 - .../PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h | 0 .../PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl | 0 .../include/PolyVoxCore/AmbientOcclusionCalculator.h | 0 .../include/PolyVoxCore/AmbientOcclusionCalculator.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Array.h | 0 .../PolyVoxCore/include/PolyVoxCore/BaseVolume.h | 0 .../PolyVoxCore/include/PolyVoxCore/BaseVolume.inl | 0 .../PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl | 0 .../PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h | 0 .../PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl | 0 .../PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h | 0 .../include/PolyVoxCore/DefaultMarchingCubesController.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Density.h | 0 .../PolyVoxCore/include/PolyVoxCore/FilePager.h | 0 .../PolyVoxCore/include/PolyVoxCore/GradientEstimators.h | 0 .../PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/Config.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/Logging.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/Timer.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 0 .../PolyVoxCore/include/PolyVoxCore/Impl/Utility.h | 0 .../PolyVoxCore/include/PolyVoxCore/Interpolation.h | 0 .../PolyVoxCore/include/PolyVoxCore/IteratorController.h | 0 .../PolyVoxCore/include/PolyVoxCore/IteratorController.inl | 0 .../PolyVoxCore/include/PolyVoxCore/LargeVolume.h | 0 .../PolyVoxCore/include/PolyVoxCore/LowPassFilter.h | 0 .../PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl | 0 .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 0 .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Material.h | 0 .../PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Mesh.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Mesh.inl | 0 .../PolyVoxCore/include/PolyVoxCore/PagedVolume.h | 0 .../PolyVoxCore/include/PolyVoxCore/PagedVolume.inl | 0 .../PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl | 0 .../PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Picking.h | 0 .../PolyVoxCore/include/PolyVoxCore/Picking.inl | 0 .../include/PolyVoxCore/PolyVoxForwardDeclarations.h | 0 .../PolyVoxCore/include/PolyVoxCore/RawVolume.h | 0 .../PolyVoxCore/include/PolyVoxCore/RawVolume.inl | 0 .../PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Raycast.h | 0 .../PolyVoxCore/include/PolyVoxCore/Raycast.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Region.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Region.inl | 0 .../PolyVoxCore/include/PolyVoxCore/SimpleVolume.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Vector.h | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Vector.inl | 0 {library => include}/PolyVoxCore/include/PolyVoxCore/Vertex.h | 0 .../PolyVoxCore/include/PolyVoxCore/VolumeResampler.h | 0 .../PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl | 0 .../PolyVoxCore/include/PolyVoxCore/VoxelFilters.h | 0 .../PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl | 0 {library => include}/polyvox.qhcp.in | 0 67 files changed, 1 insertion(+), 2 deletions(-) rename {library => include}/CMakeLists.txt (100%) rename {library => include}/Doxyfile.in (100%) rename {library => include}/Mainpage.dox (100%) rename {library => include}/PolyVoxConfig.cmake.in (100%) rename {library => include}/PolyVoxCore/CMakeLists.txt (98%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Array.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/BaseVolume.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Density.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/FilePager.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/Config.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Interpolation.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/IteratorController.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/IteratorController.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/LargeVolume.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Material.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Mesh.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Mesh.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/PagedVolume.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Picking.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Picking.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/RawVolume.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/RawVolume.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Raycast.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Raycast.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Region.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Region.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Vector.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Vector.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/Vertex.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h (100%) rename {library => include}/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl (100%) rename {library => include}/polyvox.qhcp.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fe7322c..342fd9e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ endif() FIND_PACKAGE(Doxygen) -ADD_SUBDIRECTORY(library) +ADD_SUBDIRECTORY(include) diff --git a/library/CMakeLists.txt b/include/CMakeLists.txt similarity index 100% rename from library/CMakeLists.txt rename to include/CMakeLists.txt diff --git a/library/Doxyfile.in b/include/Doxyfile.in similarity index 100% rename from library/Doxyfile.in rename to include/Doxyfile.in diff --git a/library/Mainpage.dox b/include/Mainpage.dox similarity index 100% rename from library/Mainpage.dox rename to include/Mainpage.dox diff --git a/library/PolyVoxConfig.cmake.in b/include/PolyVoxConfig.cmake.in similarity index 100% rename from library/PolyVoxConfig.cmake.in rename to include/PolyVoxConfig.cmake.in diff --git a/library/PolyVoxCore/CMakeLists.txt b/include/PolyVoxCore/CMakeLists.txt similarity index 98% rename from library/PolyVoxCore/CMakeLists.txt rename to include/PolyVoxCore/CMakeLists.txt index c06c9c8a..d3e66eef 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/include/PolyVoxCore/CMakeLists.txt @@ -123,7 +123,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_D # Although we don't build anything for PolyVox, we still add this custom target (which # doesn't do anything) so that we can browse the source code from within Visual Studio. ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) -SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") #Install the core header files, including the ones in the Impl subfolder. IF(WIN32) diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h rename to include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl b/include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl rename to include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h rename to include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl rename to include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/include/PolyVoxCore/include/PolyVoxCore/Array.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Array.h rename to include/PolyVoxCore/include/PolyVoxCore/Array.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h b/include/PolyVoxCore/include/PolyVoxCore/BaseVolume.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/BaseVolume.h rename to include/PolyVoxCore/include/PolyVoxCore/BaseVolume.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl b/include/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl rename to include/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl b/include/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl rename to include/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h rename to include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl rename to include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/include/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h rename to include/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/include/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h rename to include/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/include/PolyVoxCore/include/PolyVoxCore/Density.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Density.h rename to include/PolyVoxCore/include/PolyVoxCore/Density.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/include/PolyVoxCore/include/PolyVoxCore/FilePager.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/FilePager.h rename to include/PolyVoxCore/include/PolyVoxCore/FilePager.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h b/include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h rename to include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl b/include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl rename to include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/Config.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/Config.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/include/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h rename to include/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Interpolation.h b/include/PolyVoxCore/include/PolyVoxCore/Interpolation.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Interpolation.h rename to include/PolyVoxCore/include/PolyVoxCore/Interpolation.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.h b/include/PolyVoxCore/include/PolyVoxCore/IteratorController.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/IteratorController.h rename to include/PolyVoxCore/include/PolyVoxCore/IteratorController.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl b/include/PolyVoxCore/include/PolyVoxCore/IteratorController.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/IteratorController.inl rename to include/PolyVoxCore/include/PolyVoxCore/IteratorController.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/include/PolyVoxCore/include/PolyVoxCore/LargeVolume.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h rename to include/PolyVoxCore/include/PolyVoxCore/LargeVolume.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h b/include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h rename to include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl b/include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl rename to include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h rename to include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl rename to include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/include/PolyVoxCore/include/PolyVoxCore/Material.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Material.h rename to include/PolyVoxCore/include/PolyVoxCore/Material.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h b/include/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h rename to include/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/include/PolyVoxCore/include/PolyVoxCore/Mesh.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Mesh.h rename to include/PolyVoxCore/include/PolyVoxCore/Mesh.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/include/PolyVoxCore/include/PolyVoxCore/Mesh.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Mesh.inl rename to include/PolyVoxCore/include/PolyVoxCore/Mesh.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/include/PolyVoxCore/include/PolyVoxCore/PagedVolume.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h rename to include/PolyVoxCore/include/PolyVoxCore/PagedVolume.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/include/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl rename to include/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl b/include/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl rename to include/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/include/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl rename to include/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Picking.h b/include/PolyVoxCore/include/PolyVoxCore/Picking.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Picking.h rename to include/PolyVoxCore/include/PolyVoxCore/Picking.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Picking.inl b/include/PolyVoxCore/include/PolyVoxCore/Picking.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Picking.inl rename to include/PolyVoxCore/include/PolyVoxCore/Picking.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/include/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h rename to include/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/include/PolyVoxCore/include/PolyVoxCore/RawVolume.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/RawVolume.h rename to include/PolyVoxCore/include/PolyVoxCore/RawVolume.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/include/PolyVoxCore/include/PolyVoxCore/RawVolume.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl rename to include/PolyVoxCore/include/PolyVoxCore/RawVolume.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/include/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl rename to include/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h b/include/PolyVoxCore/include/PolyVoxCore/Raycast.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Raycast.h rename to include/PolyVoxCore/include/PolyVoxCore/Raycast.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/include/PolyVoxCore/include/PolyVoxCore/Raycast.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Raycast.inl rename to include/PolyVoxCore/include/PolyVoxCore/Raycast.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/include/PolyVoxCore/include/PolyVoxCore/Region.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Region.h rename to include/PolyVoxCore/include/PolyVoxCore/Region.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.inl b/include/PolyVoxCore/include/PolyVoxCore/Region.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Region.inl rename to include/PolyVoxCore/include/PolyVoxCore/Region.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/include/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h rename to include/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.h b/include/PolyVoxCore/include/PolyVoxCore/Vector.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Vector.h rename to include/PolyVoxCore/include/PolyVoxCore/Vector.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/include/PolyVoxCore/include/PolyVoxCore/Vector.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Vector.inl rename to include/PolyVoxCore/include/PolyVoxCore/Vector.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vertex.h b/include/PolyVoxCore/include/PolyVoxCore/Vertex.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/Vertex.h rename to include/PolyVoxCore/include/PolyVoxCore/Vertex.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h rename to include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl rename to include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl diff --git a/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h b/include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h rename to include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl b/include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl similarity index 100% rename from library/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl rename to include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl diff --git a/library/polyvox.qhcp.in b/include/polyvox.qhcp.in similarity index 100% rename from library/polyvox.qhcp.in rename to include/polyvox.qhcp.in From 16a75d06063112e4204b86c4d30c45f0f95c8bbf Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 17:16:54 +0100 Subject: [PATCH 256/259] Reoranising header structure. --- examples/Basic/CMakeLists.txt | 3 +- examples/DecodeOnGPU/CMakeLists.txt | 3 +- examples/OpenGL/CMakeLists.txt | 3 +- examples/Paging/CMakeLists.txt | 3 +- examples/SmoothLOD/CMakeLists.txt | 3 +- include/CMakeLists.txt | 97 ++++++++++++- .../PolyVoxCore => }/AStarPathfinder.h | 0 .../PolyVoxCore => }/AStarPathfinder.inl | 0 .../AmbientOcclusionCalculator.h | 0 .../AmbientOcclusionCalculator.inl | 0 .../{include/PolyVoxCore => }/Array.h | 0 .../{include/PolyVoxCore => }/BaseVolume.h | 0 .../{include/PolyVoxCore => }/BaseVolume.inl | 0 .../PolyVoxCore => }/BaseVolumeSampler.inl | 0 include/PolyVoxCore/CMakeLists.txt | 133 ------------------ .../PolyVoxCore => }/CubicSurfaceExtractor.h | 0 .../CubicSurfaceExtractor.inl | 0 .../PolyVoxCore => }/DefaultIsQuadNeeded.h | 0 .../DefaultMarchingCubesController.h | 0 .../{include/PolyVoxCore => }/Density.h | 0 .../{include/PolyVoxCore => }/FilePager.h | 0 .../PolyVoxCore => }/GradientEstimators.h | 0 .../PolyVoxCore => }/GradientEstimators.inl | 0 .../Impl/AStarPathfinderImpl.h | 0 .../{include/PolyVoxCore => }/Impl/Config.h | 0 .../PolyVoxCore => }/Impl/ErrorHandling.h | 0 .../{include/PolyVoxCore => }/Impl/Logging.h | 0 .../Impl/MarchingCubesTables.h | 0 .../PolyVoxCore => }/Impl/RandomUnitVectors.h | 0 .../PolyVoxCore => }/Impl/RandomVectors.h | 0 .../{include/PolyVoxCore => }/Impl/Timer.h | 0 .../{include/PolyVoxCore => }/Impl/TypeDef.h | 0 .../{include/PolyVoxCore => }/Impl/Utility.h | 0 .../{include/PolyVoxCore => }/Interpolation.h | 0 .../PolyVoxCore => }/IteratorController.h | 0 .../PolyVoxCore => }/IteratorController.inl | 0 .../{include/PolyVoxCore => }/LargeVolume.h | 0 .../{include/PolyVoxCore => }/LowPassFilter.h | 0 .../PolyVoxCore => }/LowPassFilter.inl | 0 .../MarchingCubesSurfaceExtractor.h | 0 .../MarchingCubesSurfaceExtractor.inl | 0 .../{include/PolyVoxCore => }/Material.h | 0 .../PolyVoxCore => }/MaterialDensityPair.h | 0 .../{include/PolyVoxCore => }/Mesh.h | 0 .../{include/PolyVoxCore => }/Mesh.inl | 0 .../{include/PolyVoxCore => }/PagedVolume.h | 0 .../{include/PolyVoxCore => }/PagedVolume.inl | 0 .../PolyVoxCore => }/PagedVolumeChunk.inl | 0 .../PolyVoxCore => }/PagedVolumeSampler.inl | 0 .../{include/PolyVoxCore => }/Picking.h | 0 .../{include/PolyVoxCore => }/Picking.inl | 0 .../PolyVoxForwardDeclarations.h | 0 .../{include/PolyVoxCore => }/RawVolume.h | 0 .../{include/PolyVoxCore => }/RawVolume.inl | 0 .../PolyVoxCore => }/RawVolumeSampler.inl | 0 .../{include/PolyVoxCore => }/Raycast.h | 0 .../{include/PolyVoxCore => }/Raycast.inl | 0 .../{include/PolyVoxCore => }/Region.h | 0 .../{include/PolyVoxCore => }/Region.inl | 0 .../{include/PolyVoxCore => }/SimpleVolume.h | 0 .../{include/PolyVoxCore => }/Vector.h | 0 .../{include/PolyVoxCore => }/Vector.inl | 0 .../{include/PolyVoxCore => }/Vertex.h | 0 .../PolyVoxCore => }/VolumeResampler.h | 0 .../PolyVoxCore => }/VolumeResampler.inl | 0 .../{include/PolyVoxCore => }/VoxelFilters.h | 0 .../PolyVoxCore => }/VoxelFilters.inl | 0 tests/CMakeLists.txt | 2 +- 68 files changed, 101 insertions(+), 146 deletions(-) rename include/PolyVoxCore/{include/PolyVoxCore => }/AStarPathfinder.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/AStarPathfinder.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/AmbientOcclusionCalculator.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/AmbientOcclusionCalculator.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Array.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/BaseVolume.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/BaseVolume.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/BaseVolumeSampler.inl (100%) delete mode 100644 include/PolyVoxCore/CMakeLists.txt rename include/PolyVoxCore/{include/PolyVoxCore => }/CubicSurfaceExtractor.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/CubicSurfaceExtractor.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/DefaultIsQuadNeeded.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/DefaultMarchingCubesController.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Density.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/FilePager.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/GradientEstimators.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/GradientEstimators.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/AStarPathfinderImpl.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/Config.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/ErrorHandling.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/Logging.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/MarchingCubesTables.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/RandomUnitVectors.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/RandomVectors.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/Timer.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/TypeDef.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Impl/Utility.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Interpolation.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/IteratorController.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/IteratorController.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/LargeVolume.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/LowPassFilter.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/LowPassFilter.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/MarchingCubesSurfaceExtractor.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/MarchingCubesSurfaceExtractor.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Material.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/MaterialDensityPair.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Mesh.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Mesh.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/PagedVolume.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/PagedVolume.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/PagedVolumeChunk.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/PagedVolumeSampler.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Picking.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Picking.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/PolyVoxForwardDeclarations.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/RawVolume.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/RawVolume.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/RawVolumeSampler.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Raycast.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Raycast.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Region.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Region.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/SimpleVolume.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Vector.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Vector.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/Vertex.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/VolumeResampler.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/VolumeResampler.inl (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/VoxelFilters.h (100%) rename include/PolyVoxCore/{include/PolyVoxCore => }/VoxelFilters.inl (100%) diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index 98e42789..43cd16b7 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) diff --git a/examples/DecodeOnGPU/CMakeLists.txt b/examples/DecodeOnGPU/CMakeLists.txt index 60a3bfb5..071ba223 100644 --- a/examples/DecodeOnGPU/CMakeLists.txt +++ b/examples/DecodeOnGPU/CMakeLists.txt @@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index ef950a07..86770566 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -41,8 +41,7 @@ add_definitions(-DGLEW_STATIC) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index cc67d64d..f6a099d5 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -41,8 +41,7 @@ add_definitions(-DGLEW_STATIC) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) diff --git a/examples/SmoothLOD/CMakeLists.txt b/examples/SmoothLOD/CMakeLists.txt index 05cf87f3..d4e32582 100644 --- a/examples/SmoothLOD/CMakeLists.txt +++ b/examples/SmoothLOD/CMakeLists.txt @@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC) FIND_PACKAGE(OpenGL REQUIRED) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR}) -LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR}) #This will include the shader files inside the compiled binary QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 5e5e5e96..109d0a9e 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -22,9 +22,102 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(PolyVox) +PROJECT(PolyVoxHeaders) -add_subdirectory(PolyVoxCore) +#Projects headers files +SET(CORE_INC_FILES + PolyVoxCore/AmbientOcclusionCalculator.h + PolyVoxCore/AmbientOcclusionCalculator.inl + PolyVoxCore/Array.h + PolyVoxCore/AStarPathfinder.h + PolyVoxCore/AStarPathfinder.inl + PolyVoxCore/BaseVolume.h + PolyVoxCore/BaseVolume.inl + PolyVoxCore/BaseVolumeSampler.inl + PolyVoxCore/CubicSurfaceExtractor.h + PolyVoxCore/CubicSurfaceExtractor.inl + PolyVoxCore/DefaultIsQuadNeeded.h + PolyVoxCore/DefaultMarchingCubesController.h + PolyVoxCore/Density.h + PolyVoxCore/FilePager.h + PolyVoxCore/GradientEstimators.h + PolyVoxCore/GradientEstimators.inl + PolyVoxCore/Interpolation.h + PolyVoxCore/IteratorController.h + PolyVoxCore/IteratorController.inl + PolyVoxCore/LargeVolume.h + PolyVoxCore/LowPassFilter.h + PolyVoxCore/LowPassFilter.inl + PolyVoxCore/MarchingCubesSurfaceExtractor.h + PolyVoxCore/MarchingCubesSurfaceExtractor.inl + PolyVoxCore/Material.h + PolyVoxCore/MaterialDensityPair.h + PolyVoxCore/Mesh.h + PolyVoxCore/Mesh.inl + PolyVoxCore/PagedVolume.h + PolyVoxCore/PagedVolume.inl + PolyVoxCore/PagedVolumeChunk.inl + PolyVoxCore/PagedVolumeSampler.inl + PolyVoxCore/PolyVoxForwardDeclarations.h + PolyVoxCore/Picking.h + PolyVoxCore/Picking.inl + PolyVoxCore/RawVolume.h + PolyVoxCore/RawVolume.inl + PolyVoxCore/RawVolumeSampler.inl + PolyVoxCore/Raycast.h + PolyVoxCore/Raycast.inl + PolyVoxCore/Region.h + PolyVoxCore/Region.inl + PolyVoxCore/SimpleVolume.h + PolyVoxCore/Vector.h + PolyVoxCore/Vector.inl + PolyVoxCore/Vertex.h + PolyVoxCore/VolumeResampler.h + PolyVoxCore/VolumeResampler.inl + PolyVoxCore/VoxelFilters.h + PolyVoxCore/VoxelFilters.inl +) + +SET(IMPL_INC_FILES + PolyVoxCore/Impl/AStarPathfinderImpl.h + PolyVoxCore/Impl/Config.h + PolyVoxCore/Impl/ErrorHandling.h + PolyVoxCore/Impl/Logging.h + PolyVoxCore/Impl/MarchingCubesTables.h + PolyVoxCore/Impl/RandomUnitVectors.h + PolyVoxCore/Impl/RandomVectors.h + PolyVoxCore/Impl/Timer.h + PolyVoxCore/Impl/TypeDef.h + PolyVoxCore/Impl/Utility.h +) + +#NOTE: The following line should be uncommented when building shared libs. + +#"Sources" and "Headers" are the group names in Visual Studio. +#They may have other uses too... +#SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) +SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) + +#SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) +SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) + +#Tell CMake the paths +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) + +#Core + +#Build +# Although we don't build anything for PolyVox, we still add this custom target (which +# doesn't do anything) so that we can browse the source code from within Visual Studio. +ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) + +#Install the core header files, including the ones in the Impl subfolder. +IF(WIN32) + INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) +ELSE(WIN32) + + INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) +ENDIF(WIN32) #Set up install paths e.g. for PolyVoxConfig.cmake if(WIN32) diff --git a/include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/include/PolyVoxCore/AStarPathfinder.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h rename to include/PolyVoxCore/AStarPathfinder.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl b/include/PolyVoxCore/AStarPathfinder.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.inl rename to include/PolyVoxCore/AStarPathfinder.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/include/PolyVoxCore/AmbientOcclusionCalculator.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h rename to include/PolyVoxCore/AmbientOcclusionCalculator.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/include/PolyVoxCore/AmbientOcclusionCalculator.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl rename to include/PolyVoxCore/AmbientOcclusionCalculator.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Array.h b/include/PolyVoxCore/Array.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Array.h rename to include/PolyVoxCore/Array.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/BaseVolume.h b/include/PolyVoxCore/BaseVolume.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/BaseVolume.h rename to include/PolyVoxCore/BaseVolume.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl b/include/PolyVoxCore/BaseVolume.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/BaseVolume.inl rename to include/PolyVoxCore/BaseVolume.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl b/include/PolyVoxCore/BaseVolumeSampler.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl rename to include/PolyVoxCore/BaseVolumeSampler.inl diff --git a/include/PolyVoxCore/CMakeLists.txt b/include/PolyVoxCore/CMakeLists.txt deleted file mode 100644 index d3e66eef..00000000 --- a/include/PolyVoxCore/CMakeLists.txt +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright (c) 2008-2012 Matt Williams -# Copyright (c) 2008-2012 David Williams -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source -# distribution. - -PROJECT(PolyVoxCore) - -#Projects source files -SET(CORE_SRC_FILES - #source/AStarPathfinder.cpp -) - -#Projects headers files -SET(CORE_INC_FILES - include/PolyVoxCore/AmbientOcclusionCalculator.h - include/PolyVoxCore/AmbientOcclusionCalculator.inl - include/PolyVoxCore/Array.h - include/PolyVoxCore/AStarPathfinder.h - include/PolyVoxCore/AStarPathfinder.inl - include/PolyVoxCore/BaseVolume.h - include/PolyVoxCore/BaseVolume.inl - include/PolyVoxCore/BaseVolumeSampler.inl - include/PolyVoxCore/CubicSurfaceExtractor.h - include/PolyVoxCore/CubicSurfaceExtractor.inl - include/PolyVoxCore/DefaultIsQuadNeeded.h - include/PolyVoxCore/DefaultMarchingCubesController.h - include/PolyVoxCore/Density.h - include/PolyVoxCore/FilePager.h - include/PolyVoxCore/GradientEstimators.h - include/PolyVoxCore/GradientEstimators.inl - include/PolyVoxCore/Interpolation.h - include/PolyVoxCore/IteratorController.h - include/PolyVoxCore/IteratorController.inl - include/PolyVoxCore/LargeVolume.h - include/PolyVoxCore/LowPassFilter.h - include/PolyVoxCore/LowPassFilter.inl - include/PolyVoxCore/MarchingCubesSurfaceExtractor.h - include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl - include/PolyVoxCore/Material.h - include/PolyVoxCore/MaterialDensityPair.h - include/PolyVoxCore/Mesh.h - include/PolyVoxCore/Mesh.inl - include/PolyVoxCore/PagedVolume.h - include/PolyVoxCore/PagedVolume.inl - include/PolyVoxCore/PagedVolumeChunk.inl - include/PolyVoxCore/PagedVolumeSampler.inl - include/PolyVoxCore/PolyVoxForwardDeclarations.h - include/PolyVoxCore/Picking.h - include/PolyVoxCore/Picking.inl - include/PolyVoxCore/RawVolume.h - include/PolyVoxCore/RawVolume.inl - include/PolyVoxCore/RawVolumeSampler.inl - include/PolyVoxCore/Raycast.h - include/PolyVoxCore/Raycast.inl - include/PolyVoxCore/Region.h - include/PolyVoxCore/Region.inl - include/PolyVoxCore/SimpleVolume.h - include/PolyVoxCore/Vector.h - include/PolyVoxCore/Vector.inl - include/PolyVoxCore/Vertex.h - include/PolyVoxCore/VolumeResampler.h - include/PolyVoxCore/VolumeResampler.inl - include/PolyVoxCore/VoxelFilters.h - include/PolyVoxCore/VoxelFilters.inl -) - -SET(IMPL_SRC_FILES - #source/Impl/ErrorHandling.cpp - #source/Impl/Logging.cpp - #source/Impl/MarchingCubesTables.cpp - #source/Impl/RandomUnitVectors.cpp - #source/Impl/RandomVectors.cpp - #source/Impl/Timer.cpp - #source/Impl/Utility.cpp -) - -SET(IMPL_INC_FILES - include/PolyVoxCore/Impl/AStarPathfinderImpl.h - include/PolyVoxCore/Impl/Config.h - include/PolyVoxCore/Impl/ErrorHandling.h - include/PolyVoxCore/Impl/Logging.h - include/PolyVoxCore/Impl/MarchingCubesTables.h - include/PolyVoxCore/Impl/RandomUnitVectors.h - include/PolyVoxCore/Impl/RandomVectors.h - include/PolyVoxCore/Impl/Timer.h - include/PolyVoxCore/Impl/TypeDef.h - include/PolyVoxCore/Impl/Utility.h -) - -#NOTE: The following line should be uncommented when building shared libs. - -#"Sources" and "Headers" are the group names in Visual Studio. -#They may have other uses too... -#SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES}) -SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES}) - -#SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES}) -SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES}) - -#Tell CMake the paths -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) - -#Core - -#Build -# Although we don't build anything for PolyVox, we still add this custom target (which -# doesn't do anything) so that we can browse the source code from within Visual Studio. -ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) - -#Install the core header files, including the ones in the Impl subfolder. -IF(WIN32) - INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) -ELSE(WIN32) - - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) -ENDIF(WIN32) diff --git a/include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h b/include/PolyVoxCore/CubicSurfaceExtractor.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.h rename to include/PolyVoxCore/CubicSurfaceExtractor.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/include/PolyVoxCore/CubicSurfaceExtractor.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl rename to include/PolyVoxCore/CubicSurfaceExtractor.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/include/PolyVoxCore/DefaultIsQuadNeeded.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h rename to include/PolyVoxCore/DefaultIsQuadNeeded.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/include/PolyVoxCore/DefaultMarchingCubesController.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h rename to include/PolyVoxCore/DefaultMarchingCubesController.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Density.h b/include/PolyVoxCore/Density.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Density.h rename to include/PolyVoxCore/Density.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/FilePager.h b/include/PolyVoxCore/FilePager.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/FilePager.h rename to include/PolyVoxCore/FilePager.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h b/include/PolyVoxCore/GradientEstimators.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.h rename to include/PolyVoxCore/GradientEstimators.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl b/include/PolyVoxCore/GradientEstimators.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl rename to include/PolyVoxCore/GradientEstimators.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h b/include/PolyVoxCore/Impl/AStarPathfinderImpl.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/AStarPathfinderImpl.h rename to include/PolyVoxCore/Impl/AStarPathfinderImpl.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/Config.h b/include/PolyVoxCore/Impl/Config.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/Config.h rename to include/PolyVoxCore/Impl/Config.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/include/PolyVoxCore/Impl/ErrorHandling.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h rename to include/PolyVoxCore/Impl/ErrorHandling.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h b/include/PolyVoxCore/Impl/Logging.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h rename to include/PolyVoxCore/Impl/Logging.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h b/include/PolyVoxCore/Impl/MarchingCubesTables.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h rename to include/PolyVoxCore/Impl/MarchingCubesTables.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h b/include/PolyVoxCore/Impl/RandomUnitVectors.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/RandomUnitVectors.h rename to include/PolyVoxCore/Impl/RandomUnitVectors.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h b/include/PolyVoxCore/Impl/RandomVectors.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/RandomVectors.h rename to include/PolyVoxCore/Impl/RandomVectors.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h b/include/PolyVoxCore/Impl/Timer.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/Timer.h rename to include/PolyVoxCore/Impl/Timer.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/include/PolyVoxCore/Impl/TypeDef.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h rename to include/PolyVoxCore/Impl/TypeDef.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/include/PolyVoxCore/Impl/Utility.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h rename to include/PolyVoxCore/Impl/Utility.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Interpolation.h b/include/PolyVoxCore/Interpolation.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Interpolation.h rename to include/PolyVoxCore/Interpolation.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/IteratorController.h b/include/PolyVoxCore/IteratorController.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/IteratorController.h rename to include/PolyVoxCore/IteratorController.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/IteratorController.inl b/include/PolyVoxCore/IteratorController.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/IteratorController.inl rename to include/PolyVoxCore/IteratorController.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/include/PolyVoxCore/LargeVolume.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/LargeVolume.h rename to include/PolyVoxCore/LargeVolume.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h b/include/PolyVoxCore/LowPassFilter.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.h rename to include/PolyVoxCore/LowPassFilter.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl b/include/PolyVoxCore/LowPassFilter.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl rename to include/PolyVoxCore/LowPassFilter.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h rename to include/PolyVoxCore/MarchingCubesSurfaceExtractor.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl rename to include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Material.h b/include/PolyVoxCore/Material.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Material.h rename to include/PolyVoxCore/Material.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h b/include/PolyVoxCore/MaterialDensityPair.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h rename to include/PolyVoxCore/MaterialDensityPair.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Mesh.h b/include/PolyVoxCore/Mesh.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Mesh.h rename to include/PolyVoxCore/Mesh.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/include/PolyVoxCore/Mesh.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Mesh.inl rename to include/PolyVoxCore/Mesh.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/include/PolyVoxCore/PagedVolume.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/PagedVolume.h rename to include/PolyVoxCore/PagedVolume.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/include/PolyVoxCore/PagedVolume.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl rename to include/PolyVoxCore/PagedVolume.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl b/include/PolyVoxCore/PagedVolumeChunk.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/PagedVolumeChunk.inl rename to include/PolyVoxCore/PagedVolumeChunk.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/include/PolyVoxCore/PagedVolumeSampler.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl rename to include/PolyVoxCore/PagedVolumeSampler.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Picking.h b/include/PolyVoxCore/Picking.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Picking.h rename to include/PolyVoxCore/Picking.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Picking.inl b/include/PolyVoxCore/Picking.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Picking.inl rename to include/PolyVoxCore/Picking.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/include/PolyVoxCore/PolyVoxForwardDeclarations.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h rename to include/PolyVoxCore/PolyVoxForwardDeclarations.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/include/PolyVoxCore/RawVolume.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/RawVolume.h rename to include/PolyVoxCore/RawVolume.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/include/PolyVoxCore/RawVolume.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/RawVolume.inl rename to include/PolyVoxCore/RawVolume.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/include/PolyVoxCore/RawVolumeSampler.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl rename to include/PolyVoxCore/RawVolumeSampler.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Raycast.h b/include/PolyVoxCore/Raycast.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Raycast.h rename to include/PolyVoxCore/Raycast.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/include/PolyVoxCore/Raycast.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Raycast.inl rename to include/PolyVoxCore/Raycast.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Region.h b/include/PolyVoxCore/Region.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Region.h rename to include/PolyVoxCore/Region.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Region.inl b/include/PolyVoxCore/Region.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Region.inl rename to include/PolyVoxCore/Region.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/include/PolyVoxCore/SimpleVolume.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h rename to include/PolyVoxCore/SimpleVolume.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Vector.h b/include/PolyVoxCore/Vector.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Vector.h rename to include/PolyVoxCore/Vector.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/Vector.inl b/include/PolyVoxCore/Vector.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Vector.inl rename to include/PolyVoxCore/Vector.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/Vertex.h b/include/PolyVoxCore/Vertex.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/Vertex.h rename to include/PolyVoxCore/Vertex.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/include/PolyVoxCore/VolumeResampler.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h rename to include/PolyVoxCore/VolumeResampler.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/include/PolyVoxCore/VolumeResampler.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl rename to include/PolyVoxCore/VolumeResampler.inl diff --git a/include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h b/include/PolyVoxCore/VoxelFilters.h similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.h rename to include/PolyVoxCore/VoxelFilters.h diff --git a/include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl b/include/PolyVoxCore/VoxelFilters.inl similarity index 100% rename from include/PolyVoxCore/include/PolyVoxCore/VoxelFilters.inl rename to include/PolyVoxCore/VoxelFilters.inl diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 02bdee0b..bccadd75 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,7 +44,7 @@ MACRO(CREATE_TEST headerfile sourcefile executablename) ENDIF() ENDMACRO(CREATE_TEST) -INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${PolyVoxHeaders_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) REMOVE_DEFINITIONS(-DQT_GUI_LIB) #Make sure the tests don't link to the QtGui # Test Template. Copy and paste this template for consistant naming. From 049a77cd0cac1c0bfbde93645a8fd594eaaa29ec Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 17:26:36 +0100 Subject: [PATCH 257/259] Moved all headers from 'PolyVoxCore' to 'PolyVox', as we no longer have the core/util distinction. --- examples/Basic/main.cpp | 8 +- examples/DecodeOnGPU/main.cpp | 8 +- examples/OpenGL/Shapes.cpp | 2 +- examples/OpenGL/Shapes.h | 4 +- examples/OpenGL/main.cpp | 14 +- examples/Paging/main.cpp | 10 +- examples/SmoothLOD/main.cpp | 12 +- examples/common/OpenGLWidget.h | 2 +- include/CMakeLists.txt | 120 +++++++++--------- .../AStarPathfinder.h | 2 +- .../AStarPathfinder.inl | 2 +- .../AmbientOcclusionCalculator.h | 12 +- .../AmbientOcclusionCalculator.inl | 0 include/{PolyVoxCore => PolyVox}/Array.h | 2 +- include/{PolyVoxCore => PolyVox}/BaseVolume.h | 8 +- .../{PolyVoxCore => PolyVox}/BaseVolume.inl | 0 .../BaseVolumeSampler.inl | 2 +- .../CubicSurfaceExtractor.h | 12 +- .../CubicSurfaceExtractor.inl | 2 +- .../DefaultIsQuadNeeded.h | 2 +- .../DefaultMarchingCubesController.h | 2 +- include/{PolyVoxCore => PolyVox}/Density.h | 2 +- include/{PolyVoxCore => PolyVox}/FilePager.h | 6 +- .../GradientEstimators.h | 6 +- .../GradientEstimators.inl | 0 .../Impl/AStarPathfinderImpl.h | 2 +- .../{PolyVoxCore => PolyVox}/Impl/Config.h | 0 .../Impl/ErrorHandling.h | 4 +- .../{PolyVoxCore => PolyVox}/Impl/Logging.h | 2 +- .../Impl/MarchingCubesTables.h | 2 +- .../Impl/RandomUnitVectors.h | 4 +- .../Impl/RandomVectors.h | 4 +- include/{PolyVoxCore => PolyVox}/Impl/Timer.h | 0 .../{PolyVoxCore => PolyVox}/Impl/TypeDef.h | 0 .../{PolyVoxCore => PolyVox}/Impl/Utility.h | 2 +- .../{PolyVoxCore => PolyVox}/Interpolation.h | 0 .../IteratorController.h | 4 +- .../IteratorController.inl | 0 .../{PolyVoxCore => PolyVox}/LargeVolume.h | 0 .../{PolyVoxCore => PolyVox}/LowPassFilter.h | 8 +- .../LowPassFilter.inl | 0 .../MarchingCubesSurfaceExtractor.h | 12 +- .../MarchingCubesSurfaceExtractor.inl | 2 +- include/{PolyVoxCore => PolyVox}/Material.h | 2 +- .../MaterialDensityPair.h | 4 +- include/{PolyVoxCore => PolyVox}/Mesh.h | 8 +- include/{PolyVoxCore => PolyVox}/Mesh.inl | 0 .../{PolyVoxCore => PolyVox}/PagedVolume.h | 12 +- .../{PolyVoxCore => PolyVox}/PagedVolume.inl | 2 +- .../PagedVolumeChunk.inl | 2 +- .../PagedVolumeSampler.inl | 0 include/{PolyVoxCore => PolyVox}/Picking.h | 4 +- include/{PolyVoxCore => PolyVox}/Picking.inl | 2 +- .../PolyVoxForwardDeclarations.h | 0 include/{PolyVoxCore => PolyVox}/RawVolume.h | 10 +- .../{PolyVoxCore => PolyVox}/RawVolume.inl | 0 .../RawVolumeSampler.inl | 0 include/{PolyVoxCore => PolyVox}/Raycast.h | 4 +- include/{PolyVoxCore => PolyVox}/Raycast.inl | 0 include/{PolyVoxCore => PolyVox}/Region.h | 4 +- include/{PolyVoxCore => PolyVox}/Region.inl | 0 .../{PolyVoxCore => PolyVox}/SimpleVolume.h | 0 include/{PolyVoxCore => PolyVox}/Vector.h | 2 +- include/{PolyVoxCore => PolyVox}/Vector.inl | 0 include/{PolyVoxCore => PolyVox}/Vertex.h | 2 +- .../VolumeResampler.h | 4 +- .../VolumeResampler.inl | 2 +- .../{PolyVoxCore => PolyVox}/VoxelFilters.h | 2 +- .../{PolyVoxCore => PolyVox}/VoxelFilters.inl | 0 tests/TestAStarPathfinder.cpp | 6 +- tests/TestAmbientOcclusionGenerator.cpp | 4 +- tests/TestArray.cpp | 2 +- tests/TestCubicSurfaceExtractor.cpp | 12 +- tests/TestLowPassFilter.cpp | 6 +- tests/TestPicking.cpp | 4 +- tests/TestRaycast.cpp | 8 +- tests/TestRegion.cpp | 2 +- tests/TestSurfaceExtractor.cpp | 12 +- tests/TestVolumeSubclass.cpp | 10 +- tests/testmaterial.cpp | 2 +- tests/testvector.cpp | 2 +- tests/testvolume.cpp | 6 +- tests/testvolume.h | 2 +- 83 files changed, 215 insertions(+), 215 deletions(-) rename include/{PolyVoxCore => PolyVox}/AStarPathfinder.h (99%) rename include/{PolyVoxCore => PolyVox}/AStarPathfinder.inl (99%) rename include/{PolyVoxCore => PolyVox}/AmbientOcclusionCalculator.h (92%) rename include/{PolyVoxCore => PolyVox}/AmbientOcclusionCalculator.inl (100%) rename include/{PolyVoxCore => PolyVox}/Array.h (98%) rename include/{PolyVoxCore => PolyVox}/BaseVolume.h (98%) rename include/{PolyVoxCore => PolyVox}/BaseVolume.inl (100%) rename include/{PolyVoxCore => PolyVox}/BaseVolumeSampler.inl (99%) rename include/{PolyVoxCore => PolyVox}/CubicSurfaceExtractor.h (98%) rename include/{PolyVoxCore => PolyVox}/CubicSurfaceExtractor.inl (99%) rename include/{PolyVoxCore => PolyVox}/DefaultIsQuadNeeded.h (94%) rename include/{PolyVoxCore => PolyVox}/DefaultMarchingCubesController.h (99%) rename include/{PolyVoxCore => PolyVox}/Density.h (97%) rename include/{PolyVoxCore => PolyVox}/FilePager.h (98%) rename include/{PolyVoxCore => PolyVox}/GradientEstimators.h (95%) rename include/{PolyVoxCore => PolyVox}/GradientEstimators.inl (100%) rename include/{PolyVoxCore => PolyVox}/Impl/AStarPathfinderImpl.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/Config.h (100%) rename include/{PolyVoxCore => PolyVox}/Impl/ErrorHandling.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/Logging.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/MarchingCubesTables.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/RandomUnitVectors.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/RandomVectors.h (99%) rename include/{PolyVoxCore => PolyVox}/Impl/Timer.h (100%) rename include/{PolyVoxCore => PolyVox}/Impl/TypeDef.h (100%) rename include/{PolyVoxCore => PolyVox}/Impl/Utility.h (98%) rename include/{PolyVoxCore => PolyVox}/Interpolation.h (100%) rename include/{PolyVoxCore => PolyVox}/IteratorController.h (94%) rename include/{PolyVoxCore => PolyVox}/IteratorController.inl (100%) rename include/{PolyVoxCore => PolyVox}/LargeVolume.h (100%) rename include/{PolyVoxCore => PolyVox}/LowPassFilter.h (90%) rename include/{PolyVoxCore => PolyVox}/LowPassFilter.inl (100%) rename include/{PolyVoxCore => PolyVox}/MarchingCubesSurfaceExtractor.h (98%) rename include/{PolyVoxCore => PolyVox}/MarchingCubesSurfaceExtractor.inl (99%) rename include/{PolyVoxCore => PolyVox}/Material.h (96%) rename include/{PolyVoxCore => PolyVox}/MaterialDensityPair.h (96%) rename include/{PolyVoxCore => PolyVox}/Mesh.h (93%) rename include/{PolyVoxCore => PolyVox}/Mesh.inl (100%) rename include/{PolyVoxCore => PolyVox}/PagedVolume.h (98%) rename include/{PolyVoxCore => PolyVox}/PagedVolume.inl (99%) rename include/{PolyVoxCore => PolyVox}/PagedVolumeChunk.inl (99%) rename include/{PolyVoxCore => PolyVox}/PagedVolumeSampler.inl (100%) rename include/{PolyVoxCore => PolyVox}/Picking.h (96%) rename include/{PolyVoxCore => PolyVox}/Picking.inl (98%) rename include/{PolyVoxCore => PolyVox}/PolyVoxForwardDeclarations.h (100%) rename include/{PolyVoxCore => PolyVox}/RawVolume.h (97%) rename include/{PolyVoxCore => PolyVox}/RawVolume.inl (100%) rename include/{PolyVoxCore => PolyVox}/RawVolumeSampler.inl (100%) rename include/{PolyVoxCore => PolyVox}/Raycast.h (98%) rename include/{PolyVoxCore => PolyVox}/Raycast.inl (100%) rename include/{PolyVoxCore => PolyVox}/Region.h (99%) rename include/{PolyVoxCore => PolyVox}/Region.inl (100%) rename include/{PolyVoxCore => PolyVox}/SimpleVolume.h (100%) rename include/{PolyVoxCore => PolyVox}/Vector.h (99%) rename include/{PolyVoxCore => PolyVox}/Vector.inl (100%) rename include/{PolyVoxCore => PolyVox}/Vertex.h (97%) rename include/{PolyVoxCore => PolyVox}/VolumeResampler.h (95%) rename include/{PolyVoxCore => PolyVox}/VolumeResampler.inl (99%) rename include/{PolyVoxCore => PolyVox}/VoxelFilters.h (96%) rename include/{PolyVoxCore => PolyVox}/VoxelFilters.inl (100%) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index b2d7bb3d..3fba8964 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -23,10 +23,10 @@ freely, subject to the following restrictions: #include "OpenGLWidget.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/CubicSurfaceExtractor.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/PagedVolume.h" #include diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index a13dd677..52091119 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -23,10 +23,10 @@ freely, subject to the following restrictions: #include "OpenGLWidget.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/CubicSurfaceExtractor.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/PagedVolume.h" #include diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 434ff1ca..1ebe6e58 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "Shapes.h" -#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVox/MaterialDensityPair.h" using namespace PolyVox; diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index 140fdea3..f2f5b193 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -24,8 +24,8 @@ freely, subject to the following restrictions: #ifndef __OpenGLExample_Shapes_H__ #define __OpenGLExample_Shapes_H__ -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/MaterialDensityPair.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/MaterialDensityPair.h" void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index a76c2800..6e94c5b8 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -21,13 +21,13 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/LowPassFilter.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/Impl/Utility.h" +#include "PolyVox/FilePager.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/MaterialDensityPair.h" +#include "PolyVox/LowPassFilter.h" +#include "PolyVox/RawVolume.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/Impl/Utility.h" #include "Shapes.h" diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index a3e60356..09b325d8 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -24,11 +24,11 @@ freely, subject to the following restrictions: #include "OpenGLWidget.h" #include "Perlin.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/MaterialDensityPair.h" +#include "PolyVox/CubicSurfaceExtractor.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/PagedVolume.h" #include diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index da90282c..b8c56f08 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -23,12 +23,12 @@ freely, subject to the following restrictions: #include "OpenGLWidget.h" -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/VolumeResampler.h" +#include "PolyVox/Density.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/RawVolume.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/VolumeResampler.h" #include diff --git a/examples/common/OpenGLWidget.h b/examples/common/OpenGLWidget.h index 4112a2fa..ba8fdedc 100644 --- a/examples/common/OpenGLWidget.h +++ b/examples/common/OpenGLWidget.h @@ -24,7 +24,7 @@ distribution. #ifndef __BasicExample_OpenGLWidget_H__ #define __BasicExample_OpenGLWidget_H__ -#include "PolyVoxCore/Mesh.h" +#include "PolyVox/Mesh.h" #include "glew/glew.h" diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 109d0a9e..db01270d 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -26,69 +26,69 @@ PROJECT(PolyVoxHeaders) #Projects headers files SET(CORE_INC_FILES - PolyVoxCore/AmbientOcclusionCalculator.h - PolyVoxCore/AmbientOcclusionCalculator.inl - PolyVoxCore/Array.h - PolyVoxCore/AStarPathfinder.h - PolyVoxCore/AStarPathfinder.inl - PolyVoxCore/BaseVolume.h - PolyVoxCore/BaseVolume.inl - PolyVoxCore/BaseVolumeSampler.inl - PolyVoxCore/CubicSurfaceExtractor.h - PolyVoxCore/CubicSurfaceExtractor.inl - PolyVoxCore/DefaultIsQuadNeeded.h - PolyVoxCore/DefaultMarchingCubesController.h - PolyVoxCore/Density.h - PolyVoxCore/FilePager.h - PolyVoxCore/GradientEstimators.h - PolyVoxCore/GradientEstimators.inl - PolyVoxCore/Interpolation.h - PolyVoxCore/IteratorController.h - PolyVoxCore/IteratorController.inl - PolyVoxCore/LargeVolume.h - PolyVoxCore/LowPassFilter.h - PolyVoxCore/LowPassFilter.inl - PolyVoxCore/MarchingCubesSurfaceExtractor.h - PolyVoxCore/MarchingCubesSurfaceExtractor.inl - PolyVoxCore/Material.h - PolyVoxCore/MaterialDensityPair.h - PolyVoxCore/Mesh.h - PolyVoxCore/Mesh.inl - PolyVoxCore/PagedVolume.h - PolyVoxCore/PagedVolume.inl - PolyVoxCore/PagedVolumeChunk.inl - PolyVoxCore/PagedVolumeSampler.inl - PolyVoxCore/PolyVoxForwardDeclarations.h - PolyVoxCore/Picking.h - PolyVoxCore/Picking.inl - PolyVoxCore/RawVolume.h - PolyVoxCore/RawVolume.inl - PolyVoxCore/RawVolumeSampler.inl - PolyVoxCore/Raycast.h - PolyVoxCore/Raycast.inl - PolyVoxCore/Region.h - PolyVoxCore/Region.inl - PolyVoxCore/SimpleVolume.h - PolyVoxCore/Vector.h - PolyVoxCore/Vector.inl - PolyVoxCore/Vertex.h - PolyVoxCore/VolumeResampler.h - PolyVoxCore/VolumeResampler.inl - PolyVoxCore/VoxelFilters.h - PolyVoxCore/VoxelFilters.inl + PolyVox/AmbientOcclusionCalculator.h + PolyVox/AmbientOcclusionCalculator.inl + PolyVox/Array.h + PolyVox/AStarPathfinder.h + PolyVox/AStarPathfinder.inl + PolyVox/BaseVolume.h + PolyVox/BaseVolume.inl + PolyVox/BaseVolumeSampler.inl + PolyVox/CubicSurfaceExtractor.h + PolyVox/CubicSurfaceExtractor.inl + PolyVox/DefaultIsQuadNeeded.h + PolyVox/DefaultMarchingCubesController.h + PolyVox/Density.h + PolyVox/FilePager.h + PolyVox/GradientEstimators.h + PolyVox/GradientEstimators.inl + PolyVox/Interpolation.h + PolyVox/IteratorController.h + PolyVox/IteratorController.inl + PolyVox/LargeVolume.h + PolyVox/LowPassFilter.h + PolyVox/LowPassFilter.inl + PolyVox/MarchingCubesSurfaceExtractor.h + PolyVox/MarchingCubesSurfaceExtractor.inl + PolyVox/Material.h + PolyVox/MaterialDensityPair.h + PolyVox/Mesh.h + PolyVox/Mesh.inl + PolyVox/PagedVolume.h + PolyVox/PagedVolume.inl + PolyVox/PagedVolumeChunk.inl + PolyVox/PagedVolumeSampler.inl + PolyVox/PolyVoxForwardDeclarations.h + PolyVox/Picking.h + PolyVox/Picking.inl + PolyVox/RawVolume.h + PolyVox/RawVolume.inl + PolyVox/RawVolumeSampler.inl + PolyVox/Raycast.h + PolyVox/Raycast.inl + PolyVox/Region.h + PolyVox/Region.inl + PolyVox/SimpleVolume.h + PolyVox/Vector.h + PolyVox/Vector.inl + PolyVox/Vertex.h + PolyVox/VolumeResampler.h + PolyVox/VolumeResampler.inl + PolyVox/VoxelFilters.h + PolyVox/VoxelFilters.inl ) SET(IMPL_INC_FILES - PolyVoxCore/Impl/AStarPathfinderImpl.h - PolyVoxCore/Impl/Config.h - PolyVoxCore/Impl/ErrorHandling.h - PolyVoxCore/Impl/Logging.h - PolyVoxCore/Impl/MarchingCubesTables.h - PolyVoxCore/Impl/RandomUnitVectors.h - PolyVoxCore/Impl/RandomVectors.h - PolyVoxCore/Impl/Timer.h - PolyVoxCore/Impl/TypeDef.h - PolyVoxCore/Impl/Utility.h + PolyVox/Impl/AStarPathfinderImpl.h + PolyVox/Impl/Config.h + PolyVox/Impl/ErrorHandling.h + PolyVox/Impl/Logging.h + PolyVox/Impl/MarchingCubesTables.h + PolyVox/Impl/RandomUnitVectors.h + PolyVox/Impl/RandomVectors.h + PolyVox/Impl/Timer.h + PolyVox/Impl/TypeDef.h + PolyVox/Impl/Utility.h ) #NOTE: The following line should be uncommented when building shared libs. diff --git a/include/PolyVoxCore/AStarPathfinder.h b/include/PolyVox/AStarPathfinder.h similarity index 99% rename from include/PolyVoxCore/AStarPathfinder.h rename to include/PolyVox/AStarPathfinder.h index 0c9d7a89..d453cff3 100644 --- a/include/PolyVoxCore/AStarPathfinder.h +++ b/include/PolyVox/AStarPathfinder.h @@ -224,6 +224,6 @@ namespace PolyVox }; } -#include "PolyVoxCore/AStarPathfinder.inl" +#include "PolyVox/AStarPathfinder.inl" #endif //__PolyVox_AStarPathfinder_H__ diff --git a/include/PolyVoxCore/AStarPathfinder.inl b/include/PolyVox/AStarPathfinder.inl similarity index 99% rename from include/PolyVoxCore/AStarPathfinder.inl rename to include/PolyVox/AStarPathfinder.inl index e0c570bd..42f1cf35 100644 --- a/include/PolyVoxCore/AStarPathfinder.inl +++ b/include/PolyVox/AStarPathfinder.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/ErrorHandling.h" +#include "PolyVox/Impl/ErrorHandling.h" namespace PolyVox { diff --git a/include/PolyVoxCore/AmbientOcclusionCalculator.h b/include/PolyVox/AmbientOcclusionCalculator.h similarity index 92% rename from include/PolyVoxCore/AmbientOcclusionCalculator.h rename to include/PolyVox/AmbientOcclusionCalculator.h index b9ca636a..2560127d 100644 --- a/include/PolyVoxCore/AmbientOcclusionCalculator.h +++ b/include/PolyVox/AmbientOcclusionCalculator.h @@ -27,13 +27,13 @@ freely, subject to the following restrictions: #include "Impl/RandomUnitVectors.h" #include "Impl/RandomVectors.h" -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Raycast.h" +#include "PolyVox/Array.h" +#include "PolyVox/Region.h" +#include "PolyVox/Raycast.h" //These two should not be here! -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/Material.h" +#include "PolyVox/PagedVolume.h" #include @@ -77,6 +77,6 @@ namespace PolyVox void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback); } -#include "PolyVoxCore/AmbientOcclusionCalculator.inl" +#include "PolyVox/AmbientOcclusionCalculator.inl" #endif //__AmbientOcclusionCalculator_H__ diff --git a/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/include/PolyVox/AmbientOcclusionCalculator.inl similarity index 100% rename from include/PolyVoxCore/AmbientOcclusionCalculator.inl rename to include/PolyVox/AmbientOcclusionCalculator.inl diff --git a/include/PolyVoxCore/Array.h b/include/PolyVox/Array.h similarity index 98% rename from include/PolyVoxCore/Array.h rename to include/PolyVox/Array.h index aa03f604..68f54db5 100644 --- a/include/PolyVoxCore/Array.h +++ b/include/PolyVox/Array.h @@ -24,7 +24,7 @@ distribution. #ifndef __PolyVox_Array_H__ #define __PolyVox_Array_H__ -#include +#include #include diff --git a/include/PolyVoxCore/BaseVolume.h b/include/PolyVox/BaseVolume.h similarity index 98% rename from include/PolyVoxCore/BaseVolume.h rename to include/PolyVox/BaseVolume.h index 6947188f..57898ffb 100644 --- a/include/PolyVoxCore/BaseVolume.h +++ b/include/PolyVox/BaseVolume.h @@ -24,8 +24,8 @@ freely, subject to the following restrictions: #ifndef __PolyVox_BaseVolume_H__ #define __PolyVox_BaseVolume_H__ -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Region.h" +#include "PolyVox/Vector.h" #include @@ -211,7 +211,7 @@ namespace PolyVox }; } -#include "PolyVoxCore/BaseVolume.inl" -#include "PolyVoxCore/BaseVolumeSampler.inl" +#include "PolyVox/BaseVolume.inl" +#include "PolyVox/BaseVolumeSampler.inl" #endif //__PolyVox_BaseVolume_H__ diff --git a/include/PolyVoxCore/BaseVolume.inl b/include/PolyVox/BaseVolume.inl similarity index 100% rename from include/PolyVoxCore/BaseVolume.inl rename to include/PolyVox/BaseVolume.inl diff --git a/include/PolyVoxCore/BaseVolumeSampler.inl b/include/PolyVox/BaseVolumeSampler.inl similarity index 99% rename from include/PolyVoxCore/BaseVolumeSampler.inl rename to include/PolyVox/BaseVolumeSampler.inl index 0084f0db..993113a3 100644 --- a/include/PolyVoxCore/BaseVolumeSampler.inl +++ b/include/PolyVox/BaseVolumeSampler.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/Utility.h" +#include "PolyVox/Impl/Utility.h" namespace PolyVox { diff --git a/include/PolyVoxCore/CubicSurfaceExtractor.h b/include/PolyVox/CubicSurfaceExtractor.h similarity index 98% rename from include/PolyVoxCore/CubicSurfaceExtractor.h rename to include/PolyVox/CubicSurfaceExtractor.h index 6ea600e9..b0855061 100644 --- a/include/PolyVoxCore/CubicSurfaceExtractor.h +++ b/include/PolyVox/CubicSurfaceExtractor.h @@ -28,11 +28,11 @@ freely, subject to the following restrictions: #include "PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? -#include "PolyVoxCore/DefaultIsQuadNeeded.h" -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/Vertex.h" +#include "PolyVox/Array.h" +#include "PolyVox/BaseVolume.h" //For wrap modes... should move these? +#include "PolyVox/DefaultIsQuadNeeded.h" +#include "PolyVox/Mesh.h" +#include "PolyVox/Vertex.h" namespace PolyVox { @@ -223,6 +223,6 @@ namespace PolyVox } } -#include "PolyVoxCore/CubicSurfaceExtractor.inl" +#include "PolyVox/CubicSurfaceExtractor.inl" #endif diff --git a/include/PolyVoxCore/CubicSurfaceExtractor.inl b/include/PolyVox/CubicSurfaceExtractor.inl similarity index 99% rename from include/PolyVoxCore/CubicSurfaceExtractor.inl rename to include/PolyVox/CubicSurfaceExtractor.inl index 429140e9..6eefe3ec 100644 --- a/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/include/PolyVox/CubicSurfaceExtractor.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/Timer.h" +#include "PolyVox/Impl/Timer.h" namespace PolyVox { diff --git a/include/PolyVoxCore/DefaultIsQuadNeeded.h b/include/PolyVox/DefaultIsQuadNeeded.h similarity index 94% rename from include/PolyVoxCore/DefaultIsQuadNeeded.h rename to include/PolyVox/DefaultIsQuadNeeded.h index ef15444e..5c25c8c1 100644 --- a/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/include/PolyVox/DefaultIsQuadNeeded.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_DefaultIsQuadNeeded_H__ #define __PolyVox_DefaultIsQuadNeeded_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" #include diff --git a/include/PolyVoxCore/DefaultMarchingCubesController.h b/include/PolyVox/DefaultMarchingCubesController.h similarity index 99% rename from include/PolyVoxCore/DefaultMarchingCubesController.h rename to include/PolyVox/DefaultMarchingCubesController.h index 2d1b6144..5e99f3ae 100644 --- a/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/include/PolyVox/DefaultMarchingCubesController.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_MarchingCubesController_H__ #define __PolyVox_MarchingCubesController_H__ -#include "PolyVoxCore/BaseVolume.h" +#include "PolyVox/BaseVolume.h" #include diff --git a/include/PolyVoxCore/Density.h b/include/PolyVox/Density.h similarity index 97% rename from include/PolyVoxCore/Density.h rename to include/PolyVox/Density.h index 1cb18065..22b24f85 100644 --- a/include/PolyVoxCore/Density.h +++ b/include/PolyVox/Density.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Density_H__ #define __PolyVox_Density_H__ -#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here +#include "PolyVox/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here #include "Impl/TypeDef.h" diff --git a/include/PolyVoxCore/FilePager.h b/include/PolyVox/FilePager.h similarity index 98% rename from include/PolyVoxCore/FilePager.h rename to include/PolyVox/FilePager.h index ed3b7a9a..19c8ca62 100644 --- a/include/PolyVoxCore/FilePager.h +++ b/include/PolyVox/FilePager.h @@ -24,10 +24,10 @@ freely, subject to the following restrictions: #ifndef __PolyVox_FilePager_H__ #define __PolyVox_FilePager_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/Region.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/Region.h" #include #include diff --git a/include/PolyVoxCore/GradientEstimators.h b/include/PolyVox/GradientEstimators.h similarity index 95% rename from include/PolyVoxCore/GradientEstimators.h rename to include/PolyVox/GradientEstimators.h index 02b1eb0c..30ea14ab 100644 --- a/include/PolyVoxCore/GradientEstimators.h +++ b/include/PolyVox/GradientEstimators.h @@ -24,8 +24,8 @@ freely, subject to the following restrictions: #ifndef __PolyVox_GradientEstimators_H__ #define __PolyVox_GradientEstimators_H__ -#include "PolyVoxCore/Vector.h" -#include "PolyVoxCore/VoxelFilters.h" +#include "PolyVox/Vector.h" +#include "PolyVox/VoxelFilters.h" #include @@ -59,6 +59,6 @@ namespace PolyVox //POLYVOX_API Vector3DFloat computeNormal(VolumeType* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); } -#include "PolyVoxCore/GradientEstimators.inl" +#include "PolyVox/GradientEstimators.inl" #endif //__PolyVox_GradientEstimators_H__ diff --git a/include/PolyVoxCore/GradientEstimators.inl b/include/PolyVox/GradientEstimators.inl similarity index 100% rename from include/PolyVoxCore/GradientEstimators.inl rename to include/PolyVox/GradientEstimators.inl diff --git a/include/PolyVoxCore/Impl/AStarPathfinderImpl.h b/include/PolyVox/Impl/AStarPathfinderImpl.h similarity index 99% rename from include/PolyVoxCore/Impl/AStarPathfinderImpl.h rename to include/PolyVox/Impl/AStarPathfinderImpl.h index f37bbfa8..37165eb9 100644 --- a/include/PolyVoxCore/Impl/AStarPathfinderImpl.h +++ b/include/PolyVox/Impl/AStarPathfinderImpl.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_AStarPathfinderImpl_H__ #define __PolyVox_AStarPathfinderImpl_H__ -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" #include #include //For numeric_limits diff --git a/include/PolyVoxCore/Impl/Config.h b/include/PolyVox/Impl/Config.h similarity index 100% rename from include/PolyVoxCore/Impl/Config.h rename to include/PolyVox/Impl/Config.h diff --git a/include/PolyVoxCore/Impl/ErrorHandling.h b/include/PolyVox/Impl/ErrorHandling.h similarity index 99% rename from include/PolyVoxCore/Impl/ErrorHandling.h rename to include/PolyVox/Impl/ErrorHandling.h index a1049bf7..bab86143 100644 --- a/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/include/PolyVox/Impl/ErrorHandling.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_ErrorHandling_H__ #define __PolyVox_ErrorHandling_H__ -#include "PolyVoxCore/Impl/Config.h" +#include "PolyVox/Impl/Config.h" -#include "PolyVoxCore/Impl/Logging.h" +#include "PolyVox/Impl/Logging.h" #include // For std::exit #include // For std::cerr diff --git a/include/PolyVoxCore/Impl/Logging.h b/include/PolyVox/Impl/Logging.h similarity index 99% rename from include/PolyVoxCore/Impl/Logging.h rename to include/PolyVox/Impl/Logging.h index a9a3b2b5..ca8cb3cb 100644 --- a/include/PolyVoxCore/Impl/Logging.h +++ b/include/PolyVox/Impl/Logging.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Logging_H__ #define __PolyVox_Logging_H__ -#include "PolyVoxCore/Impl/Config.h" +#include "PolyVox/Impl/Config.h" #include #include diff --git a/include/PolyVoxCore/Impl/MarchingCubesTables.h b/include/PolyVox/Impl/MarchingCubesTables.h similarity index 99% rename from include/PolyVoxCore/Impl/MarchingCubesTables.h rename to include/PolyVox/Impl/MarchingCubesTables.h index 2a251120..793208d3 100644 --- a/include/PolyVoxCore/Impl/MarchingCubesTables.h +++ b/include/PolyVox/Impl/MarchingCubesTables.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_MarchingCubeTables_H__ #define __PolyVox_MarchingCubeTables_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" #include diff --git a/include/PolyVoxCore/Impl/RandomUnitVectors.h b/include/PolyVox/Impl/RandomUnitVectors.h similarity index 99% rename from include/PolyVoxCore/Impl/RandomUnitVectors.h rename to include/PolyVox/Impl/RandomUnitVectors.h index aac04c05..95ff60e3 100644 --- a/include/PolyVoxCore/Impl/RandomUnitVectors.h +++ b/include/PolyVox/Impl/RandomUnitVectors.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_RandomUnitVectors_H__ #define __PolyVox_RandomUnitVectors_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" namespace PolyVox { diff --git a/include/PolyVoxCore/Impl/RandomVectors.h b/include/PolyVox/Impl/RandomVectors.h similarity index 99% rename from include/PolyVoxCore/Impl/RandomVectors.h rename to include/PolyVox/Impl/RandomVectors.h index a18d5e1f..346587f6 100644 --- a/include/PolyVoxCore/Impl/RandomVectors.h +++ b/include/PolyVox/Impl/RandomVectors.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_RandomVectors_H__ #define __PolyVox_RandomVectors_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" namespace PolyVox { diff --git a/include/PolyVoxCore/Impl/Timer.h b/include/PolyVox/Impl/Timer.h similarity index 100% rename from include/PolyVoxCore/Impl/Timer.h rename to include/PolyVox/Impl/Timer.h diff --git a/include/PolyVoxCore/Impl/TypeDef.h b/include/PolyVox/Impl/TypeDef.h similarity index 100% rename from include/PolyVoxCore/Impl/TypeDef.h rename to include/PolyVox/Impl/TypeDef.h diff --git a/include/PolyVoxCore/Impl/Utility.h b/include/PolyVox/Impl/Utility.h similarity index 98% rename from include/PolyVoxCore/Impl/Utility.h rename to include/PolyVox/Impl/Utility.h index e5ba354c..2fb3e59e 100644 --- a/include/PolyVoxCore/Impl/Utility.h +++ b/include/PolyVox/Impl/Utility.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Utility_H__ #define __PolyVox_Utility_H__ -#include "PolyVoxCore/Impl/TypeDef.h" +#include "PolyVox/Impl/TypeDef.h" #include diff --git a/include/PolyVoxCore/Interpolation.h b/include/PolyVox/Interpolation.h similarity index 100% rename from include/PolyVoxCore/Interpolation.h rename to include/PolyVox/Interpolation.h diff --git a/include/PolyVoxCore/IteratorController.h b/include/PolyVox/IteratorController.h similarity index 94% rename from include/PolyVoxCore/IteratorController.h rename to include/PolyVox/IteratorController.h index b819fd6e..a03ffc75 100644 --- a/include/PolyVoxCore/IteratorController.h +++ b/include/PolyVox/IteratorController.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_IteratorController_H__ #define __PolyVox_IteratorController_H__ -#include "PolyVoxCore/Region.h" +#include "PolyVox/Region.h" namespace PolyVox { @@ -41,6 +41,6 @@ namespace PolyVox }; } -#include "PolyVoxCore/IteratorController.inl" +#include "PolyVox/IteratorController.inl" #endif //__PolyVox_IteratorController_H__ diff --git a/include/PolyVoxCore/IteratorController.inl b/include/PolyVox/IteratorController.inl similarity index 100% rename from include/PolyVoxCore/IteratorController.inl rename to include/PolyVox/IteratorController.inl diff --git a/include/PolyVoxCore/LargeVolume.h b/include/PolyVox/LargeVolume.h similarity index 100% rename from include/PolyVoxCore/LargeVolume.h rename to include/PolyVox/LargeVolume.h diff --git a/include/PolyVoxCore/LowPassFilter.h b/include/PolyVox/LowPassFilter.h similarity index 90% rename from include/PolyVoxCore/LowPassFilter.h rename to include/PolyVox/LowPassFilter.h index 5ec1ea71..75fcbb37 100644 --- a/include/PolyVoxCore/LowPassFilter.h +++ b/include/PolyVox/LowPassFilter.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_LowPassFilter_H__ #define __PolyVox_LowPassFilter_H__ -#include "PolyVoxCore/IteratorController.h" -#include "PolyVoxCore/RawVolume.h" //Is this desirable? -#include "PolyVoxCore/Region.h" +#include "PolyVox/IteratorController.h" +#include "PolyVox/RawVolume.h" //Is this desirable? +#include "PolyVox/Region.h" namespace PolyVox { @@ -54,7 +54,7 @@ namespace PolyVox }//namespace PolyVox -#include "PolyVoxCore/LowPassFilter.inl" +#include "PolyVox/LowPassFilter.inl" #endif //__PolyVox_LowPassFilter_H__ diff --git a/include/PolyVoxCore/LowPassFilter.inl b/include/PolyVox/LowPassFilter.inl similarity index 100% rename from include/PolyVoxCore/LowPassFilter.inl rename to include/PolyVox/LowPassFilter.inl diff --git a/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/include/PolyVox/MarchingCubesSurfaceExtractor.h similarity index 98% rename from include/PolyVoxCore/MarchingCubesSurfaceExtractor.h rename to include/PolyVox/MarchingCubesSurfaceExtractor.h index d1702f22..69ec0569 100644 --- a/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/include/PolyVox/MarchingCubesSurfaceExtractor.h @@ -27,11 +27,11 @@ freely, subject to the following restrictions: #include "Impl/MarchingCubesTables.h" #include "Impl/TypeDef.h" -#include "PolyVoxCore/Array.h" -#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these? -#include "PolyVoxCore/Mesh.h" -#include "PolyVoxCore/DefaultMarchingCubesController.h" -#include "PolyVoxCore/Vertex.h" +#include "PolyVox/Array.h" +#include "PolyVox/BaseVolume.h" //For wrap modes... should move these? +#include "PolyVox/Mesh.h" +#include "PolyVox/DefaultMarchingCubesController.h" +#include "PolyVox/Vertex.h" namespace PolyVox { @@ -353,6 +353,6 @@ namespace PolyVox } } -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl" +#include "PolyVox/MarchingCubesSurfaceExtractor.inl" #endif diff --git a/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl b/include/PolyVox/MarchingCubesSurfaceExtractor.inl similarity index 99% rename from include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl rename to include/PolyVox/MarchingCubesSurfaceExtractor.inl index cf8dcf67..4fb98272 100644 --- a/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl +++ b/include/PolyVox/MarchingCubesSurfaceExtractor.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/Timer.h" +#include "PolyVox/Impl/Timer.h" namespace PolyVox { diff --git a/include/PolyVoxCore/Material.h b/include/PolyVox/Material.h similarity index 96% rename from include/PolyVoxCore/Material.h rename to include/PolyVox/Material.h index 2958d7e5..e3d98c99 100644 --- a/include/PolyVoxCore/Material.h +++ b/include/PolyVox/Material.h @@ -26,7 +26,7 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" -#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type +#include "PolyVox/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type namespace PolyVox { diff --git a/include/PolyVoxCore/MaterialDensityPair.h b/include/PolyVox/MaterialDensityPair.h similarity index 96% rename from include/PolyVoxCore/MaterialDensityPair.h rename to include/PolyVox/MaterialDensityPair.h index 83cc1739..87592ce7 100644 --- a/include/PolyVoxCore/MaterialDensityPair.h +++ b/include/PolyVox/MaterialDensityPair.h @@ -24,8 +24,8 @@ freely, subject to the following restrictions: #ifndef __PolyVox_MaterialDensityPair_H__ #define __PolyVox_MaterialDensityPair_H__ -#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type -#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here +#include "PolyVox/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type +#include "PolyVox/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here #include "Impl/TypeDef.h" diff --git a/include/PolyVoxCore/Mesh.h b/include/PolyVox/Mesh.h similarity index 93% rename from include/PolyVoxCore/Mesh.h rename to include/PolyVox/Mesh.h index 4c1b3582..08bc0d07 100644 --- a/include/PolyVoxCore/Mesh.h +++ b/include/PolyVox/Mesh.h @@ -26,9 +26,9 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vertex.h" //Should probably do away with this on in the future... +#include "PolyVox/PolyVoxForwardDeclarations.h" +#include "PolyVox/Region.h" +#include "PolyVox/Vertex.h" //Should probably do away with this on in the future... #include #include @@ -98,6 +98,6 @@ namespace PolyVox } } -#include "PolyVoxCore/Mesh.inl" +#include "PolyVox/Mesh.inl" #endif /* __Mesh_H__ */ diff --git a/include/PolyVoxCore/Mesh.inl b/include/PolyVox/Mesh.inl similarity index 100% rename from include/PolyVoxCore/Mesh.inl rename to include/PolyVox/Mesh.inl diff --git a/include/PolyVoxCore/PagedVolume.h b/include/PolyVox/PagedVolume.h similarity index 98% rename from include/PolyVoxCore/PagedVolume.h rename to include/PolyVox/PagedVolume.h index adf27243..e5ca536f 100644 --- a/include/PolyVoxCore/PagedVolume.h +++ b/include/PolyVox/PagedVolume.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_PagedVolume_H__ #define __PolyVox_PagedVolume_H__ -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/BaseVolume.h" +#include "PolyVox/Region.h" +#include "PolyVox/Vector.h" #include #include //For abort() @@ -359,8 +359,8 @@ namespace PolyVox }; } -#include "PolyVoxCore/PagedVolume.inl" -#include "PolyVoxCore/PagedVolumeChunk.inl" -#include "PolyVoxCore/PagedVolumeSampler.inl" +#include "PolyVox/PagedVolume.inl" +#include "PolyVox/PagedVolumeChunk.inl" +#include "PolyVox/PagedVolumeSampler.inl" #endif //__PolyVox_PagedVolume_H__ diff --git a/include/PolyVoxCore/PagedVolume.inl b/include/PolyVox/PagedVolume.inl similarity index 99% rename from include/PolyVoxCore/PagedVolume.inl rename to include/PolyVox/PagedVolume.inl index 642c1ff8..e6c5b04b 100644 --- a/include/PolyVoxCore/PagedVolume.inl +++ b/include/PolyVox/PagedVolume.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/ErrorHandling.h" +#include "PolyVox/Impl/ErrorHandling.h" #include #include diff --git a/include/PolyVoxCore/PagedVolumeChunk.inl b/include/PolyVox/PagedVolumeChunk.inl similarity index 99% rename from include/PolyVoxCore/PagedVolumeChunk.inl rename to include/PolyVox/PagedVolumeChunk.inl index d7e249bd..7a51c79b 100644 --- a/include/PolyVoxCore/PagedVolumeChunk.inl +++ b/include/PolyVox/PagedVolumeChunk.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Impl/Utility.h" +#include "PolyVox/Impl/Utility.h" namespace PolyVox { diff --git a/include/PolyVoxCore/PagedVolumeSampler.inl b/include/PolyVox/PagedVolumeSampler.inl similarity index 100% rename from include/PolyVoxCore/PagedVolumeSampler.inl rename to include/PolyVox/PagedVolumeSampler.inl diff --git a/include/PolyVoxCore/Picking.h b/include/PolyVox/Picking.h similarity index 96% rename from include/PolyVoxCore/Picking.h rename to include/PolyVox/Picking.h index ee757ddb..49b026ca 100644 --- a/include/PolyVoxCore/Picking.h +++ b/include/PolyVox/Picking.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Picking_H__ #define __PolyVox_Picking_H__ -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" namespace PolyVox { @@ -44,6 +44,6 @@ namespace PolyVox PickResult pickVoxel(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, const typename VolumeType::VoxelType& emptyVoxelExample); } -#include "PolyVoxCore/Picking.inl" +#include "PolyVox/Picking.inl" #endif //__PolyVox_Picking_H__ diff --git a/include/PolyVoxCore/Picking.inl b/include/PolyVox/Picking.inl similarity index 98% rename from include/PolyVoxCore/Picking.inl rename to include/PolyVox/Picking.inl index c776ee00..c5829f09 100644 --- a/include/PolyVoxCore/Picking.inl +++ b/include/PolyVox/Picking.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Raycast.h" +#include "PolyVox/Raycast.h" namespace PolyVox { diff --git a/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/include/PolyVox/PolyVoxForwardDeclarations.h similarity index 100% rename from include/PolyVoxCore/PolyVoxForwardDeclarations.h rename to include/PolyVox/PolyVoxForwardDeclarations.h diff --git a/include/PolyVoxCore/RawVolume.h b/include/PolyVox/RawVolume.h similarity index 97% rename from include/PolyVoxCore/RawVolume.h rename to include/PolyVox/RawVolume.h index 3201bb8a..73a2f1e5 100644 --- a/include/PolyVoxCore/RawVolume.h +++ b/include/PolyVox/RawVolume.h @@ -24,9 +24,9 @@ freely, subject to the following restrictions: #ifndef __PolyVox_RawVolume_H__ #define __PolyVox_RawVolume_H__ -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/Region.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/BaseVolume.h" +#include "PolyVox/Region.h" +#include "PolyVox/Vector.h" #include //For abort() #include @@ -167,7 +167,7 @@ namespace PolyVox }; } -#include "PolyVoxCore/RawVolume.inl" -#include "PolyVoxCore/RawVolumeSampler.inl" +#include "PolyVox/RawVolume.inl" +#include "PolyVox/RawVolumeSampler.inl" #endif //__PolyVox_RawVolume_H__ diff --git a/include/PolyVoxCore/RawVolume.inl b/include/PolyVox/RawVolume.inl similarity index 100% rename from include/PolyVoxCore/RawVolume.inl rename to include/PolyVox/RawVolume.inl diff --git a/include/PolyVoxCore/RawVolumeSampler.inl b/include/PolyVox/RawVolumeSampler.inl similarity index 100% rename from include/PolyVoxCore/RawVolumeSampler.inl rename to include/PolyVox/RawVolumeSampler.inl diff --git a/include/PolyVoxCore/Raycast.h b/include/PolyVox/Raycast.h similarity index 98% rename from include/PolyVoxCore/Raycast.h rename to include/PolyVox/Raycast.h index 3adb28c4..4d4888b8 100644 --- a/include/PolyVoxCore/Raycast.h +++ b/include/PolyVox/Raycast.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Raycast_H__ #define __PolyVox_Raycast_H__ -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" namespace PolyVox { @@ -98,6 +98,6 @@ namespace PolyVox RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback); } -#include "PolyVoxCore/Raycast.inl" +#include "PolyVox/Raycast.inl" #endif //__PolyVox_Raycast_H__ diff --git a/include/PolyVoxCore/Raycast.inl b/include/PolyVox/Raycast.inl similarity index 100% rename from include/PolyVoxCore/Raycast.inl rename to include/PolyVox/Raycast.inl diff --git a/include/PolyVoxCore/Region.h b/include/PolyVox/Region.h similarity index 99% rename from include/PolyVoxCore/Region.h rename to include/PolyVox/Region.h index 6221b87b..71cdb09f 100644 --- a/include/PolyVoxCore/Region.h +++ b/include/PolyVox/Region.h @@ -26,7 +26,7 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" namespace PolyVox { @@ -458,6 +458,6 @@ namespace PolyVox } } -#include "PolyVoxCore/Region.inl" +#include "PolyVox/Region.inl" #endif diff --git a/include/PolyVoxCore/Region.inl b/include/PolyVox/Region.inl similarity index 100% rename from include/PolyVoxCore/Region.inl rename to include/PolyVox/Region.inl diff --git a/include/PolyVoxCore/SimpleVolume.h b/include/PolyVox/SimpleVolume.h similarity index 100% rename from include/PolyVoxCore/SimpleVolume.h rename to include/PolyVox/SimpleVolume.h diff --git a/include/PolyVoxCore/Vector.h b/include/PolyVox/Vector.h similarity index 99% rename from include/PolyVoxCore/Vector.h rename to include/PolyVox/Vector.h index 416158ed..695ce8c0 100644 --- a/include/PolyVoxCore/Vector.h +++ b/include/PolyVox/Vector.h @@ -242,7 +242,7 @@ namespace std } -#include "PolyVoxCore/Vector.inl" +#include "PolyVox/Vector.inl" #endif diff --git a/include/PolyVoxCore/Vector.inl b/include/PolyVox/Vector.inl similarity index 100% rename from include/PolyVoxCore/Vector.inl rename to include/PolyVox/Vector.inl diff --git a/include/PolyVoxCore/Vertex.h b/include/PolyVox/Vertex.h similarity index 97% rename from include/PolyVoxCore/Vertex.h rename to include/PolyVox/Vertex.h index 1eb6f429..12900c5a 100644 --- a/include/PolyVoxCore/Vertex.h +++ b/include/PolyVox/Vertex.h @@ -26,7 +26,7 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" #include #include diff --git a/include/PolyVoxCore/VolumeResampler.h b/include/PolyVox/VolumeResampler.h similarity index 95% rename from include/PolyVoxCore/VolumeResampler.h rename to include/PolyVox/VolumeResampler.h index ec7aed00..c2869262 100644 --- a/include/PolyVoxCore/VolumeResampler.h +++ b/include/PolyVox/VolumeResampler.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_VolumeResampler_H__ #define __PolyVox_VolumeResampler_H__ -#include "PolyVoxCore/Region.h" +#include "PolyVox/Region.h" namespace PolyVox { @@ -51,7 +51,7 @@ namespace PolyVox }//namespace PolyVox -#include "PolyVoxCore/VolumeResampler.inl" +#include "PolyVox/VolumeResampler.inl" #endif diff --git a/include/PolyVoxCore/VolumeResampler.inl b/include/PolyVox/VolumeResampler.inl similarity index 99% rename from include/PolyVoxCore/VolumeResampler.inl rename to include/PolyVox/VolumeResampler.inl index ae09dfb9..3360d54b 100644 --- a/include/PolyVoxCore/VolumeResampler.inl +++ b/include/PolyVox/VolumeResampler.inl @@ -21,7 +21,7 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#include "PolyVoxCore/Interpolation.h" +#include "PolyVox/Interpolation.h" #include diff --git a/include/PolyVoxCore/VoxelFilters.h b/include/PolyVox/VoxelFilters.h similarity index 96% rename from include/PolyVoxCore/VoxelFilters.h rename to include/PolyVox/VoxelFilters.h index 1c54b9ea..af48dd6d 100644 --- a/include/PolyVoxCore/VoxelFilters.h +++ b/include/PolyVox/VoxelFilters.h @@ -32,6 +32,6 @@ namespace PolyVox float computeSmoothedVoxel(typename VolumeType::Sampler& volIter); } -#include "PolyVoxCore/VoxelFilters.inl" +#include "PolyVox/VoxelFilters.inl" #endif diff --git a/include/PolyVoxCore/VoxelFilters.inl b/include/PolyVox/VoxelFilters.inl similarity index 100% rename from include/PolyVoxCore/VoxelFilters.inl rename to include/PolyVox/VoxelFilters.inl diff --git a/tests/TestAStarPathfinder.cpp b/tests/TestAStarPathfinder.cpp index 15c118d7..c6c52da0 100644 --- a/tests/TestAStarPathfinder.cpp +++ b/tests/TestAStarPathfinder.cpp @@ -23,9 +23,9 @@ freely, subject to the following restrictions: #include "TestAStarPathfinder.h" -#include "PolyVoxCore/AStarPathfinder.h" -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/RawVolume.h" +#include "PolyVox/AStarPathfinder.h" +#include "PolyVox/Material.h" +#include "PolyVox/RawVolume.h" #include diff --git a/tests/TestAmbientOcclusionGenerator.cpp b/tests/TestAmbientOcclusionGenerator.cpp index 97ab7993..253af603 100644 --- a/tests/TestAmbientOcclusionGenerator.cpp +++ b/tests/TestAmbientOcclusionGenerator.cpp @@ -23,8 +23,8 @@ freely, subject to the following restrictions: #include "TestAmbientOcclusionGenerator.h" -#include "PolyVoxCore/AmbientOcclusionCalculator.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/AmbientOcclusionCalculator.h" +#include "PolyVox/PagedVolume.h" #include diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 13aeaee1..5c3a5bfb 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "TestArray.h" -#include "PolyVoxCore/Array.h" +#include "PolyVox/Array.h" #include diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 61398777..0b12bb34 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -23,12 +23,12 @@ freely, subject to the following restrictions: #include "TestCubicSurfaceExtractor.h" -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" +#include "PolyVox/Density.h" +#include "PolyVox/Material.h" +#include "PolyVox/MaterialDensityPair.h" +#include "PolyVox/RawVolume.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/CubicSurfaceExtractor.h" #include diff --git a/tests/TestLowPassFilter.cpp b/tests/TestLowPassFilter.cpp index 5af198b9..849cf927 100644 --- a/tests/TestLowPassFilter.cpp +++ b/tests/TestLowPassFilter.cpp @@ -23,9 +23,9 @@ freely, subject to the following restrictions: #include "TestLowPassFilter.h" -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/LowPassFilter.h" -#include "PolyVoxCore/RawVolume.h" +#include "PolyVox/Density.h" +#include "PolyVox/LowPassFilter.h" +#include "PolyVox/RawVolume.h" #include diff --git a/tests/TestPicking.cpp b/tests/TestPicking.cpp index fa255b55..78f2b5c6 100644 --- a/tests/TestPicking.cpp +++ b/tests/TestPicking.cpp @@ -23,8 +23,8 @@ freely, subject to the following restrictions: #include "TestPicking.h" -#include "PolyVoxCore/Picking.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/Picking.h" +#include "PolyVox/PagedVolume.h" #include diff --git a/tests/TestRaycast.cpp b/tests/TestRaycast.cpp index a7b148fa..655d2b0b 100644 --- a/tests/TestRaycast.cpp +++ b/tests/TestRaycast.cpp @@ -23,11 +23,11 @@ freely, subject to the following restrictions: #include "TestRaycast.h" -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/Raycast.h" -#include "PolyVoxCore/PagedVolume.h" +#include "PolyVox/Density.h" +#include "PolyVox/Raycast.h" +#include "PolyVox/PagedVolume.h" -#include "PolyVoxCore/Impl/RandomUnitVectors.h" +#include "PolyVox/Impl/RandomUnitVectors.h" #include diff --git a/tests/TestRegion.cpp b/tests/TestRegion.cpp index a0f74913..12a100a1 100644 --- a/tests/TestRegion.cpp +++ b/tests/TestRegion.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "TestRegion.h" -#include "PolyVoxCore/Region.h" +#include "PolyVox/Region.h" #include diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 92e28755..bbdca389 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -23,12 +23,12 @@ freely, subject to the following restrictions: #include "TestSurfaceExtractor.h" -#include "PolyVoxCore/Density.h" -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/MaterialDensityPair.h" -#include "PolyVoxCore/RawVolume.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h" +#include "PolyVox/Density.h" +#include "PolyVox/FilePager.h" +#include "PolyVox/MaterialDensityPair.h" +#include "PolyVox/RawVolume.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/MarchingCubesSurfaceExtractor.h" #include diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index 9be146d4..0a301e3e 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -23,12 +23,12 @@ freely, subject to the following restrictions: #include "TestVolumeSubclass.h" -#include "PolyVoxCore/Array.h" +#include "PolyVox/Array.h" -#include "PolyVoxCore/BaseVolume.h" -#include "PolyVoxCore/CubicSurfaceExtractor.h" -#include "PolyVoxCore/Material.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/BaseVolume.h" +#include "PolyVox/CubicSurfaceExtractor.h" +#include "PolyVox/Material.h" +#include "PolyVox/Vector.h" #include diff --git a/tests/testmaterial.cpp b/tests/testmaterial.cpp index a4662e34..4e8b6843 100644 --- a/tests/testmaterial.cpp +++ b/tests/testmaterial.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "testmaterial.h" -#include "PolyVoxCore/Material.h" +#include "PolyVox/Material.h" #include diff --git a/tests/testvector.cpp b/tests/testvector.cpp index 08649f28..61aa4760 100644 --- a/tests/testvector.cpp +++ b/tests/testvector.cpp @@ -23,7 +23,7 @@ freely, subject to the following restrictions: #include "testvector.h" -#include "PolyVoxCore/Vector.h" +#include "PolyVox/Vector.h" #include diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 3eafceb2..df2a3a97 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -23,9 +23,9 @@ freely, subject to the following restrictions: #include "testvolume.h" -#include "PolyVoxCore/FilePager.h" -#include "PolyVoxCore/PagedVolume.h" -#include "PolyVoxCore/RawVolume.h" +#include "PolyVox/FilePager.h" +#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include #include diff --git a/tests/testvolume.h b/tests/testvolume.h index ea1a1d0b..41ec64dd 100644 --- a/tests/testvolume.h +++ b/tests/testvolume.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_TestVolume_H__ #define __PolyVox_TestVolume_H__ -#include "PolyVoxCore/PolyVoxForwardDeclarations.h" +#include "PolyVox/PolyVoxForwardDeclarations.h" #include From 7946e55357408b5de8bca17cc4e810362050ab0f Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 23:11:56 +0100 Subject: [PATCH 258/259] Fixed install on Linux. --- include/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index db01270d..ed978529 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -116,7 +116,7 @@ IF(WIN32) INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) ELSE(WIN32) - INSTALL(DIRECTORY include/ DESTINATION include/PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) + INSTALL(DIRECTORY PolyVox/ DESTINATION include/PolyVox COMPONENT development PATTERN "*.git*" EXCLUDE) ENDIF(WIN32) #Set up install paths e.g. for PolyVoxConfig.cmake From 72be03262a3be40cedfdfdf7739742530ae26692 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 7 Feb 2015 23:21:25 +0100 Subject: [PATCH 259/259] Fixed install to work on Windows. --- include/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index ed978529..ce37965f 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -112,12 +112,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_D ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES}) #Install the core header files, including the ones in the Impl subfolder. -IF(WIN32) - INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE) -ELSE(WIN32) - - INSTALL(DIRECTORY PolyVox/ DESTINATION include/PolyVox COMPONENT development PATTERN "*.git*" EXCLUDE) -ENDIF(WIN32) +INSTALL(DIRECTORY PolyVox/ DESTINATION include/PolyVox COMPONENT development PATTERN "*.git*" EXCLUDE) #Set up install paths e.g. for PolyVoxConfig.cmake if(WIN32)